diff options
author | jsing <> | 2015-10-05 06:13:58 +0000 |
---|---|---|
committer | jsing <> | 2015-10-05 06:13:58 +0000 |
commit | e5feab6806a6930073604ac703eb1169c7198063 (patch) | |
tree | 4358a08d2c1e1c7d210872a29162640fac1c2040 /src | |
parent | f97ab44d7b0a4185f9d2a463b1362407042c517f (diff) | |
download | openbsd-e5feab6806a6930073604ac703eb1169c7198063.tar.gz openbsd-e5feab6806a6930073604ac703eb1169c7198063.tar.bz2 openbsd-e5feab6806a6930073604ac703eb1169c7198063.zip |
Make sure dot is not set after tz - fixes incorrect handling, which allows
20151005171301+1.09Z to be treated as a valid time.
ok beck@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_time_tm.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c index 7b25e439c4..81a92ad6d8 100644 --- a/src/lib/libcrypto/asn1/a_time_tm.c +++ b/src/lib/libcrypto/asn1/a_time_tm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_time_tm.c,v 1.2 2015/10/04 15:15:11 jsing Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.3 2015/10/05 06:13:58 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -120,7 +120,7 @@ asn1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) | |||
120 | char *t = buf + i; | 120 | char *t = buf + i; |
121 | if (isdigit((unsigned char)*t)) | 121 | if (isdigit((unsigned char)*t)) |
122 | continue; | 122 | continue; |
123 | if (*t == '.' && dot == NULL) { | 123 | if (*t == '.' && dot == NULL && tz == NULL) { |
124 | dot = t; | 124 | dot = t; |
125 | continue; | 125 | continue; |
126 | } | 126 | } |
diff --git a/src/lib/libssl/src/crypto/asn1/a_time_tm.c b/src/lib/libssl/src/crypto/asn1/a_time_tm.c index 7b25e439c4..81a92ad6d8 100644 --- a/src/lib/libssl/src/crypto/asn1/a_time_tm.c +++ b/src/lib/libssl/src/crypto/asn1/a_time_tm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_time_tm.c,v 1.2 2015/10/04 15:15:11 jsing Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.3 2015/10/05 06:13:58 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -120,7 +120,7 @@ asn1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) | |||
120 | char *t = buf + i; | 120 | char *t = buf + i; |
121 | if (isdigit((unsigned char)*t)) | 121 | if (isdigit((unsigned char)*t)) |
122 | continue; | 122 | continue; |
123 | if (*t == '.' && dot == NULL) { | 123 | if (*t == '.' && dot == NULL && tz == NULL) { |
124 | dot = t; | 124 | dot = t; |
125 | continue; | 125 | continue; |
126 | } | 126 | } |