signature: add 0:'none' to _public_key_algorithm_enum.
authorW. Trevor King <wking@tremily.us>
Wed, 26 Sep 2012 19:38:22 +0000 (15:38 -0400)
committerW. Trevor King <wking@tremily.us>
Wed, 26 Sep 2012 19:38:22 +0000 (15:38 -0400)
commitd6c3ecfe649a87f12fd52eea37a64abf6751f685
tree3a05c92d437b03585cab4347168be8cdbb1ad96c
parent3a11183a3e9cd43d1a51e7543a17b96984554bef
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:

  <gpgme>
    <verify-result>
      <signatures>
        <signature>
          ...
          <pubkey-algo value="0x0">(null)</pubkey-algo>
          ...
        </signature>
      </signatures>
    </verify-result>
  </gpgme>

which I was coming up in the test suite (I'm not sure why).
pgp_mime/signature.py