Questions using GPGME

Andreas Heinlein aheinlein at gmx.com
Thu Jul 6 14:48:47 CEST 2017


Am 06.07.2017 um 14:01 schrieb Justus Winter:
>> 2.) Is there a way to safely distinguish "User clicked cancel when asked
>> for the passphrase" from other errors? I think an application should
>> abort silently in this case, but I'm getting another GPGMEError without
>> any clue to the reason.
> Maybe.  GPGMEError is a very general error, this is a bit of pyme
> legacy.  You can inspect the error code using .getcode().  For a quick
> check, try to str() the error.
Thank you for the quick answer. I gave it a try with 3 tests, one
decrypt with cancel'ing the pinentry, one with missing private key and
one with a truncated input file. All three gave

print str(e): Invocation of gpgme_op_decrypt_verify: GPGME: Decryption
failed
print e.getcode(): 152

So this doesn't help. But good to know someone is working on this; I'd
be happy to help where I can. I am not a C developer, though, but I
could test if neccessary.

Bye,
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20170706/c5abfa87/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20170706/c5abfa87/attachment.sig>


More information about the Gnupg-users mailing list