Help with GPGME keylisting not listing signatures

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with GPGME keylisting not listing signatures

GnuPG - User mailing list
I'm having trouble writing a program using GPGME that is able to read the
signatures of keys from a file. I've ensured that GPGME_KEYLIST_MODE_SIGS is
specified and would appreciate additional eyeballs on it. I've tested it with
the Debian keyring which has many signatures and not had any luck.

The code is at https://salsa.debian.org/-/snippets/519 or can be cloned from
https://salsa.debian.org/snippets/519.git

I'm using GPGME 1.14.0-1+b2 on Debian Bullseye (testing) with GnuPG 2.2.20 and
libgcrypt 1.8.7.

Thanks!
John
_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

signature.asc (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with GPGME keylisting not listing signatures

Ingo Klöcker
On Samstag, 23. Januar 2021 04:11:53 CET John Scott via Gnupg-users wrote:
> I'm having trouble writing a program using GPGME that is able to read the
> signatures of keys from a file. I've ensured that GPGME_KEYLIST_MODE_SIGS is
> specified and would appreciate additional eyeballs on it. I've tested it
> with the Debian keyring which has many signatures and not had any luck.
>
> The code is at https://salsa.debian.org/-/snippets/519 or can be cloned from
> https://salsa.debian.org/snippets/519.git

Did you have a look at GPGME's tests as working example code? There is a test
for listing signatures:
https://dev.gnupg.org/source/gpgme/browse/master/tests/gpg/t-keylist-sig.c

Also: Did you run your program with debug output? You can enable GPGME's debug
output with the environment variable GPGME_DEBUG=<debug level>. See
https://dev.gnupg.org/source/gpgme/browse/master/src/debug.h
for the different debug levels. With debug level 7 (DEBUG_SYSIO) you'll see
(among a lot of other debug output) with which arguments GPGME calls gpg.

Regards,
Ingo

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with GPGME keylisting not listing signatures

GnuPG - User mailing list
On Saturday, January 23, 2021 10:39:30 AM EST Ingo Klöcker wrote:
> Did you have a look at GPGME's tests as working example code? There is a
> test for listing signatures:
> https://dev.gnupg.org/source/gpgme/browse/master/tests/gpg/t-keylist-sig.c
Thanks, I didn't see that. Except for the difference that I read the keys from
a gpgme_data_t connected to a stream instead of GnuPG's keyring, my code seems
to match up with the test's way of doing things.

With the debugging information on the invocation of gpg doesn't look abnormal,
and trying in a fresh chroot gets me the same results, so it seems as though
getting detailed signature data from a gpgme_data_t may not be possible. My
example for testing is at https://salsa.debian.org/-/snippets/519
_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

signature.asc (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with GPGME keylisting not listing signatures

Ingo Klöcker
On Samstag, 30. Januar 2021 00:22:11 CET John Scott via Gnupg-users wrote:

> On Saturday, January 23, 2021 10:39:30 AM EST Ingo Klöcker wrote:
> > Did you have a look at GPGME's tests as working example code? There is a
> > test for listing signatures:
> > https://dev.gnupg.org/source/gpgme/browse/master/tests/gpg/t-keylist-sig.c
>
> Thanks, I didn't see that. Except for the difference that I read the keys
> from a gpgme_data_t connected to a stream instead of GnuPG's keyring, my
> code seems to match up with the test's way of doing things.
>
> With the debugging information on the invocation of gpg doesn't look
> abnormal, and trying in a fresh chroot gets me the same results, so it
> seems as though getting detailed signature data from a gpgme_data_t may not
> be possible. My example for testing is at
> https://salsa.debian.org/-/snippets/519
You are using gpgme_op_keylist_from_data_start(). This effectively does
gpg --with-colons --with-fingerprint --import-options import-show --dry-run --import -- <keys.asc
(see https://dev.gnupg.org/source/gpgme/browse/master/src/engine-gpg.c;c8fd8870b3bf089f99156448b7d1e59c1150f994$3116)
which doesn't print any information on signatures.

You would need an additional --with-sig-check if GPGME_KEYLIST_MODE_SIGS is
set. Adding this to ​gpg_keylist_data() should be fairly easy.

Feel free to request this feature via https://dev.gnupg.org/, ideally
together with a patch.

Regards,
Ingo

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

signature.asc (201 bytes) Download Attachment