aboutsummaryrefslogtreecommitdiff
path: root/crypto/asn1
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2023-12-18 13:33:36 -0500
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-12-19 17:28:43 +0000
commit538b2a6cf0497cf8bb61ae726a484a3d7a34e54e (patch)
treedf7e1883cede38c1dfa1fc14836424ad2688d169 /crypto/asn1
parent89dd8d9eb4eabb4fbe20eac977f4827065bc493b (diff)
downloadboringssl-538b2a6cf0497cf8bb61ae726a484a3d7a34e54e.zip
boringssl-538b2a6cf0497cf8bb61ae726a484a3d7a34e54e.tar.gz
boringssl-538b2a6cf0497cf8bb61ae726a484a3d7a34e54e.tar.bz2
Restore the X509_EXTENSION ASN1_ITEM too
wpa_supplicant also depends on that one. Change-Id: I6abb505d076eb258e6b8d68be42e624f4aedc725 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/64947 Auto-Submit: David Benjamin <davidben@google.com> Commit-Queue: Bob Beck <bbe@google.com> Reviewed-by: Bob Beck <bbe@google.com>
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/asn1_test.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/asn1/asn1_test.cc b/crypto/asn1/asn1_test.cc
index 196d7b7..c2e5f5b 100644
--- a/crypto/asn1/asn1_test.cc
+++ b/crypto/asn1/asn1_test.cc
@@ -2828,6 +2828,12 @@ struct EMBED_X509_ALGOR {
STACK_OF(X509_ALGOR) *seq;
};
+struct EMBED_X509_EXTENSION {
+ X509_EXTENSION *simple;
+ X509_EXTENSION *opt;
+ STACK_OF(X509_EXTENSION) *seq;
+};
+
struct EMBED_X509_NAME {
X509_NAME *simple;
X509_NAME *opt;
@@ -2856,6 +2862,14 @@ ASN1_SEQUENCE(EMBED_X509_NAME) = {
} ASN1_SEQUENCE_END(EMBED_X509_NAME)
IMPLEMENT_ASN1_FUNCTIONS(EMBED_X509_NAME)
+DECLARE_ASN1_FUNCTIONS(EMBED_X509_EXTENSION)
+ASN1_SEQUENCE(EMBED_X509_EXTENSION) = {
+ ASN1_SIMPLE(EMBED_X509_EXTENSION, simple, X509_EXTENSION),
+ ASN1_EXP_OPT(EMBED_X509_EXTENSION, opt, X509_EXTENSION, 0),
+ ASN1_IMP_SEQUENCE_OF_OPT(EMBED_X509_EXTENSION, seq, X509_EXTENSION, 1),
+} ASN1_SEQUENCE_END(EMBED_X509_EXTENSION)
+IMPLEMENT_ASN1_FUNCTIONS(EMBED_X509_EXTENSION)
+
DECLARE_ASN1_FUNCTIONS(EMBED_X509)
ASN1_SEQUENCE(EMBED_X509) = {
ASN1_SIMPLE(EMBED_X509, simple, X509),
@@ -2940,6 +2954,14 @@ TEST(ASN1Test, EmbedTypes) {
EMBED_X509_NAME_free, d2i_EMBED_X509_NAME, i2d_EMBED_X509_NAME,
sk_X509_NAME_num, sk_X509_NAME_value);
+ static const uint8_t kTestExtension[] = {0x30, 0x0c, 0x06, 0x03, 0x55,
+ 0x1d, 0x13, 0x04, 0x05, 0x30,
+ 0x03, 0x01, 0x01, 0xf};
+ TestEmbedType(kTestExtension, i2d_X509_EXTENSION, EMBED_X509_EXTENSION_new,
+ EMBED_X509_EXTENSION_free, d2i_EMBED_X509_EXTENSION,
+ i2d_EMBED_X509_EXTENSION, sk_X509_EXTENSION_num,
+ sk_X509_EXTENSION_value);
+
static const uint8_t kTestCert[] = {
0x30, 0x82, 0x01, 0xcf, 0x30, 0x82, 0x01, 0x76, 0xa0, 0x03, 0x02, 0x01,
0x02, 0x02, 0x09, 0x00, 0xd9, 0x4c, 0x04, 0xda, 0x49, 0x7d, 0xbf, 0xeb,