[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
Richard Levitte
levitte at openssl.org
Tue May 2 08:41:58 UTC 2017
The branch OpenSSL_1_1_0-stable has been updated
via ae32742e3db45a19aead2c42e30072882492be1d (commit)
from d3d51adc87137fec7472a7e741490622ce725671 (commit)
- Log -----------------------------------------------------------------
commit ae32742e3db45a19aead2c42e30072882492be1d
Author: Todd Short <tshort at akamai.com>
Date: Thu Feb 16 16:08:02 2017 -0500
Fix time offset calculation.
ASN1_GENERALIZEDTIME and ASN1_UTCTIME may be specified using offsets,
even though that's not supported within certificates.
To convert the offset time back to GMT, the offsets are supposed to be
subtracted, not added. e.g. 1759-0500 == 2359+0100 == 2259Z.
Reviewed-by: Rich Salz <rsalz at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Richard Levitte <levitte at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3335)
-----------------------------------------------------------------------
Summary of changes:
crypto/asn1/a_gentm.c | 2 +-
crypto/asn1/a_utctm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c
index c02c8d9..ff1b695 100644
--- a/crypto/asn1/a_gentm.c
+++ b/crypto/asn1/a_gentm.c
@@ -101,7 +101,7 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
if (a[o] == 'Z')
o++;
else if ((a[o] == '+') || (a[o] == '-')) {
- int offsign = a[o] == '-' ? -1 : 1, offset = 0;
+ int offsign = a[o] == '-' ? 1 : -1, offset = 0;
o++;
if (o + 4 > l)
goto err;
diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c
index 7916e30..9797aa8 100644
--- a/crypto/asn1/a_utctm.c
+++ b/crypto/asn1/a_utctm.c
@@ -75,7 +75,7 @@ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
if (a[o] == 'Z')
o++;
else if ((a[o] == '+') || (a[o] == '-')) {
- int offsign = a[o] == '-' ? -1 : 1, offset = 0;
+ int offsign = a[o] == '-' ? 1 : -1, offset = 0;
o++;
if (o + 4 > l)
goto err;
More information about the openssl-commits
mailing list