diff options
author | David Shaw <[email protected]> | 2006-05-23 03:58:53 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2006-05-23 03:58:53 +0000 |
commit | 197c7a3e47c38811c6dd266136785cf644f76d55 (patch) | |
tree | 659d7eb9dd9c298999ef2f84a0a5e4a575b251a6 /g10/getkey.c | |
parent | * import.c (import_one): Fix bug when importing a new key from a file. (diff) | |
download | gnupg-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/getkey.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index f7c988a33..74c0a74d6 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1506,12 +1506,12 @@ fixup_uidnode ( KBNODE uidnode, KBNODE signode, u32 keycreated ) /* store the key flags in the helper variable for later processing */ uid->help_key_usage=parse_key_usage(sig); - /* ditto or the key expiration */ - uid->help_key_expire = 0; + /* ditto for the key expiration */ p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL); - if ( p ) { - uid->help_key_expire = keycreated + buffer_to_u32(p); - } + if( p && buffer_to_u32(p) ) + uid->help_key_expire = keycreated + buffer_to_u32(p); + else + uid->help_key_expire = 0; /* Set the primary user ID flag - we will later wipe out some * of them to only have one in our keyblock */ @@ -1723,7 +1723,7 @@ merge_selfsigs_main(KBNODE keyblock, int *r_revoked, struct revoke_info *rinfo) key_usage=parse_key_usage(sig); p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL); - if ( p ) + if( p && buffer_to_u32(p) ) { key_expire = keytimestamp + buffer_to_u32(p); key_expire_seen = 1; @@ -2127,7 +2127,7 @@ merge_selfsigs_subkey( KBNODE keyblock, KBNODE subnode ) subpk->pubkey_usage = key_usage; p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL); - if ( p ) + if ( p && buffer_to_u32(p) ) key_expire = keytimestamp + buffer_to_u32(p); else key_expire = 0; |