From: tb Date: Sat, 2 Mar 2024 09:08:41 +0000 (+0000) Subject: Remove beck's ASN.1 time API from public visibility X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0d6786c6c09da112c8927a9cfd0aa6afd3a236b1;p=openbsd 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 --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 5a6ad4ac30f..e21e4d5a9b0 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -129,7 +129,6 @@ ASN1_TIME_print ASN1_TIME_set ASN1_TIME_set_string ASN1_TIME_set_string_X509 -ASN1_TIME_set_tm ASN1_TIME_to_generalizedtime ASN1_TIME_to_tm ASN1_TYPE_cmp @@ -198,9 +197,7 @@ ASN1_put_eoc ASN1_put_object ASN1_tag2bit ASN1_tag2str -ASN1_time_parse ASN1_time_tm_clamp_notafter -ASN1_time_tm_cmp ASRange_free ASRange_it ASRange_new diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 6bcd61696ec..c35225e7981 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -1025,7 +1025,6 @@ _libre_ASN1_TIME_normalize _libre_ASN1_TIME_set_string_X509 _libre_ASN1_TIME_diff _libre_ASN1_TIME_set -_libre_ASN1_TIME_set_tm _libre_ASN1_TIME_adj _libre_ASN1_TIME_check _libre_ASN1_TIME_to_generalizedtime @@ -1103,8 +1102,6 @@ _libre_ASN1_item_print _libre_SMIME_crlf_copy _libre_SMIME_text _libre_ERR_load_ASN1_strings -_libre_ASN1_time_parse -_libre_ASN1_time_tm_cmp _libre_BIO_set_flags _libre_BIO_test_flags _libre_BIO_clear_flags diff --git a/lib/libcrypto/asn1/a_time_tm.c b/lib/libcrypto/asn1/a_time_tm.c index ea94d2f59db..dc568d66360 100644 --- a/lib/libcrypto/asn1/a_time_tm.c +++ b/lib/libcrypto/asn1/a_time_tm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_time_tm.c,v 1.31 2023/10/01 22:14:36 tb Exp $ */ +/* $OpenBSD: a_time_tm.c,v 1.32 2024/03/02 09:08:41 tb Exp $ */ /* * Copyright (c) 2015 Bob Beck * @@ -60,7 +60,6 @@ ASN1_time_tm_cmp(struct tm *tm1, struct tm *tm2) return (1); return 0; } -LCRYPTO_ALIAS(ASN1_time_tm_cmp); int 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) return -1; } -LCRYPTO_ALIAS(ASN1_time_parse); /* * ASN1_TIME generic functions. @@ -417,7 +415,6 @@ ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm) return NULL; return (ASN1_TIME_adj(s, t, 0, 0)); } -LCRYPTO_ALIAS(ASN1_TIME_set_tm); ASN1_TIME * ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec) diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h index c9099465db2..63458db9447 100644 --- a/lib/libcrypto/asn1/asn1.h +++ b/lib/libcrypto/asn1/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.90 2024/03/02 09:04:07 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.91 2024/03/02 09:08:41 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -684,7 +684,6 @@ int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it; ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); -ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); int ASN1_TIME_check(const ASN1_TIME *t); @@ -1125,8 +1124,6 @@ void ERR_load_ASN1_strings(void); #define ASN1_R_WRONG_TAG 168 #define ASN1_R_WRONG_TYPE 169 -int ASN1_time_parse(const char *_bytes, size_t _len, struct tm *_tm, int _mode); -int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2); #ifdef __cplusplus } #endif diff --git a/lib/libcrypto/asn1/asn1_local.h b/lib/libcrypto/asn1/asn1_local.h index a5478faa0b8..e645dcb18e9 100644 --- a/lib/libcrypto/asn1/asn1_local.h +++ b/lib/libcrypto/asn1/asn1_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_local.h,v 1.8 2024/02/18 16:28:38 tb Exp $ */ +/* $OpenBSD: asn1_local.h,v 1.9 2024/03/02 09:08:41 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -187,4 +187,8 @@ void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); +int ASN1_time_parse(const char *_bytes, size_t _len, struct tm *_tm, int _mode); +int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2); + __END_HIDDEN_DECLS diff --git a/lib/libcrypto/hidden/openssl/asn1.h b/lib/libcrypto/hidden/openssl/asn1.h index 169475a0ba6..12d9618f809 100644 --- a/lib/libcrypto/hidden/openssl/asn1.h +++ b/lib/libcrypto/hidden/openssl/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.11 2024/03/02 09:04:07 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.12 2024/03/02 09:08:41 tb Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -154,7 +154,6 @@ LCRYPTO_USED(ASN1_TIME_normalize); LCRYPTO_USED(ASN1_TIME_set_string_X509); LCRYPTO_USED(ASN1_TIME_diff); LCRYPTO_USED(ASN1_TIME_set); -LCRYPTO_USED(ASN1_TIME_set_tm); LCRYPTO_USED(ASN1_TIME_adj); LCRYPTO_USED(ASN1_TIME_check); LCRYPTO_USED(ASN1_TIME_to_generalizedtime); @@ -232,7 +231,5 @@ LCRYPTO_USED(ASN1_item_print); LCRYPTO_USED(SMIME_crlf_copy); LCRYPTO_USED(SMIME_text); LCRYPTO_USED(ERR_load_ASN1_strings); -LCRYPTO_USED(ASN1_time_parse); -LCRYPTO_USED(ASN1_time_tm_cmp); #endif /* _LIBCRYPTO_ASN1_H */ diff --git a/lib/libcrypto/ocsp/ocsp_cl.c b/lib/libcrypto/ocsp/ocsp_cl.c index 89113f78b87..5ef22267856 100644 --- a/lib/libcrypto/ocsp/ocsp_cl.c +++ b/lib/libcrypto/ocsp/ocsp_cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_cl.c,v 1.23 2023/07/08 10:44:00 beck Exp $ */ +/* $OpenBSD: ocsp_cl.c,v 1.24 2024/03/02 09:08:41 tb Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -71,6 +71,7 @@ #include #include +#include "asn1_local.h" #include "ocsp_local.h" /* Utility functions related to sending OCSP requests and extracting