* keyedit.c (sign_uids): Another multiple to single timestamp
authorDavid Shaw <dshaw@jabberwocky.com>
Wed, 31 Jan 2007 20:44:48 +0000 (20:44 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Wed, 31 Jan 2007 20:44:48 +0000 (20:44 +0000)
operation.

g10/ChangeLog
g10/keyedit.c

index 54096cf..1ea5875 100644 (file)
@@ -1,5 +1,8 @@
 2007-01-31  David Shaw  <dshaw@jabberwocky.com>
 
+       * 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
index 7fa6b68..1313ee3 100644 (file)
@@ -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;
                      }