[git] GnuPG - branch, master, updated. gnupg-2.1.20-26-g170660e

by NIIBE Yutaka cvs at cvs.gnupg.org
Mon Apr 10 08:09:31 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  170660ed11b56145dea4865e751ae5aff1681fe2 (commit)
      from  7501f2e9c4e6fd94a191b381d52ec2fe1d103e29 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 170660ed11b56145dea4865e751ae5aff1681fe2
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Apr 10 15:04:57 2017 +0900

    agent: Use "ll" length specifier when time_t is larger.
    
    * agent/command.c (cmd_keytocard): Use KEYTOCARD_TIMESTAMP_FORMAT.
    
    --
    
    On a big-endian 32-bit platform which uses 64-bit time_t, it might go
    wrong.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/agent/command.c b/agent/command.c
index 1f8f7c2..ab6d7eb 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2477,6 +2477,12 @@ cmd_delete_key (assuan_context_t ctx, char *line)
 
 
 

+#if SIZEOF_TIME_T > SIZEOF_UNSIGNED_LONG
+#define KEYTOCARD_TIMESTAMP_FORMAT "(10:created-at10:%010llu))"
+#else
+#define KEYTOCARD_TIMESTAMP_FORMAT "(10:created-at10:%010lu))"
+#endif
+
 static const char hlp_keytocard[] =
   "KEYTOCARD [--force] <hexstring_with_keygrip> <serialno> <id> <timestamp>\n"
   "\n";
@@ -2580,7 +2586,7 @@ cmd_keytocard (assuan_context_t ctx, char *line)
   gcry_sexp_release (s_skey);
   keydatalen--;			/* Decrement for last '\0'.  */
   /* Add timestamp "created-at" in the private key */
-  snprintf (keydata+keydatalen-1, 30, "(10:created-at10:%010lu))", timestamp);
+  snprintf (keydata+keydatalen-1, 30, KEYTOCARD_TIMESTAMP_FORMAT, timestamp);
   keydatalen += 10 + 19 - 1;
   err = divert_writekey (ctrl, force, serialno, id, keydata, keydatalen);
   xfree (keydata);

-----------------------------------------------------------------------

Summary of changes:
 agent/command.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list