From 38798fee5b539d6153a8a7856152959412ee59b5 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 24 Aug 2016 20:10:36 +0200 Subject: 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 --- src/verify.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/verify.c') diff --git a/src/verify.c b/src/verify.c index e573b016..92eb3334 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; -- cgit v1.2.3