mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* 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".
This commit is contained in:
parent
3bee120e15
commit
197c7a3e47
6 changed files with 34 additions and 19 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue