Missing g10_errstr() equivalent in gpgme

Fabian Keil freebsd-listen at fabiankeil.de
Sat Nov 2 14:16:00 CET 2013

I occasionally get mails that aren't encrypted with one of my own public
keys, but using keys that don't belong to me.

In this case, claws-mail currently merely notes:
"couldn't decrypt: Decryption failed"

This is the result of this code excerpt from src/plugins/pgpcore/sgpgme.c

| gpgme_data_t sgpgme_decrypt_verify(gpgme_data_t cipher, gpgme_verify_result_t *status, gpgme_ctx_t ctx)
| {
| [...]
|	if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
|		err = gpgme_op_decrypt_verify(ctx, cipher, plain);
|		if (err != GPG_ERR_NO_ERROR) {
|			debug_print("can't decrypt (%s)\n", gpgme_strerror(err));
|			privacy_set_error("%s", gpgme_strerror(err));
|			gpgmegtk_free_passphrase();
|			gpgme_data_release(plain);
|			return NULL;
|		}

Therefore one has to manually use gpg to figure out the cause of the problem:

fk at r500 ~ $gpg --decrypt encrypted-message 
gpg: encrypted with RSA key, ID [...]
gpg: encrypted with RSA key, ID [...]
gpg: decryption failed: secret key not available

As this is tedious, I'd like to modify claws-mail to provide similar
details and am missing something like gnupg's g10_errstr() in gpgme.
I'd prefer not to copy&paste it from gnupg into claws-mail's pgp module.

Any suggestions?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: </pipermail/attachments/20131102/72a06f4e/attachment.sig>

More information about the Gnupg-devel mailing list