piece.gpg_data.plainobj = parse_pgp_mime(plaintext, gpgme_ctx)
elif piece.piece_type == "pubkey":
- fingerprints = add_gpg_key(piece.string, gpgme_ctx)
+ key_fps = add_gpg_key(piece.string, gpgme_ctx)
- if fingerprints != []:
+ if key_fps != []:
piece.gpg_data = GPGData()
- piece.gpg_data.keys = fingerprints
+ piece.gpg_data.keys = key_fps
elif piece.piece_type == "clearsign":
- (plaintext, fingerprints) = verify_clear_signature(piece.string, gpgme_ctx)
+ (plaintext, sig_fps) = verify_clear_signature(piece.string, gpgme_ctx)
- if fingerprints != []:
+ if sig_fps != []:
piece.gpg_data = GPGData()
- piece.gpg_data.sigs = fingerprints
+ piece.gpg_data.sigs = sig_fps
piece.gpg_data.plainobj = parse_pgp_mime(plaintext, gpgme_ctx)
elif piece.piece_type == "detachedsig":
for prev in prev_parts:
payload_bytes = prev.payload_bytes
- sigs_fps = verify_detached_signature(piece.string, payload_bytes, gpgme_ctx)
+ sig_fps = verify_detached_signature(piece.string, payload_bytes, gpgme_ctx)
- if sigs_fps != []:
+ if sig_fps != []:
piece.gpg_data = GPGData()
- piece.gpg_data.sigs = sigs_fps
+ piece.gpg_data.sigs = sig_fps
piece.gpg_data.plainobj = prev
else:
pass
result = gpgme_ctx.import_(fp)
imports = result.imports
- fingerprints = []
+ key_fingerprints = []
if imports != []:
for import_ in imports:
fingerprint = import_[0]
- fingerprints += [fingerprint]
+ key_fingerprints += [fingerprint]
debug("added gpg key: " + fingerprint)
- return fingerprints
+ return key_fingerprints
def verify_clear_signature (sig_block, gpgme_ctx):
# FIXME: this might require using the charset of the mime part.
plaintext = ptxt_fp.getvalue().decode('utf-8')
- fingerprints = []
+ sig_fingerprints = []
for res_ in result:
- fingerprints += [res_.fpr]
+ sig_fingerprints += [res_.fpr]
- return plaintext, fingerprints
+ return plaintext, sig_fingerprints
def verify_detached_signature (detached_sig, plaintext_bytes, gpgme_ctx):