[git] GPGME - branch, master, updated. gpgme-1.6.0-305-g38798fe

by Werner Koch cvs at cvs.gnupg.org
Wed Aug 24 20:13:38 CEST 2016


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 "GnuPG Made Easy".

The branch, master has been updated
       via  38798fee5b539d6153a8a7856152959412ee59b5 (commit)
      from  1eefc2d43c0adb2ce516f8e3509ace2fb562e401 (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 38798fee5b539d6153a8a7856152959412ee59b5
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 24 20:10:36 2016 +0200

    core: Adjust for TOFU_STATS change in gnupg 2.1.16.
    
    * src/gpgme.h.in (_gpgme_tofu_info): Change 'firstseen' and 'lastseen'
    to a timestamp value.
    * src/verify.c (parse_tofu_stats): Do not cap these values at UINT_MAX.
    --
    
    Using an unsigned long here is okay: We will never get an error and
    even on machines where unsigned long is 32 bit (e.g. Windows64) this
    allows us to operate until 2106.  By then Windows will be a footnote
    in history or Windows128 has changed that type to something larger
    than 32 bit ;-)
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index c07cac8..79a7b9f 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -648,10 +648,10 @@ struct _gpgme_tofu_info
   /* Number of encryptions done with this binding.  Capped at USHRT_MAX.  */
   unsigned short encrcount;
 
-  /* Number of seconds since the first and the most recently seen
-   * message was verified.  */
-  unsigned int firstseen;
-  unsigned int lastseen;
+  /* Number of seconds since Epoch when the first and the most
+   * recently seen message were verified.  0 means unknown. */
+  unsigned long firstseen;
+  unsigned long lastseen;
 
   /* If non-NULL a human readable string summarizing the TOFU data. */
   char *description;
diff --git a/src/verify.c b/src/verify.c
index e573b01..92eb333 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -818,20 +818,16 @@ parse_tofu_stats (gpgme_signature_t sig, char *args)
   if (nfields == 4)
     return 0; /* No more optional fields.  */
 
-  /* Parse first and last seen (none or both are required).  */
+  /* Parse first and last seen timestamps (none or both are required).  */
   if (nfields < 6)
     return trace_gpg_error (GPG_ERR_INV_ENGINE); /* "tm2" missing.  */
   err = _gpgme_strtoul_field (field[4], &uval);
   if (err)
     return trace_gpg_error (GPG_ERR_INV_ENGINE);
-  if (uval > UINT_MAX)
-    uval = UINT_MAX;
   ti->firstseen = uval;
   err = _gpgme_strtoul_field (field[5], &uval);
   if (err)
     return trace_gpg_error (GPG_ERR_INV_ENGINE);
-  if (uval > UINT_MAX)
-    uval = UINT_MAX;
   ti->lastseen = uval;
 
   return 0;

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

Summary of changes:
 src/gpgme.h.in | 8 ++++----
 src/verify.c   | 6 +-----
 2 files changed, 5 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list