summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa/ecs_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ecdsa/ecs_asn1.c')
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_asn1.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_asn1.c b/src/lib/libcrypto/ecdsa/ecs_asn1.c
index 725fe44a36..e463858669 100644
--- a/src/lib/libcrypto/ecdsa/ecs_asn1.c
+++ b/src/lib/libcrypto/ecdsa/ecs_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_asn1.c,v 1.8 2015/10/16 15:15:39 jsing Exp $ */ 1/* $OpenBSD: ecs_asn1.c,v 1.9 2018/03/17 15:24:44 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,3 +113,25 @@ ECDSA_SIG_free(ECDSA_SIG *a)
113{ 113{
114 ASN1_item_free((ASN1_VALUE *)a, &ECDSA_SIG_it); 114 ASN1_item_free((ASN1_VALUE *)a, &ECDSA_SIG_it);
115} 115}
116
117void
118ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
119{
120 if (pr != NULL)
121 *pr = sig->r;
122 if (ps != NULL)
123 *ps = sig->s;
124}
125
126int
127ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
128{
129 if (r == NULL || s == NULL)
130 return 0;
131
132 BN_clear_free(sig->r);
133 BN_clear_free(sig->s);
134 sig->r = r;
135 sig->s = s;
136 return 1;
137}