mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
Print the keyid for key packets with --list-packets.
* g10/parse-packet.c (parse_key): Add keyid printing. -- This is backport from GnuPG-2. Note that the --list-packets command is for debugging only and not part iof the stable API. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
9d89564a42
commit
0bdf121d1d
@ -1621,6 +1621,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
int npkey, nskey;
|
int npkey, nskey;
|
||||||
int is_v4=0;
|
int is_v4=0;
|
||||||
int rc=0;
|
int rc=0;
|
||||||
|
u32 keyid[2];
|
||||||
|
|
||||||
version = iobuf_get_noeof(inp); pktlen--;
|
version = iobuf_get_noeof(inp); pktlen--;
|
||||||
if( pkttype == PKT_PUBLIC_SUBKEY && version == '#' ) {
|
if( pkttype == PKT_PUBLIC_SUBKEY && version == '#' ) {
|
||||||
@ -1718,7 +1719,6 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
unknown_pubkey_warning( algorithm );
|
unknown_pubkey_warning( algorithm );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( pkttype == PKT_SECRET_KEY || pkttype == PKT_SECRET_SUBKEY ) {
|
if( pkttype == PKT_SECRET_KEY || pkttype == PKT_SECRET_SUBKEY ) {
|
||||||
PKT_secret_key *sk = pkt->pkt.secret_key;
|
PKT_secret_key *sk = pkt->pkt.secret_key;
|
||||||
byte temp[16];
|
byte temp[16];
|
||||||
@ -1743,6 +1743,9 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
}
|
}
|
||||||
if (rc) /* one of the MPIs were bad */
|
if (rc) /* one of the MPIs were bad */
|
||||||
goto leave;
|
goto leave;
|
||||||
|
if (list_mode && npkey)
|
||||||
|
keyid_from_sk (sk, keyid);
|
||||||
|
|
||||||
sk->protect.algo = iobuf_get_noeof(inp); pktlen--;
|
sk->protect.algo = iobuf_get_noeof(inp); pktlen--;
|
||||||
sk->protect.sha1chk = 0;
|
sk->protect.sha1chk = 0;
|
||||||
if( sk->protect.algo ) {
|
if( sk->protect.algo ) {
|
||||||
@ -1973,8 +1976,15 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
}
|
}
|
||||||
if (rc)
|
if (rc)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
|
if (list_mode)
|
||||||
|
keyid_from_pk (pk, keyid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (list_mode && npkey)
|
||||||
|
fprintf (listfp, "\tkeyid: %08lX%08lX\n",
|
||||||
|
(ulong) keyid[0], (ulong) keyid[1]);
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
iobuf_skip_rest(inp, pktlen, 0);
|
iobuf_skip_rest(inp, pktlen, 0);
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user