diff options
author | 2015-02-11 03:39:51 +0000 | |
---|---|---|
committer | 2015-02-11 03:39:51 +0000 | |
commit | 2c25b402b35e325022895b13092c12d45e68d61a (patch) | |
tree | 73c706670f70f821d769d781e61cdd7afa3ee728 /lib/libcrypto/asn1/x_algor.c | |
parent | Backout non-wanted changed introduced by accident as part of 1.24. (diff) | |
download | wireguard-openbsd-2c25b402b35e325022895b13092c12d45e68d61a.tar.xz wireguard-openbsd-2c25b402b35e325022895b13092c12d45e68d61a.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 'lib/libcrypto/asn1/x_algor.c')
-rw-r--r-- | lib/libcrypto/asn1/x_algor.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index f7cae9499ab..c10e114318f 100644 --- a/lib/libcrypto/asn1/x_algor.c +++ b/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.18 2015/02/10 08:33:10 jsing Exp $ */ +/* $OpenBSD: x_algor.c,v 1.19 2015/02/11 03:39:51 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -61,10 +61,32 @@ #include <openssl/asn1.h> #include <openssl/asn1t.h> -ASN1_SEQUENCE(X509_ALGOR) = { - ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT), - ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY) -} ASN1_SEQUENCE_END(X509_ALGOR) +static const ASN1_TEMPLATE X509_ALGOR_seq_tt[] = { + { + .flags = 0, + .tag = 0, + .offset = offsetof(X509_ALGOR, algorithm), + .field_name = "algorithm", + .item = &ASN1_OBJECT_it, + }, + { + .flags = ASN1_TFLG_OPTIONAL, + .tag = 0, + .offset = offsetof(X509_ALGOR, parameter), + .field_name = "parameter", + .item = &ASN1_ANY_it, + }, +}; + +const ASN1_ITEM X509_ALGOR_it = { + .itype = ASN1_ITYPE_SEQUENCE, + .utype = V_ASN1_SEQUENCE, + .templates = X509_ALGOR_seq_tt, + .tcount = sizeof(X509_ALGOR_seq_tt) / sizeof(ASN1_TEMPLATE), + .funcs = NULL, + .size = sizeof(X509_ALGOR), + .sname = "X509_ALGOR", +}; ASN1_ITEM_TEMPLATE(X509_ALGORS) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, algorithms, X509_ALGOR) |