Bug in gpgme 0.4.2?

Albrecht Dreß albrecht.dress at arcor.de
Mon Aug 4 22:23:02 CEST 2003

Hash: SHA1


when porting the gpg support in balsa from gpgme 0.3.15 to 0.4.2, I think 
I ran into a bug.

If I run gpgme_op_verify() on a message for which the key is missing, I 
get a GPGME general error as result instead of GPG_ERR_NO_PUBKEY. A simple 
test program is attached. To test it, run it e.g. on a RFC 2440 signed 
message body for which you do not have the public key (e.g. this message, 
if you delete my public key from your ring before):

[albrecht at antares albrecht]$ ./gpgme-key-test TEST-NoKey gpgme version is 
signature status: 117440513 = GPGME: General error

gpgme 0.3.15 correctly says that the signature could not be verified due 
to a missing key. The test app works fine if the key is present, even if 
the signature is bad:

[albrecht at antares albrecht]$ ./gpgme-key-test TEST-GoodKeySig
gpgme version is 0.4.2
signature status: 0 = Unspecified source: Success
[albrecht at antares albrecht]$ ./gpgme-key-test TEST-GoodKeyBadSig
gpgme version is 0.4.2
signature status: 117440520 = GPGME: Bad signature

However, for the latter case, IMHO the example on pg. 52 
(gpgme_get_sig_status) is wrong, as "switch(sig->status)" will not hit 
GPG_ERR_BAD_SIGNATURE (missing gpgme_err_code()).

System details: gpgme 0.4.2, gpg-error 0.3, gpg 1.2.2, glibc-2.2.5-1.2.3a, 
gcc-3.2.3 on a Powermac running Yellowdog Linux 2.3.

Any ideas?

Cheers, Albrecht.

- -- 
  Albrecht Dreß  -  Johanna-Kirchner-Straße 13  -  D-53123 Bonn (Germany)
        Phone (+49) 228 6199571  -  mailto:albrecht.dress at arcor.de
Version: GnuPG v1.2.2 (GNU/Linux)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpgme-key-test.c
Type: text/x-c
Size: 1430 bytes
Desc: not available
Url : /pipermail/attachments/20030804/297f2636/gpgme-key-test.bin

More information about the Gnupg-devel mailing list