summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-01-05 20:39:05 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-01-05 20:39:05 +0000
commit318deea74dd9cbeb810605b420a784848ce5eee8 (patch)
treef70a89fc3413586433700456367574a145ec9430 /lib/libcrypto
parent73545937c91d640f188995daf388493333ea48e7 (diff)
Prepare to provide ECDSA_SIG_get0_{r,s}()
ok inoguchi jsing
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/ecdsa/ecdsa.h7
-rw-r--r--lib/libcrypto/ecdsa/ecs_asn1.c14
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/libcrypto/ecdsa/ecdsa.h b/lib/libcrypto/ecdsa/ecdsa.h
index c4e107eee58..7b0a25468a6 100644
--- a/lib/libcrypto/ecdsa/ecdsa.h
+++ b/lib/libcrypto/ecdsa/ecdsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecdsa.h,v 1.8 2019/01/19 01:17:41 tb Exp $ */
+/* $OpenBSD: ecdsa.h,v 1.9 2022/01/05 20:39:04 tb Exp $ */
/**
* \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions
* \author Written by Nils Larsch for the OpenSSL project
@@ -140,6 +140,11 @@ ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
*/
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
+#if defined(LIBRESSL_OPAQUE_ECDSA) || defined(LIBRESSL_CRYPTO_INTERNAL)
+const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
+const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
+#endif
+
/** Setter for r and s fields of ECDSA_SIG
* \param sig pointer to ECDSA_SIG pointer
* \param r pointer to BIGNUM for r (may be NULL)
diff --git a/lib/libcrypto/ecdsa/ecs_asn1.c b/lib/libcrypto/ecdsa/ecs_asn1.c
index e463858669c..9a7a04468bf 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.9 2018/03/17 15:24:44 tb Exp $ */
+/* $OpenBSD: ecs_asn1.c,v 1.10 2022/01/05 20:39:04 tb Exp $ */
/* ====================================================================
* Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
*
@@ -123,6 +123,18 @@ ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
*ps = sig->s;
}
+const BIGNUM *
+ECDSA_SIG_get0_r(const ECDSA_SIG *sig)
+{
+ return sig->r;
+}
+
+const BIGNUM *
+ECDSA_SIG_get0_s(const ECDSA_SIG *sig)
+{
+ return sig->s;
+}
+
int
ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
{