From: W. Trevor King Date: Wed, 26 Sep 2012 19:38:22 +0000 (-0400) Subject: signature: add 0:'none' to _public_key_algorithm_enum. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d6c3ecfe649a87f12fd52eea37a64abf6751f685;p=pgp-mime.git signature: add 0:'none' to _public_key_algorithm_enum. This avoids crashing with: Exception raised: Traceback (most recent call last): ... File "/home/wking/src/pgp-mime/pgp_mime/signature.py", line 264, in set_public_key_algorithm self.public_key_algorithm = self._public_key_algorithm_enum[value] KeyError: 0 When `gpgme-tool` responds with signatures like: ... (null) ... which I was coming up in the test suite (I'm not sure why). --- diff --git a/pgp_mime/signature.py b/pgp_mime/signature.py index 1f7a1d2..23a0128 100644 --- a/pgp_mime/signature.py +++ b/pgp_mime/signature.py @@ -158,6 +158,7 @@ class Signature (object): _validity_enum_inv = dict((v,k) for k,v in _validity_enum.items()) _public_key_algorithm_enum = { # GPGME_PK_* in gpgme.h + 0: 'none', 1: 'RSA', # Rivest, Shamir, Adleman 2: 'RSA for encryption and decryption only', 3: 'RSA for signing and verification only',