mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
gpg: Split keygrip in a standard key listing.
* g10/keylist.c (print_keygrip): New. (list_keyblock_print): Use new function to print the keygrip.
This commit is contained in:
parent
dd650b2c7b
commit
ab703eacf7
@ -1171,6 +1171,19 @@ dump_attribs (const PKT_user_id *uid, PKT_public_key *pk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_keygrip (const char *keygrip)
|
||||||
|
{
|
||||||
|
const char *s;
|
||||||
|
|
||||||
|
s = strchr (keygrip, ',');
|
||||||
|
if (s)
|
||||||
|
es_fprintf (es_stdout, " Keygrip = %.*s,\n%*s%s\n",
|
||||||
|
(int)(s-keygrip), keygrip, 16, "", s+1);
|
||||||
|
else
|
||||||
|
es_fprintf (es_stdout, " Keygrip = %s\n", keygrip);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* If PK is given the output is written to a new file instead of
|
/* If PK is given the output is written to a new file instead of
|
||||||
* stdout. */
|
* stdout. */
|
||||||
@ -1513,7 +1526,7 @@ list_keyblock_print (ctrl_t ctrl, kbnode_t keyblock, int secret, int fpr,
|
|||||||
print_fingerprint (ctrl, NULL, pk, 0);
|
print_fingerprint (ctrl, NULL, pk, 0);
|
||||||
|
|
||||||
if (opt.with_keygrip && hexgrip)
|
if (opt.with_keygrip && hexgrip)
|
||||||
es_fprintf (es_stdout, " Keygrip = %s\n", hexgrip);
|
print_keygrip (hexgrip);
|
||||||
|
|
||||||
if (serialno)
|
if (serialno)
|
||||||
print_card_serialno (serialno);
|
print_card_serialno (serialno);
|
||||||
@ -1670,7 +1683,7 @@ list_keyblock_print (ctrl_t ctrl, kbnode_t keyblock, int secret, int fpr,
|
|||||||
print_card_serialno (serialno);
|
print_card_serialno (serialno);
|
||||||
}
|
}
|
||||||
if (opt.with_keygrip && hexgrip)
|
if (opt.with_keygrip && hexgrip)
|
||||||
es_fprintf (es_stdout, " Keygrip = %s\n", hexgrip);
|
print_keygrip (hexgrip);
|
||||||
if (opt.with_key_data)
|
if (opt.with_key_data)
|
||||||
print_key_data (pk2);
|
print_key_data (pk2);
|
||||||
if (opt.with_key_screening)
|
if (opt.with_key_screening)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user