X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=userdir_gpg.py;h=456833301e624c36afcbf9939d9220c13ab3faa3;hb=d8afebf96422297ccfe9b5702d5aca98735a0676;hp=1140d447ec6bab861511fdf099e763efa192adf8;hpb=7e174bddd965ac6a8f6371c92f97ac73b686eb3d;p=mirror%2Fuserdir-ldap.git diff --git a/userdir_gpg.py b/userdir_gpg.py index 1140d44..4568333 100644 --- a/userdir_gpg.py +++ b/userdir_gpg.py @@ -52,6 +52,9 @@ CleanCutOff = 7*24*60*60; AgeCutOff = 4*24*60*60; FutureCutOff = 3*24*60*60; +def ClearKeyrings(): + del GPGKeyRings[:] + # Set the keyrings, the input is a list of keyrings def SetKeyrings(Rings): for x in Rings: @@ -254,6 +257,7 @@ def GPGWriteFilter(Program,Options,Message): # It is best if the recipient is specified using the hex key fingerprint # of the target, ie 0x64BE1319CCF6D393BF87FF9358A6D4EE def GPGEncrypt(Message,To,PGP2): + Error = "KeyringError" # Encrypt using the PGP5 block encoding and with the PGP5 option set. # This will handle either RSA or DSA/DH asymetric keys. # In PGP2 compatible mode IDEA and rfc1991 encoding are used so that @@ -422,7 +426,7 @@ def GPGCheckSig(Message): # A gpg failure is an automatic bad signature if Exit[1] != 0 and Why == None: GoodSig = 0; - Why = "GPG execution failed " + str(Exit[0]); + Why = "GPG execution returned non-zero exit status: " + str(Exit[1]); if GoodSig == 0 and (Why == None or len(Why) == 0): Why = "Checking Failed";