aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2007-01-31 20:44:48 +0000
committerDavid Shaw <[email protected]>2007-01-31 20:44:48 +0000
commit9f3af9e24dc4fa9038629e7792c26e130bac9d58 (patch)
tree227950be258bad865b0fefb7423c9ad1b1a8afe4
parent* sign.c (write_plaintext_packet): Take timestamp from outside. (diff)
downloadgnupg-9f3af9e24dc4fa9038629e7792c26e130bac9d58.tar.gz
gnupg-9f3af9e24dc4fa9038629e7792c26e130bac9d58.zip
* keyedit.c (sign_uids): Another multiple to single timestamp
operation.
-rw-r--r--g10/ChangeLog3
-rw-r--r--g10/keyedit.c18
2 files changed, 9 insertions, 12 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 54096cfb6..1ea587531 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,8 @@
2007-01-31 David Shaw <[email protected]>
+ * keyedit.c (sign_uids): Another multiple to single timestamp
+ operation.
+
* sign.c (write_plaintext_packet): Take timestamp from outside.
Change all callers.
(sign_file, clearsign_file, sign_symencrypt_file): Calculate one
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 7fa6b6800..1313ee392 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -517,6 +517,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
PKT_public_key *primary_pk=NULL;
int select_all = !count_selected_uids(keyblock) || interactive;
int all_v3=1;
+ u32 timestamp=make_timestamp();
/* Are there any non-v3 sigs on this key already? */
if(PGP2)
@@ -544,7 +545,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
u32 sk_keyid[2],pk_keyid[2];
char *p,*trust_regexp=NULL;
int force_v4=0,class=0,selfsig=0;
- u32 duration=0,timestamp=0;
+ u32 duration=0;
byte trust_depth=0,trust_value=0;
if(local || nonrevocable || trust ||
@@ -818,9 +819,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
if(primary_pk->expiredate && !selfsig)
{
- u32 now=make_timestamp();
-
- if(primary_pk->expiredate<=now)
+ if(primary_pk->expiredate<=timestamp)
{
tty_printf(_("This key has expired!"));
@@ -850,14 +849,9 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
"expire at the same time? (Y/n) "));
if(answer_is_yes_no_default(answer,1))
{
- /* This fixes the signature timestamp we're
- going to make as now. This is so the
- expiration date is exactly correct, and not
- a few seconds off (due to the time it takes
- to answer the questions, enter the
- passphrase, etc). */
- timestamp=now;
- duration=primary_pk->expiredate-now;
+ /* Set our signature expiration date to match
+ when the key is going to expire. */
+ duration=primary_pk->expiredate-timestamp;
force_v4=1;
}