summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ecdsa
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2023-03-07 09:27:11 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2023-03-07 09:27:11 +0000
commit9008282cbda852dccb445b06f89f53e1ec153a5e (patch)
tree1c75dbac866148b5815386584b1b2d85542cd637 /lib/libcrypto/ecdsa
parent4132973bba603943ea55f412f15a9d59faf018bc (diff)
Call BN_free() instead of BN_clear_free().
BN_clear_free() is a wrapper that calls BN_free() - call BN_free() directly instead. ok tb@
Diffstat (limited to 'lib/libcrypto/ecdsa')
-rw-r--r--lib/libcrypto/ecdsa/ecs_asn1.c6
-rw-r--r--lib/libcrypto/ecdsa/ecs_lib.c4
-rw-r--r--lib/libcrypto/ecdsa/ecs_ossl.c24
3 files changed, 17 insertions, 17 deletions
diff --git a/lib/libcrypto/ecdsa/ecs_asn1.c b/lib/libcrypto/ecdsa/ecs_asn1.c
index 9e286138e80..9db114a2d18 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.12 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: ecs_asn1.c,v 1.13 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
*
@@ -141,8 +141,8 @@ ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
if (r == NULL || s == NULL)
return 0;
- BN_clear_free(sig->r);
- BN_clear_free(sig->s);
+ BN_free(sig->r);
+ BN_free(sig->s);
sig->r = r;
sig->s = s;
return 1;
diff --git a/lib/libcrypto/ecdsa/ecs_lib.c b/lib/libcrypto/ecdsa/ecs_lib.c
index 5e95c5ed605..5c44c793eda 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.15 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: ecs_lib.c,v 1.16 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
@@ -221,7 +221,7 @@ ECDSA_size(const EC_KEY *r)
ret = 0;
err:
- BN_clear_free(order);
+ BN_free(order);
return ret;
}
diff --git a/lib/libcrypto/ecdsa/ecs_ossl.c b/lib/libcrypto/ecdsa/ecs_ossl.c
index f169b06bd5d..271c8435f8a 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.28 2023/03/04 21:39:34 tb Exp $ */
+/* $OpenBSD: ecs_ossl.c,v 1.29 2023/03/07 09:27:10 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
@@ -230,22 +230,22 @@ ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
ECDSAerror(ERR_R_BN_LIB);
goto err;
}
- BN_clear_free(*rp);
- BN_clear_free(*kinvp);
+ BN_free(*rp);
+ BN_free(*kinvp);
*rp = r;
*kinvp = k;
ret = 1;
err:
if (ret == 0) {
- BN_clear_free(k);
- BN_clear_free(r);
+ BN_free(k);
+ BN_free(r);
}
if (ctx_in == NULL)
BN_CTX_free(ctx);
BN_free(order);
EC_POINT_free(point);
- BN_clear_free(X);
+ BN_free(X);
return (ret);
}
@@ -412,12 +412,12 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len,
ret = NULL;
}
BN_CTX_free(ctx);
- BN_clear_free(b);
- BN_clear_free(binv);
- BN_clear_free(bm);
- BN_clear_free(bxr);
- BN_clear_free(kinv);
- BN_clear_free(m);
+ BN_free(b);
+ BN_free(binv);
+ BN_free(bm);
+ BN_free(bxr);
+ BN_free(kinv);
+ BN_free(m);
BN_free(order);
BN_free(range);
return ret;