X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=userdir_gpg.py;h=fb5b93887a4dd2c6bd62b2e7e9453902352bb50f;hb=fe67fab54bca15f4820e4f0a911023ed10a743b7;hp=da8abfc72374797e580bd163a76491426f91548d;hpb=c61076ac9d401f7abf65d5e1eac7f5a666a32ba4;p=mirror%2Fuserdir-ldap.git diff --git a/userdir_gpg.py b/userdir_gpg.py index da8abfc..fb5b938 100644 --- a/userdir_gpg.py +++ b/userdir_gpg.py @@ -343,7 +343,7 @@ def GPGCheckSig(Message): # Good signature response if Split[1] == "GOODSIG": # Just in case GPG returned a bad signal before this (bug?) - if Why == None: + if Why is None: GoodSig = 1; KeyID = Split[2]; Owner = ' '.join(Split[3:]) @@ -416,11 +416,11 @@ def GPGCheckSig(Message): Text = Res[2].read(); # A gpg failure is an automatic bad signature - if Exit[1] != 0 and Why == None: + if Exit[1] != 0 and Why is None: GoodSig = 0; Why = "GPG execution returned non-zero exit status: " + str(Exit[1]); - if GoodSig == 0 and (Why == None or len(Why) == 0): + if GoodSig == 0 and (Why is None or len(Why) == 0): Why = "Checking Failed"; # Try to decide if this message was sent using PGP2 @@ -585,7 +585,7 @@ class ReplayCache: # Check a signature. 'sig' is a 3 tuple that has the sigId, date and # key ID def Check(self,Sig): - if Sig[0] == None or Sig[1] == None or Sig[2] == None: + if Sig[0] is None or Sig[1] is None or Sig[2] is None: return "Invalid signature"; if int(Sig[1]) > time.time() + self.FutureCutOff: return "Signature has a time too far in the future"; @@ -598,7 +598,7 @@ class ReplayCache: # Add a signature, the sig is the same as is given to Check def Add(self,Sig): - if Sig[0] == None or Sig[1] == None: + if Sig[0] is None or Sig[1] is None: raise RuntimeError,"Invalid signature"; if Sig[1] < time.time() - self.CleanCutOff: return;