aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog7
-rw-r--r--g10/keygen.c8
-rw-r--r--g10/parse-packet.c10
3 files changed, 23 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 3ed1e5c7a..ef51b4a77 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,12 @@
+2009-05-13 Werner Koch <[email protected]>
+
+ * keygen.c (parse_expire_string): Base ISO date string at noon.
+ Also allow full ISO timestamp.
+
2009-05-11 Werner Koch <[email protected]>
+ * 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.
diff --git a/g10/keygen.c b/g10/keygen.c
index 6a37471cb..8afa74e3e 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -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
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 57f94cd85..fd01e7635 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -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;