aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-05-13 11:42:34 +0000
committerWerner Koch <[email protected]>2009-05-13 11:42:34 +0000
commita766a37290cf334d5eead1041ea271a5d714d66f (patch)
treec3b804cebf89ec95903775e9e1ebb4ec5ea86257 /g10/keygen.c
parentFix bug 1045. (diff)
downloadgnupg-a766a37290cf334d5eead1041ea271a5d714d66f.tar.gz
gnupg-a766a37290cf334d5eead1041ea271a5d714d66f.zip
Print keyid in gpg --list-packets.
Add some not yet code to app-nks.c Changed batch mode expiration time computation
Diffstat (limited to '')
-rw-r--r--g10/keygen.c8
1 files changed, 6 insertions, 2 deletions
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