tests: Improve the output of the run-keylist helper.

* tests/run-keylist.c (main): Print all infos from the primary key.
--

The test tool printed only the computed infos for the key and not the
detailed one fro the primary key.  The new output better reflects the
data structure.

Related to
GnuPG-bug-id: 5454
This commit is contained in:
Werner Koch 2021-05-28 18:31:26 +02:00
parent 367b9e7488
commit 31eb45f016
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -272,11 +272,6 @@ main (int argc, char **argv)
int nsigs; int nsigs;
printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?"); printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?");
printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?");
if (key->subkeys && key->subkeys->keygrip)
printf ("grip : %s\n", key->subkeys->keygrip);
if (key->subkeys && key->subkeys->curve)
printf ("curve : %s\n", key->subkeys->curve);
printf ("caps : %s%s%s%s\n", printf ("caps : %s%s%s%s\n",
key->can_encrypt? "e":"", key->can_encrypt? "e":"",
key->can_sign? "s":"", key->can_sign? "s":"",
@ -294,9 +289,7 @@ main (int argc, char **argv)
printf ("upd : %lu (%u)\n", key->last_update, key->origin); printf ("upd : %lu (%u)\n", key->last_update, key->origin);
subkey = key->subkeys; subkey = key->subkeys;
if (subkey) for (nsub=0; subkey; subkey = subkey->next, nsub++)
subkey = subkey->next;
for (nsub=1; subkey; subkey = subkey->next, nsub++)
{ {
printf ("fpr %2d: %s\n", nsub, nonnull (subkey->fpr)); printf ("fpr %2d: %s\n", nsub, nonnull (subkey->fpr));
if (subkey->keygrip) if (subkey->keygrip)