diff options
author | beck <> | 2017-08-27 01:39:26 +0000 |
---|---|---|
committer | beck <> | 2017-08-27 01:39:26 +0000 |
commit | ec59f338ce2a8842a8478c243e444aefb1459dfa (patch) | |
tree | d1b38b4c95049fecffbe49d28ff755942f4edad7 | |
parent | 4d875aa977b8bbe9969527101d0f2d7d67a77b0b (diff) | |
download | openbsd-ec59f338ce2a8842a8478c243e444aefb1459dfa.tar.gz openbsd-ec59f338ce2a8842a8478c243e444aefb1459dfa.tar.bz2 openbsd-ec59f338ce2a8842a8478c243e444aefb1459dfa.zip |
Make the symbol for ASN1_time_tm_clamp_notafter visible so libtls
can get at it, so libtls can also deal with notafter's past the
realm of 32 bit time in portable
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_locl.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 4 | ||||
-rw-r--r-- | src/lib/libtls/tls_conninfo.c | 6 |
4 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 2b8557b16a..94442cc5e3 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
@@ -214,6 +214,7 @@ ASN1_template_free | |||
214 | ASN1_template_i2d | 214 | ASN1_template_i2d |
215 | ASN1_template_new | 215 | ASN1_template_new |
216 | ASN1_time_parse | 216 | ASN1_time_parse |
217 | ASN1_time_tm_clamp_notafter | ||
217 | ASN1_time_tm_cmp | 218 | ASN1_time_tm_cmp |
218 | ASN1_unpack_string | 219 | ASN1_unpack_string |
219 | AUTHORITY_INFO_ACCESS_free | 220 | AUTHORITY_INFO_ACCESS_free |
diff --git a/src/lib/libcrypto/asn1/asn1_locl.h b/src/lib/libcrypto/asn1/asn1_locl.h index 68f71dfc4a..aa35f7b8fc 100644 --- a/src/lib/libcrypto/asn1/asn1_locl.h +++ b/src/lib/libcrypto/asn1/asn1_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_locl.h,v 1.9 2017/08/13 19:47:49 beck Exp $ */ | 1 | /* $OpenBSD: asn1_locl.h,v 1.10 2017/08/27 01:39:26 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -152,6 +152,4 @@ struct x509_crl_method_st { | |||
152 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); | 152 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); |
153 | int UTF8_putc(unsigned char *str, int len, unsigned long value); | 153 | int UTF8_putc(unsigned char *str, int len, unsigned long value); |
154 | 154 | ||
155 | int ASN1_time_tm_clamp_notafter(struct tm *tm); | ||
156 | |||
157 | __END_HIDDEN_DECLS | 155 | __END_HIDDEN_DECLS |
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 23ecf63d60..8efff680c1 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.c,v 1.65 2017/08/13 19:47:49 beck Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.66 2017/08/27 01:39:26 beck Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -143,6 +143,8 @@ static int X509_cmp_time_internal(const ASN1_TIME *ctm, time_t *cmp_time, | |||
143 | 143 | ||
144 | static int internal_verify(X509_STORE_CTX *ctx); | 144 | static int internal_verify(X509_STORE_CTX *ctx); |
145 | 145 | ||
146 | int ASN1_time_tm_clamp_notafter(struct tm *tm); | ||
147 | |||
146 | static int | 148 | static int |
147 | null_callback(int ok, X509_STORE_CTX *e) | 149 | null_callback(int ok, X509_STORE_CTX *e) |
148 | { | 150 | { |
diff --git a/src/lib/libtls/tls_conninfo.c b/src/lib/libtls/tls_conninfo.c index 87660fa989..e3820988e8 100644 --- a/src/lib/libtls/tls_conninfo.c +++ b/src/lib/libtls/tls_conninfo.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_conninfo.c,v 1.15 2017/04/05 03:19:22 beck Exp $ */ | 1 | /* $OpenBSD: tls_conninfo.c,v 1.16 2017/08/27 01:39:26 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
@@ -23,6 +23,8 @@ | |||
23 | #include <tls.h> | 23 | #include <tls.h> |
24 | #include "tls_internal.h" | 24 | #include "tls_internal.h" |
25 | 25 | ||
26 | int ASN1_time_tm_clamp_notafter(struct tm *tm); | ||
27 | |||
26 | int | 28 | int |
27 | tls_hex_string(const unsigned char *in, size_t inlen, char **out, | 29 | tls_hex_string(const unsigned char *in, size_t inlen, char **out, |
28 | size_t *outlen) | 30 | size_t *outlen) |
@@ -121,6 +123,8 @@ tls_get_peer_cert_times(struct tls *ctx, time_t *notbefore, | |||
121 | goto err; | 123 | goto err; |
122 | if (ASN1_time_parse(after->data, after->length, &after_tm, 0) == -1) | 124 | if (ASN1_time_parse(after->data, after->length, &after_tm, 0) == -1) |
123 | goto err; | 125 | goto err; |
126 | if (!ASN1_time_tm_clamp_notafter(&after_tm)) | ||
127 | goto err; | ||
124 | if ((*notbefore = timegm(&before_tm)) == -1) | 128 | if ((*notbefore = timegm(&before_tm)) == -1) |
125 | goto err; | 129 | goto err; |
126 | if ((*notafter = timegm(&after_tm)) == -1) | 130 | if ((*notafter = timegm(&after_tm)) == -1) |