Remove the tag parameter to IMPLEMENT_EXTERN_ASN1
It would be tempting to move knowledge of the tag to tasn_dec.cc, so
that the callbacks don't need to handle optionality, but this field
cannot express all tags, and we may have to bridge a type that's a
CHOICE.
Instead, remove it, since we're not actually using it.
(Although this macro is public, it is not possible to call it externally
because we don't export ASN1_EXTERN_FUNCS.)
Change-Id: I2adcc2a152b0f643e1d1a70e31510c8bdd432b3d
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/81775
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/x509/x_name.cc b/crypto/x509/x_name.cc
index 035a03a..8597375 100644
--- a/crypto/x509/x_name.cc
+++ b/crypto/x509/x_name.cc
@@ -85,7 +85,7 @@
x509_name_ex_i2d,
};
-IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff)
+IMPLEMENT_EXTERN_ASN1(X509_NAME, x509_name_ff)
IMPLEMENT_ASN1_FUNCTIONS(X509_NAME)
diff --git a/crypto/x509/x_x509.cc b/crypto/x509/x_x509.cc
index be0420c..a2a5bdc 100644
--- a/crypto/x509/x_x509.cc
+++ b/crypto/x509/x_x509.cc
@@ -251,7 +251,7 @@
x509_i2d_cb,
};
-IMPLEMENT_EXTERN_ASN1(X509, V_ASN1_SEQUENCE, x509_extern_funcs)
+IMPLEMENT_EXTERN_ASN1(X509, x509_extern_funcs)
X509 *X509_dup(X509 *x509) {
uint8_t *der = NULL;
diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h
index b3650af..2e8d296 100644
--- a/include/openssl/asn1t.h
+++ b/include/openssl/asn1t.h
@@ -491,8 +491,8 @@
ASN1_ITEM_start(itname) ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, \
sizeof(ASN1_STRING), #itname ASN1_ITEM_end(itname)
-#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
- ASN1_ITEM_start(sname) ASN1_ITYPE_EXTERN, tag, NULL, 0, &fptrs, 0, \
+#define IMPLEMENT_EXTERN_ASN1(sname, fptrs) \
+ ASN1_ITEM_start(sname) ASN1_ITYPE_EXTERN, -1, NULL, 0, &fptrs, 0, \
#sname ASN1_ITEM_end(sname)
/* Macro to implement standard functions in terms of ASN1_ITEM structures */