summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ecdsa
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-06-25 19:33:40 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-06-25 19:33:40 +0000
commit5abc1c451f9d75257fb14644520decf383923c47 (patch)
tree080fbdd9c14e2147f93e108c3186ab5a3c19a948 /lib/libcrypto/ecdsa
parent51a0ea506cb6b32ebbe416305e3ea7783036047c (diff)
Move ECDSA_size() to ecs_ossl.c to match what was done in ecdh
Diffstat (limited to 'lib/libcrypto/ecdsa')
-rw-r--r--lib/libcrypto/ecdsa/ecs_lib.c34
-rw-r--r--lib/libcrypto/ecdsa/ecs_ossl.c34
2 files changed, 34 insertions, 34 deletions
diff --git a/lib/libcrypto/ecdsa/ecs_lib.c b/lib/libcrypto/ecdsa/ecs_lib.c
index 477f49a6c2a..743d5171657 100644
--- a/lib/libcrypto/ecdsa/ecs_lib.c
+++ b/lib/libcrypto/ecdsa/ecs_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecs_lib.c,v 1.21 2023/06/25 19:04:35 tb Exp $ */
+/* $OpenBSD: ecs_lib.c,v 1.22 2023/06/25 19:33:39 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
@@ -103,38 +103,6 @@ ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth)
}
int
-ECDSA_size(const EC_KEY *r)
-{
- BIGNUM *order = NULL;
- const EC_GROUP *group;
- ECDSA_SIG signature;
- int ret = 0;
-
- if (r == NULL)
- goto err;
-
- if ((group = EC_KEY_get0_group(r)) == NULL)
- goto err;
-
- if ((order = BN_new()) == NULL)
- goto err;
-
- if (!EC_GROUP_get_order(group, order, NULL))
- goto err;
-
- signature.r = order;
- signature.s = order;
-
- if ((ret = i2d_ECDSA_SIG(&signature, NULL)) < 0)
- ret = 0;
-
- err:
- BN_free(order);
-
- return ret;
-}
-
-int
ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
diff --git a/lib/libcrypto/ecdsa/ecs_ossl.c b/lib/libcrypto/ecdsa/ecs_ossl.c
index 547d3b59e10..251a938e2df 100644
--- a/lib/libcrypto/ecdsa/ecs_ossl.c
+++ b/lib/libcrypto/ecdsa/ecs_ossl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecs_ossl.c,v 1.36 2023/06/25 19:04:35 tb Exp $ */
+/* $OpenBSD: ecs_ossl.c,v 1.37 2023/06/25 19:33:39 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
@@ -580,3 +580,35 @@ ECDSA_verify(int type, const unsigned char *dgst, int dgst_len,
ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED);
return 0;
}
+
+int
+ECDSA_size(const EC_KEY *r)
+{
+ BIGNUM *order = NULL;
+ const EC_GROUP *group;
+ ECDSA_SIG signature;
+ int ret = 0;
+
+ if (r == NULL)
+ goto err;
+
+ if ((group = EC_KEY_get0_group(r)) == NULL)
+ goto err;
+
+ if ((order = BN_new()) == NULL)
+ goto err;
+
+ if (!EC_GROUP_get_order(group, order, NULL))
+ goto err;
+
+ signature.r = order;
+ signature.s = order;
+
+ if ((ret = i2d_ECDSA_SIG(&signature, NULL)) < 0)
+ ret = 0;
+
+ err:
+ BN_free(order);
+
+ return ret;
+}