diff options
author | jsing <> | 2015-02-11 03:39:51 +0000 |
---|---|---|
committer | jsing <> | 2015-02-11 03:39:51 +0000 |
commit | a4446bfb10ec0a821da3861d90dc625a93d84cff (patch) | |
tree | d942bf9cb3a1b441f2c996072292ae69b1aa83d2 /src/lib/libcrypto/asn1/nsseq.c | |
parent | dea579e3ced20a997dc9c2b82eb0c086555a68b8 (diff) | |
download | openbsd-a4446bfb10ec0a821da3861d90dc625a93d84cff.tar.gz openbsd-a4446bfb10ec0a821da3861d90dc625a93d84cff.tar.bz2 openbsd-a4446bfb10ec0a821da3861d90dc625a93d84cff.zip |
Expand most of the ASN1_SEQUENCE* and associated macros, making the data
structures visible and easier to review, without having to wade through
layers and layers of asn1t.h macros.
Change has been scripted and the generated assembly only differs by changes
to line numbers.
Discussed with beck@ miod@ tedu@
Diffstat (limited to 'src/lib/libcrypto/asn1/nsseq.c')
-rw-r--r-- | src/lib/libcrypto/asn1/nsseq.c | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/nsseq.c b/src/lib/libcrypto/asn1/nsseq.c index ceab3992fd..dff9b189d9 100644 --- a/src/lib/libcrypto/asn1/nsseq.c +++ b/src/lib/libcrypto/asn1/nsseq.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: nsseq.c,v 1.8 2015/02/09 15:05:59 jsing Exp $ */ | 1 | /* $OpenBSD: nsseq.c,v 1.9 2015/02/11 03:39:51 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -75,10 +75,40 @@ nsseq_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) | |||
75 | 75 | ||
76 | /* Netscape certificate sequence structure */ | 76 | /* Netscape certificate sequence structure */ |
77 | 77 | ||
78 | ASN1_SEQUENCE_cb(NETSCAPE_CERT_SEQUENCE, nsseq_cb) = { | 78 | static const ASN1_AUX NETSCAPE_CERT_SEQUENCE_aux = { |
79 | ASN1_SIMPLE(NETSCAPE_CERT_SEQUENCE, type, ASN1_OBJECT), | 79 | .app_data = NULL, |
80 | ASN1_EXP_SEQUENCE_OF_OPT(NETSCAPE_CERT_SEQUENCE, certs, X509, 0) | 80 | .flags = 0, |
81 | } ASN1_SEQUENCE_END_cb(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) | 81 | .ref_offset = 0, |
82 | .ref_lock = 0, | ||
83 | .asn1_cb = nsseq_cb, | ||
84 | .enc_offset = 0, | ||
85 | }; | ||
86 | static const ASN1_TEMPLATE NETSCAPE_CERT_SEQUENCE_seq_tt[] = { | ||
87 | { | ||
88 | .flags = 0, | ||
89 | .tag = 0, | ||
90 | .offset = offsetof(NETSCAPE_CERT_SEQUENCE, type), | ||
91 | .field_name = "type", | ||
92 | .item = &ASN1_OBJECT_it, | ||
93 | }, | ||
94 | { | ||
95 | .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL, | ||
96 | .tag = 0, | ||
97 | .offset = offsetof(NETSCAPE_CERT_SEQUENCE, certs), | ||
98 | .field_name = "certs", | ||
99 | .item = &X509_it, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | const ASN1_ITEM NETSCAPE_CERT_SEQUENCE_it = { | ||
104 | .itype = ASN1_ITYPE_SEQUENCE, | ||
105 | .utype = V_ASN1_SEQUENCE, | ||
106 | .templates = NETSCAPE_CERT_SEQUENCE_seq_tt, | ||
107 | .tcount = sizeof(NETSCAPE_CERT_SEQUENCE_seq_tt) / sizeof(ASN1_TEMPLATE), | ||
108 | .funcs = &NETSCAPE_CERT_SEQUENCE_aux, | ||
109 | .size = sizeof(NETSCAPE_CERT_SEQUENCE), | ||
110 | .sname = "NETSCAPE_CERT_SEQUENCE", | ||
111 | }; | ||
82 | 112 | ||
83 | 113 | ||
84 | NETSCAPE_CERT_SEQUENCE * | 114 | NETSCAPE_CERT_SEQUENCE * |