summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/x_pubkey.c
diff options
context:
space:
mode:
authorjsing <>2015-02-11 03:39:51 +0000
committerjsing <>2015-02-11 03:39:51 +0000
commita4446bfb10ec0a821da3861d90dc625a93d84cff (patch)
treed942bf9cb3a1b441f2c996072292ae69b1aa83d2 /src/lib/libcrypto/asn1/x_pubkey.c
parentdea579e3ced20a997dc9c2b82eb0c086555a68b8 (diff)
downloadopenbsd-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/x_pubkey.c')
-rw-r--r--src/lib/libcrypto/asn1/x_pubkey.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c
index 0c7d01e60d..55084182cc 100644
--- a/src/lib/libcrypto/asn1/x_pubkey.c
+++ b/src/lib/libcrypto/asn1/x_pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pubkey.c,v 1.23 2015/02/09 15:05:59 jsing Exp $ */ 1/* $OpenBSD: x_pubkey.c,v 1.24 2015/02/11 03:39:51 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -84,10 +84,40 @@ pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
84 return 1; 84 return 1;
85} 85}
86 86
87ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb) = { 87static const ASN1_AUX X509_PUBKEY_aux = {
88 ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR), 88 .app_data = NULL,
89 ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING) 89 .flags = 0,
90} ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) 90 .ref_offset = 0,
91 .ref_lock = 0,
92 .asn1_cb = pubkey_cb,
93 .enc_offset = 0,
94};
95static const ASN1_TEMPLATE X509_PUBKEY_seq_tt[] = {
96 {
97 .flags = 0,
98 .tag = 0,
99 .offset = offsetof(X509_PUBKEY, algor),
100 .field_name = "algor",
101 .item = &X509_ALGOR_it,
102 },
103 {
104 .flags = 0,
105 .tag = 0,
106 .offset = offsetof(X509_PUBKEY, public_key),
107 .field_name = "public_key",
108 .item = &ASN1_BIT_STRING_it,
109 },
110};
111
112const ASN1_ITEM X509_PUBKEY_it = {
113 .itype = ASN1_ITYPE_SEQUENCE,
114 .utype = V_ASN1_SEQUENCE,
115 .templates = X509_PUBKEY_seq_tt,
116 .tcount = sizeof(X509_PUBKEY_seq_tt) / sizeof(ASN1_TEMPLATE),
117 .funcs = &X509_PUBKEY_aux,
118 .size = sizeof(X509_PUBKEY),
119 .sname = "X509_PUBKEY",
120};
91 121
92 122
93X509_PUBKEY * 123X509_PUBKEY *