mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* main.h, keyedit.c, keygen.c: Back out previous (2002-12-01) change.
Minimal isn't always best. * sign.c (update_keysig_packet): Use the current time rather then a modification of the original signature time. Make sure that this doesn't cause a time warp. * keygen.c (keygen_add_key_expire): Properly handle a key expiration date in the past (use a duration of 0). * keyedit.c (menu_expire): Use update_keysig_packet so any sig subpackets are maintained during the update. * build-packet.c (build_sig_subpkt): Mark sig expired or unexpired when the sig expiration subpacket is added. (build_sig_subpkt_from_sig): Handle making an expiration subpacket from a sig that has already expired (use a duration of 0).
This commit is contained in:
parent
6d30580362
commit
2d6a766433
6 changed files with 89 additions and 70 deletions
|
@ -754,6 +754,15 @@ build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
|
|||
sig->flags.revocable=0;
|
||||
break;
|
||||
|
||||
/* This should never happen since we don't currently allow
|
||||
creating such a subpacket, but just in case... */
|
||||
case SIGSUBPKT_SIG_EXPIRE:
|
||||
if(buffer_to_u32(buffer)+sig->timestamp<=make_timestamp())
|
||||
sig->flags.expired=1;
|
||||
else
|
||||
sig->flags.expired=0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -860,7 +869,11 @@ build_sig_subpkt_from_sig( PKT_signature *sig )
|
|||
|
||||
if(sig->expiredate)
|
||||
{
|
||||
u = sig->expiredate-sig->timestamp;
|
||||
if(sig->expiredate>sig->timestamp)
|
||||
u=sig->expiredate-sig->timestamp;
|
||||
else
|
||||
u=0;
|
||||
|
||||
buf[0] = (u >> 24) & 0xff;
|
||||
buf[1] = (u >> 16) & 0xff;
|
||||
buf[2] = (u >> 8) & 0xff;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue