Unexport a few more ASN1_ITEMs

Update-Note: ASN1_TIME, DIRECTORYSTRING, and DISPLAYTEXT are no longer
usable in custom macro-based ASN.1 types using <openssl/asn1t.h>. There
do not seem to be any external callers that depend on this.

If this sticks then, after all the built-in types are rewritten, we may
be able to remove MSTRING from tasn_* altogether!

Bug: 42290417
Change-Id: Ia12d8767bcada8eda75550e13bbab5a4a572382c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/81729
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/asn1/internal.h b/crypto/asn1/internal.h
index 2baeb12..81bb8d0 100644
--- a/crypto/asn1/internal.h
+++ b/crypto/asn1/internal.h
@@ -225,6 +225,18 @@
   ASN1_ex_i2d *asn1_ex_i2d;
 } ASN1_EXTERN_FUNCS;
 
+// ASN1_TIME is an |ASN1_ITEM| whose ASN.1 type is X.509 Time (RFC 5280) and C
+// type is |ASN1_TIME*|.
+DECLARE_ASN1_ITEM(ASN1_TIME)
+
+// DIRECTORYSTRING is an |ASN1_ITEM| whose ASN.1 type is X.509 DirectoryString
+// (RFC 5280) and C type is |ASN1_STRING*|.
+DECLARE_ASN1_ITEM(DIRECTORYSTRING)
+
+// DISPLAYTEXT is an |ASN1_ITEM| whose ASN.1 type is X.509 DisplayText (RFC
+// 5280) and C type is |ASN1_STRING*|.
+DECLARE_ASN1_ITEM(DISPLAYTEXT)
+
 // ASN1_ANY_AS_STRING is an |ASN1_ITEM| with ASN.1 type ANY and C type
 // |ASN1_STRING*|. Types which are not represented with |ASN1_STRING|, such as
 // |ASN1_OBJECT|, are represented with type |V_ASN1_OTHER|.
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h
index 8eb8e8b..f439acb 100644
--- a/include/openssl/asn1.h
+++ b/include/openssl/asn1.h
@@ -801,10 +801,6 @@
 // 5280), as described in |i2d_SAMPLE|.
 OPENSSL_EXPORT int i2d_DIRECTORYSTRING(const ASN1_STRING *in, uint8_t **outp);
 
-// DIRECTORYSTRING is an |ASN1_ITEM| whose ASN.1 type is X.509 DirectoryString
-// (RFC 5280) and C type is |ASN1_STRING*|.
-DECLARE_ASN1_ITEM(DIRECTORYSTRING)
-
 // B_ASN1_DISPLAYTEXT is a bitmask of types allowed in an X.509 DisplayText (RFC
 // 5280).
 #define B_ASN1_DISPLAYTEXT                                      \
@@ -834,10 +830,6 @@
 // as described in |i2d_SAMPLE|.
 OPENSSL_EXPORT int i2d_DISPLAYTEXT(const ASN1_STRING *in, uint8_t **outp);
 
-// DISPLAYTEXT is an |ASN1_ITEM| whose ASN.1 type is X.509 DisplayText (RFC
-// 5280) and C type is |ASN1_STRING*|.
-DECLARE_ASN1_ITEM(DISPLAYTEXT)
-
 
 // Bit strings.
 //
@@ -1258,10 +1250,6 @@
 // described in |i2d_SAMPLE|.
 OPENSSL_EXPORT int i2d_ASN1_TIME(const ASN1_TIME *in, uint8_t **outp);
 
-// ASN1_TIME is an |ASN1_ITEM| whose ASN.1 type is X.509 Time (RFC 5280) and C
-// type is |ASN1_TIME*|.
-DECLARE_ASN1_ITEM(ASN1_TIME)
-
 // ASN1_TIME_diff computes |to| - |from|. On success, it sets |*out_days| to the
 // difference in days, rounded towards zero, sets |*out_seconds| to the
 // remainder, and returns one. On error, it returns zero.