From f72cf726ca749a138a8950b02c51e7b3a50c6a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Fri, 6 May 2022 09:34:18 +0200 Subject: [PATCH] core: Set SECRET flag of subkeys stored on smart cards * src/keylist.c (parse_sec_field15): Set SECRET flag. -- Explicitly setting the SECRET flag for subkeys stored on smart cards makes sure that the flag is also set if GPGME_KEYLIST_MODE_WITH_SECRET is used when listing OpenPGP keys (as documented in the API documentation). If secret keys are listed, then the flag is already set when the packet type is parsed. GnuPG-bug-id: 5965 --- src/keylist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/keylist.c b/src/keylist.c index 05267e6c..a003179e 100644 --- a/src/keylist.c +++ b/src/keylist.c @@ -423,6 +423,7 @@ parse_sec_field15 (gpgme_key_t key, gpgme_subkey_t subkey, char *field) { /* Fields starts with a hex digit; thus it is a serial number. */ key->secret = 1; + subkey->secret = 1; subkey->is_cardkey = 1; subkey->card_number = strdup (field); if (!subkey->card_number)