summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/dsa/dsa_asn1.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_asn1.c b/src/lib/libcrypto/dsa/dsa_asn1.c
index f7dfaf1d9c..aac67dbd03 100644
--- a/src/lib/libcrypto/dsa/dsa_asn1.c
+++ b/src/lib/libcrypto/dsa/dsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_asn1.c,v 1.20 2017/05/02 03:59:44 deraadt Exp $ */ 1/* $OpenBSD: dsa_asn1.c,v 1.21 2018/02/20 17:48:35 tb 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 */
@@ -133,6 +133,29 @@ i2d_DSA_SIG(const DSA_SIG *a, unsigned char **out)
133 return ASN1_item_i2d((ASN1_VALUE *)a, out, &DSA_SIG_it); 133 return ASN1_item_i2d((ASN1_VALUE *)a, out, &DSA_SIG_it);
134} 134}
135 135
136void
137DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
138{
139 if (pr != NULL)
140 *pr = sig->r;
141 if (ps != NULL)
142 *ps = sig->s;
143}
144
145int
146DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)
147{
148 if (r == NULL || s == NULL)
149 return 0;
150
151 BN_clear_free(sig->r);
152 sig->r = r;
153 BN_clear_free(sig->s);
154 sig->s = s;
155
156 return 1;
157}
158
136/* Override the default free and new methods */ 159/* Override the default free and new methods */
137static int 160static int
138dsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) 161dsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)