diff options
author | tb <> | 2024-03-02 09:08:41 +0000 |
---|---|---|
committer | tb <> | 2024-03-02 09:08:41 +0000 |
commit | 571fe2f9899bd7827fb5664d23260ca3313b4042 (patch) | |
tree | 4587a5a5615e0deb2c1e1b46cb85fcf3f88e91e9 /src | |
parent | 072e3a802a3e57c8384497865cc93a9245048694 (diff) | |
download | openbsd-571fe2f9899bd7827fb5664d23260ca3313b4042.tar.gz openbsd-571fe2f9899bd7827fb5664d23260ca3313b4042.tar.bz2 openbsd-571fe2f9899bd7827fb5664d23260ca3313b4042.zip |
Remove beck's ASN.1 time API from public visibility
This API was needed since OpenSSL didn't have one. We now have variants
of OpenSSL's API and will also expose BoringSSL's complementary API. The
users of this API were ported to the OpenSSL variants and some may switch
to BoringSSL's in the future. Part of it is still used internally.
ASN1_time_tm_clamp_notafter() is still used by libtls (and only libtls).
This will be fixed in a future bump.
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_local.h | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/asn1.h | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_cl.c | 3 |
7 files changed, 10 insertions, 20 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 5a6ad4ac30..e21e4d5a9b 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
@@ -129,7 +129,6 @@ ASN1_TIME_print | |||
129 | ASN1_TIME_set | 129 | ASN1_TIME_set |
130 | ASN1_TIME_set_string | 130 | ASN1_TIME_set_string |
131 | ASN1_TIME_set_string_X509 | 131 | ASN1_TIME_set_string_X509 |
132 | ASN1_TIME_set_tm | ||
133 | ASN1_TIME_to_generalizedtime | 132 | ASN1_TIME_to_generalizedtime |
134 | ASN1_TIME_to_tm | 133 | ASN1_TIME_to_tm |
135 | ASN1_TYPE_cmp | 134 | ASN1_TYPE_cmp |
@@ -198,9 +197,7 @@ ASN1_put_eoc | |||
198 | ASN1_put_object | 197 | ASN1_put_object |
199 | ASN1_tag2bit | 198 | ASN1_tag2bit |
200 | ASN1_tag2str | 199 | ASN1_tag2str |
201 | ASN1_time_parse | ||
202 | ASN1_time_tm_clamp_notafter | 200 | ASN1_time_tm_clamp_notafter |
203 | ASN1_time_tm_cmp | ||
204 | ASRange_free | 201 | ASRange_free |
205 | ASRange_it | 202 | ASRange_it |
206 | ASRange_new | 203 | ASRange_new |
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 6bcd61696e..c35225e798 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -1025,7 +1025,6 @@ _libre_ASN1_TIME_normalize | |||
1025 | _libre_ASN1_TIME_set_string_X509 | 1025 | _libre_ASN1_TIME_set_string_X509 |
1026 | _libre_ASN1_TIME_diff | 1026 | _libre_ASN1_TIME_diff |
1027 | _libre_ASN1_TIME_set | 1027 | _libre_ASN1_TIME_set |
1028 | _libre_ASN1_TIME_set_tm | ||
1029 | _libre_ASN1_TIME_adj | 1028 | _libre_ASN1_TIME_adj |
1030 | _libre_ASN1_TIME_check | 1029 | _libre_ASN1_TIME_check |
1031 | _libre_ASN1_TIME_to_generalizedtime | 1030 | _libre_ASN1_TIME_to_generalizedtime |
@@ -1103,8 +1102,6 @@ _libre_ASN1_item_print | |||
1103 | _libre_SMIME_crlf_copy | 1102 | _libre_SMIME_crlf_copy |
1104 | _libre_SMIME_text | 1103 | _libre_SMIME_text |
1105 | _libre_ERR_load_ASN1_strings | 1104 | _libre_ERR_load_ASN1_strings |
1106 | _libre_ASN1_time_parse | ||
1107 | _libre_ASN1_time_tm_cmp | ||
1108 | _libre_BIO_set_flags | 1105 | _libre_BIO_set_flags |
1109 | _libre_BIO_test_flags | 1106 | _libre_BIO_test_flags |
1110 | _libre_BIO_clear_flags | 1107 | _libre_BIO_clear_flags |
diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c index ea94d2f59d..dc568d6636 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.31 2023/10/01 22:14:36 tb Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.32 2024/03/02 09:08:41 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -60,7 +60,6 @@ ASN1_time_tm_cmp(struct tm *tm1, struct tm *tm2) | |||
60 | return (1); | 60 | return (1); |
61 | return 0; | 61 | return 0; |
62 | } | 62 | } |
63 | LCRYPTO_ALIAS(ASN1_time_tm_cmp); | ||
64 | 63 | ||
65 | int | 64 | int |
66 | ASN1_time_tm_clamp_notafter(struct tm *tm) | 65 | ASN1_time_tm_clamp_notafter(struct tm *tm) |
@@ -345,7 +344,6 @@ ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) | |||
345 | 344 | ||
346 | return -1; | 345 | return -1; |
347 | } | 346 | } |
348 | LCRYPTO_ALIAS(ASN1_time_parse); | ||
349 | 347 | ||
350 | /* | 348 | /* |
351 | * ASN1_TIME generic functions. | 349 | * ASN1_TIME generic functions. |
@@ -417,7 +415,6 @@ ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm) | |||
417 | return NULL; | 415 | return NULL; |
418 | return (ASN1_TIME_adj(s, t, 0, 0)); | 416 | return (ASN1_TIME_adj(s, t, 0, 0)); |
419 | } | 417 | } |
420 | LCRYPTO_ALIAS(ASN1_TIME_set_tm); | ||
421 | 418 | ||
422 | ASN1_TIME * | 419 | ASN1_TIME * |
423 | ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec) | 420 | ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec) |
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index c9099465db..63458db944 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1.h,v 1.90 2024/03/02 09:04:07 tb Exp $ */ | 1 | /* $OpenBSD: asn1.h,v 1.91 2024/03/02 09:08:41 tb 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 | * |
@@ -684,7 +684,6 @@ int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, | |||
684 | extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it; | 684 | extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it; |
685 | 685 | ||
686 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); | 686 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); |
687 | ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); | ||
688 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, | 687 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, |
689 | long offset_sec); | 688 | long offset_sec); |
690 | int ASN1_TIME_check(const ASN1_TIME *t); | 689 | int ASN1_TIME_check(const ASN1_TIME *t); |
@@ -1125,8 +1124,6 @@ void ERR_load_ASN1_strings(void); | |||
1125 | #define ASN1_R_WRONG_TAG 168 | 1124 | #define ASN1_R_WRONG_TAG 168 |
1126 | #define ASN1_R_WRONG_TYPE 169 | 1125 | #define ASN1_R_WRONG_TYPE 169 |
1127 | 1126 | ||
1128 | int ASN1_time_parse(const char *_bytes, size_t _len, struct tm *_tm, int _mode); | ||
1129 | int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2); | ||
1130 | #ifdef __cplusplus | 1127 | #ifdef __cplusplus |
1131 | } | 1128 | } |
1132 | #endif | 1129 | #endif |
diff --git a/src/lib/libcrypto/asn1/asn1_local.h b/src/lib/libcrypto/asn1/asn1_local.h index a5478faa0b..e645dcb18e 100644 --- a/src/lib/libcrypto/asn1/asn1_local.h +++ b/src/lib/libcrypto/asn1/asn1_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_local.h,v 1.8 2024/02/18 16:28:38 tb Exp $ */ | 1 | /* $OpenBSD: asn1_local.h,v 1.9 2024/03/02 09:08:41 tb 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 | */ |
@@ -187,4 +187,8 @@ void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | |||
187 | int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | 187 | int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); |
188 | void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | 188 | void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); |
189 | 189 | ||
190 | ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); | ||
191 | int ASN1_time_parse(const char *_bytes, size_t _len, struct tm *_tm, int _mode); | ||
192 | int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2); | ||
193 | |||
190 | __END_HIDDEN_DECLS | 194 | __END_HIDDEN_DECLS |
diff --git a/src/lib/libcrypto/hidden/openssl/asn1.h b/src/lib/libcrypto/hidden/openssl/asn1.h index 169475a0ba..12d9618f80 100644 --- a/src/lib/libcrypto/hidden/openssl/asn1.h +++ b/src/lib/libcrypto/hidden/openssl/asn1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1.h,v 1.11 2024/03/02 09:04:07 tb Exp $ */ | 1 | /* $OpenBSD: asn1.h,v 1.12 2024/03/02 09:08:41 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -154,7 +154,6 @@ LCRYPTO_USED(ASN1_TIME_normalize); | |||
154 | LCRYPTO_USED(ASN1_TIME_set_string_X509); | 154 | LCRYPTO_USED(ASN1_TIME_set_string_X509); |
155 | LCRYPTO_USED(ASN1_TIME_diff); | 155 | LCRYPTO_USED(ASN1_TIME_diff); |
156 | LCRYPTO_USED(ASN1_TIME_set); | 156 | LCRYPTO_USED(ASN1_TIME_set); |
157 | LCRYPTO_USED(ASN1_TIME_set_tm); | ||
158 | LCRYPTO_USED(ASN1_TIME_adj); | 157 | LCRYPTO_USED(ASN1_TIME_adj); |
159 | LCRYPTO_USED(ASN1_TIME_check); | 158 | LCRYPTO_USED(ASN1_TIME_check); |
160 | LCRYPTO_USED(ASN1_TIME_to_generalizedtime); | 159 | LCRYPTO_USED(ASN1_TIME_to_generalizedtime); |
@@ -232,7 +231,5 @@ LCRYPTO_USED(ASN1_item_print); | |||
232 | LCRYPTO_USED(SMIME_crlf_copy); | 231 | LCRYPTO_USED(SMIME_crlf_copy); |
233 | LCRYPTO_USED(SMIME_text); | 232 | LCRYPTO_USED(SMIME_text); |
234 | LCRYPTO_USED(ERR_load_ASN1_strings); | 233 | LCRYPTO_USED(ERR_load_ASN1_strings); |
235 | LCRYPTO_USED(ASN1_time_parse); | ||
236 | LCRYPTO_USED(ASN1_time_tm_cmp); | ||
237 | 234 | ||
238 | #endif /* _LIBCRYPTO_ASN1_H */ | 235 | #endif /* _LIBCRYPTO_ASN1_H */ |
diff --git a/src/lib/libcrypto/ocsp/ocsp_cl.c b/src/lib/libcrypto/ocsp/ocsp_cl.c index 89113f78b8..5ef2226785 100644 --- a/src/lib/libcrypto/ocsp/ocsp_cl.c +++ b/src/lib/libcrypto/ocsp/ocsp_cl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocsp_cl.c,v 1.23 2023/07/08 10:44:00 beck Exp $ */ | 1 | /* $OpenBSD: ocsp_cl.c,v 1.24 2024/03/02 09:08:41 tb Exp $ */ |
2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL | 2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL |
3 | * project. */ | 3 | * project. */ |
4 | 4 | ||
@@ -71,6 +71,7 @@ | |||
71 | #include <openssl/x509.h> | 71 | #include <openssl/x509.h> |
72 | #include <openssl/x509v3.h> | 72 | #include <openssl/x509v3.h> |
73 | 73 | ||
74 | #include "asn1_local.h" | ||
74 | #include "ocsp_local.h" | 75 | #include "ocsp_local.h" |
75 | 76 | ||
76 | /* Utility functions related to sending OCSP requests and extracting | 77 | /* Utility functions related to sending OCSP requests and extracting |