aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2006-05-23 03:58:53 +0000
committerDavid Shaw <[email protected]>2006-05-23 03:58:53 +0000
commit197c7a3e47c38811c6dd266136785cf644f76d55 (patch)
tree659d7eb9dd9c298999ef2f84a0a5e4a575b251a6 /g10/parse-packet.c
parent* import.c (import_one): Fix bug when importing a new key from a file. (diff)
downloadgnupg-197c7a3e47c38811c6dd266136785cf644f76d55.tar.gz
gnupg-197c7a3e47c38811c6dd266136785cf644f76d55.zip
* parse-packet.c (dump_sig_subpkt, parse_signature), build-packet.c
(build_sig_subpkt_from_sig), getkey.c (fixup_uidnode, merge_selfsigs_main, merge_selfsigs_subkey), keygen.c (keygen_add_key_expire): Fix meaning of key expiration and sig expiration subpackets - zero means "never expire" according to 2440, not "expire instantly".
Diffstat (limited to '')
-rw-r--r--g10/parse-packet.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index b67ad7f82..4cb878b14 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1,6 +1,6 @@
/* parse-packet.c - read packets
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- * 2005 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ * 2006 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -822,8 +822,13 @@ dump_sig_subpkt( int hashed, int type, int critical,
break;
case SIGSUBPKT_SIG_EXPIRE:
if( length >= 4 )
- fprintf (listfp, "sig expires after %s",
- strtimevalue( buffer_to_u32(buffer) ) );
+ {
+ if(buffer_to_u32(buffer))
+ fprintf (listfp, "sig expires after %s",
+ strtimevalue( buffer_to_u32(buffer) ) );
+ else
+ fprintf (listfp, "sig does not expire");
+ }
break;
case SIGSUBPKT_EXPORTABLE:
if( length )
@@ -847,8 +852,13 @@ dump_sig_subpkt( int hashed, int type, int critical,
break;
case SIGSUBPKT_KEY_EXPIRE:
if( length >= 4 )
- fprintf (listfp, "key expires after %s",
- strtimevalue( buffer_to_u32(buffer) ) );
+ {
+ if(buffer_to_u32(buffer))
+ fprintf (listfp, "key expires after %s",
+ strtimevalue( buffer_to_u32(buffer) ) );
+ else
+ fprintf (listfp, "key does not expire");
+ }
break;
case SIGSUBPKT_PREF_SYM:
fputs("pref-sym-algos:", listfp );
@@ -1353,7 +1363,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
log_info ("signature packet without keyid\n");
p=parse_sig_subpkt(sig->hashed,SIGSUBPKT_SIG_EXPIRE,NULL);
- if(p)
+ if(p && buffer_to_u32(p))
sig->expiredate=sig->timestamp+buffer_to_u32(p);
if(sig->expiredate && sig->expiredate<=make_timestamp())
sig->flags.expired=1;