summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/dh/dh_asn1.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/src/lib/libcrypto/dh/dh_asn1.c b/src/lib/libcrypto/dh/dh_asn1.c
index 9d76974659..7060130ed8 100644
--- a/src/lib/libcrypto/dh/dh_asn1.c
+++ b/src/lib/libcrypto/dh/dh_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_asn1.c,v 1.7 2015/02/10 05:12:23 jsing Exp $ */ 1/* $OpenBSD: dh_asn1.c,v 1.8 2015/02/14 15:06:55 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 2000. 3 * project 2000.
4 */ 4 */
@@ -80,11 +80,47 @@ dh_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
80 return 1; 80 return 1;
81} 81}
82 82
83ASN1_SEQUENCE_cb(DHparams, dh_cb) = { 83static const ASN1_AUX DHparams_aux = {
84 ASN1_SIMPLE(DH, p, BIGNUM), 84 .app_data = NULL,
85 ASN1_SIMPLE(DH, g, BIGNUM), 85 .flags = 0,
86 ASN1_OPT(DH, length, ZLONG), 86 .ref_offset = 0,
87} ASN1_SEQUENCE_END_cb(DH, DHparams) 87 .ref_lock = 0,
88 .asn1_cb = dh_cb,
89 .enc_offset = 0,
90};
91static const ASN1_TEMPLATE DHparams_seq_tt[] = {
92 {
93 .flags = 0,
94 .tag = 0,
95 .offset = offsetof(DH, p),
96 .field_name = "p",
97 .item = &BIGNUM_it,
98 },
99 {
100 .flags = 0,
101 .tag = 0,
102 .offset = offsetof(DH, g),
103 .field_name = "g",
104 .item = &BIGNUM_it,
105 },
106 {
107 .flags = ASN1_TFLG_OPTIONAL,
108 .tag = 0,
109 .offset = offsetof(DH, length),
110 .field_name = "length",
111 .item = &ZLONG_it,
112 },
113};
114
115const ASN1_ITEM DHparams_it = {
116 .itype = ASN1_ITYPE_SEQUENCE,
117 .utype = V_ASN1_SEQUENCE,
118 .templates = DHparams_seq_tt,
119 .tcount = sizeof(DHparams_seq_tt) / sizeof(ASN1_TEMPLATE),
120 .funcs = &DHparams_aux,
121 .size = sizeof(DH),
122 .sname = "DH",
123};
88 124
89 125
90DH * 126DH *