1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Print keyid in gpg --list-packets.

Add some not yet code to app-nks.c
Changed batch mode expiration time computation
This commit is contained in:
Werner Koch 2009-05-13 11:42:34 +00:00
parent dcc0907793
commit a766a37290
6 changed files with 121 additions and 5 deletions

View file

@ -1,5 +1,12 @@
2009-05-13 Werner Koch <wk@g10code.com>
* keygen.c (parse_expire_string): Base ISO date string at noon.
Also allow full ISO timestamp.
2009-05-11 Werner Koch <wk@g10code.com>
* parse-packet.c (parse_key): Print the key id in list mode.
* skclist.c (build_sk_list): Use log_info for "duplicated entry".
Fixes bug#1045.

View file

@ -1799,13 +1799,17 @@ parse_expire_string( const char *string )
u32 seconds;
u32 abs_date = 0;
u32 curtime = make_timestamp ();
time_t tt;
if (!*string)
seconds = 0;
else if (!strncmp (string, "seconds=", 8))
seconds = atoi (string+8);
else if ((abs_date = scan_isodatestr(string)) && abs_date > curtime)
seconds = abs_date - curtime;
else if ((abs_date = scan_isodatestr(string))
&& (abs_date+86400/2) > curtime)
seconds = (abs_date+86400/2) - curtime;
else if ((tt = isotime2epoch (string)) != (time_t)(-1))
seconds = (u32)tt - curtime;
else if ((mult = check_valid_days (string)))
seconds = atoi (string) * 86400L * mult;
else

View file

@ -1672,6 +1672,7 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
int npkey, nskey;
int is_v4=0;
int rc=0;
u32 keyid[2];
(void)hdr;
@ -1997,6 +1998,9 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
fprintf (listfp, "\tchecksum: %04hx\n", sk->csum);
}
}
if (list_mode)
keyid_from_sk (sk, keyid);
}
else {
PKT_public_key *pk = pkt->pkt.public_key;
@ -2021,8 +2025,14 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
}
if (rc)
goto leave;
if (list_mode)
keyid_from_pk (pk, keyid);
}
if (list_mode)
fprintf (listfp, "\tkeyid: %08lX%08lX\n",
(ulong)keyid[0], (ulong)keyid[1]);
leave:
iobuf_skip_rest(inp, pktlen, 0);
return rc;