From a4446bfb10ec0a821da3861d90dc625a93d84cff Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 11 Feb 2015 03:39:51 +0000 Subject: 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@ --- src/lib/libcrypto/asn1/x_val.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/asn1/x_val.c') diff --git a/src/lib/libcrypto/asn1/x_val.c b/src/lib/libcrypto/asn1/x_val.c index 27835e94da..3f1d830d3e 100644 --- a/src/lib/libcrypto/asn1/x_val.c +++ b/src/lib/libcrypto/asn1/x_val.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_val.c,v 1.9 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_val.c,v 1.10 2015/02/11 03:39:51 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -61,10 +61,32 @@ #include #include -ASN1_SEQUENCE(X509_VAL) = { - ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME), - ASN1_SIMPLE(X509_VAL, notAfter, ASN1_TIME) -} ASN1_SEQUENCE_END(X509_VAL) +static const ASN1_TEMPLATE X509_VAL_seq_tt[] = { + { + .flags = 0, + .tag = 0, + .offset = offsetof(X509_VAL, notBefore), + .field_name = "notBefore", + .item = &ASN1_TIME_it, + }, + { + .flags = 0, + .tag = 0, + .offset = offsetof(X509_VAL, notAfter), + .field_name = "notAfter", + .item = &ASN1_TIME_it, + }, +}; + +const ASN1_ITEM X509_VAL_it = { + .itype = ASN1_ITYPE_SEQUENCE, + .utype = V_ASN1_SEQUENCE, + .templates = X509_VAL_seq_tt, + .tcount = sizeof(X509_VAL_seq_tt) / sizeof(ASN1_TEMPLATE), + .funcs = NULL, + .size = sizeof(X509_VAL), + .sname = "X509_VAL", +}; X509_VAL * -- cgit v1.2.3-55-g6feb