From a259a5484237190bf58d57fd80a8b107ad82869f Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 20 Oct 2021 00:35:43 -0400 Subject: [PATCH] Unexport ASN1_OBJECT_new. Outside the library, this function is practically useless. It creates an empty ASN1_OBJECT, which can never be filled in because the struct is private and there are no mutating setters. (See https://boringssl-review.googlesource.com/c/boringssl/+/46164 and https://boringssl-review.googlesource.com/c/boringssl/+/48326 for a discussion on why it's important ASN1_OBJECTs are immutable.) Update-Note: ASN1_OBJECT_new is no longer exported. While this function does remain in OpenSSL, it is extremely unlikely anyone has found a use for this function. Bug: 452 Change-Id: I111a9a1ce3ca4d7aa717a3c3a03d34c05af8fdbd Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/50025 Reviewed-by: Adam Langley Commit-Queue: David Benjamin --- crypto/asn1/internal.h | 2 ++ include/openssl/asn1.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/asn1/internal.h b/crypto/asn1/internal.h index 573149939..4190e61df 100644 --- a/crypto/asn1/internal.h +++ b/crypto/asn1/internal.h @@ -106,6 +106,8 @@ struct asn1_object_st { int flags; /* Should we free this one */ }; +ASN1_OBJECT *ASN1_OBJECT_new(void); + int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index d376c1a3b..f49fafb6a 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -1618,7 +1618,6 @@ typedef int i2d_of_void(const void *, unsigned char **); #define B_ASN1_DISPLAYTEXT \ B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING -OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_new(void); OPENSSL_EXPORT void ASN1_OBJECT_free(ASN1_OBJECT *a); OPENSSL_EXPORT int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp); OPENSSL_EXPORT ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a,