summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-07-24 15:51:50 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-07-24 15:51:50 +0000
commit3127ec3f3cf6671c582fc3bc3d7874cbc48b1d11 (patch)
tree0748fac2252dcc68750863231e9de6cad3402bda /lib
parent4093155b358e584e6144c7d23a368462741049f8 (diff)
Expand ASN.1 template macros - no change in generated assembly.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ecdsa/ecs_asn1.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/lib/libcrypto/ecdsa/ecs_asn1.c b/lib/libcrypto/ecdsa/ecs_asn1.c
index 4cd5c1bd218..34c3ce04974 100644
--- a/lib/libcrypto/ecdsa/ecs_asn1.c
+++ b/lib/libcrypto/ecdsa/ecs_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecs_asn1.c,v 1.4 2015/02/10 04:01:26 jsing Exp $ */
+/* $OpenBSD: ecs_asn1.c,v 1.5 2015/07/24 15:51:49 jsing Exp $ */
/* ====================================================================
* Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
*
@@ -57,10 +57,32 @@
#include <openssl/err.h>
#include <openssl/asn1t.h>
-ASN1_SEQUENCE(ECDSA_SIG) = {
- ASN1_SIMPLE(ECDSA_SIG, r, CBIGNUM),
- ASN1_SIMPLE(ECDSA_SIG, s, CBIGNUM)
-} ASN1_SEQUENCE_END(ECDSA_SIG)
+static const ASN1_TEMPLATE ECDSA_SIG_seq_tt[] = {
+ {
+ .flags = 0,
+ .tag = 0,
+ .offset = offsetof(ECDSA_SIG, r),
+ .field_name = "r",
+ .item = &CBIGNUM_it,
+ },
+ {
+ .flags = 0,
+ .tag = 0,
+ .offset = offsetof(ECDSA_SIG, s),
+ .field_name = "s",
+ .item = &CBIGNUM_it,
+ },
+};
+
+const ASN1_ITEM ECDSA_SIG_it = {
+ .itype = ASN1_ITYPE_SEQUENCE,
+ .utype = V_ASN1_SEQUENCE,
+ .templates = ECDSA_SIG_seq_tt,
+ .tcount = sizeof(ECDSA_SIG_seq_tt) / sizeof(ASN1_TEMPLATE),
+ .funcs = NULL,
+ .size = sizeof(ECDSA_SIG),
+ .sname = "ECDSA_SIG",
+};
DECLARE_ASN1_FUNCTIONS_const(ECDSA_SIG)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECDSA_SIG, ECDSA_SIG)