summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa/ecs_ossl.c
diff options
context:
space:
mode:
authorjsing <>2023-03-07 09:27:10 +0000
committerjsing <>2023-03-07 09:27:10 +0000
commitc83e0ddc66b0c990eac3283a437e4e70eabd868d (patch)
treed6ca9b239f49033751a7fb0f0185d1ad060801cf /src/lib/libcrypto/ecdsa/ecs_ossl.c
parente3934d6456ddf771c623fd07240dfb4c4d7a062c (diff)
downloadopenbsd-c83e0ddc66b0c990eac3283a437e4e70eabd868d.tar.gz
openbsd-c83e0ddc66b0c990eac3283a437e4e70eabd868d.tar.bz2
openbsd-c83e0ddc66b0c990eac3283a437e4e70eabd868d.zip
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 'src/lib/libcrypto/ecdsa/ecs_ossl.c')
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_ossl.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c
index f169b06bd5..271c8435f8 100644
--- a/src/lib/libcrypto/ecdsa/ecs_ossl.c
+++ b/src/lib/libcrypto/ecdsa/ecs_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_ossl.c,v 1.28 2023/03/04 21:39:34 tb Exp $ */ 1/* $OpenBSD: ecs_ossl.c,v 1.29 2023/03/07 09:27:10 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -230,22 +230,22 @@ ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
230 ECDSAerror(ERR_R_BN_LIB); 230 ECDSAerror(ERR_R_BN_LIB);
231 goto err; 231 goto err;
232 } 232 }
233 BN_clear_free(*rp); 233 BN_free(*rp);
234 BN_clear_free(*kinvp); 234 BN_free(*kinvp);
235 *rp = r; 235 *rp = r;
236 *kinvp = k; 236 *kinvp = k;
237 ret = 1; 237 ret = 1;
238 238
239 err: 239 err:
240 if (ret == 0) { 240 if (ret == 0) {
241 BN_clear_free(k); 241 BN_free(k);
242 BN_clear_free(r); 242 BN_free(r);
243 } 243 }
244 if (ctx_in == NULL) 244 if (ctx_in == NULL)
245 BN_CTX_free(ctx); 245 BN_CTX_free(ctx);
246 BN_free(order); 246 BN_free(order);
247 EC_POINT_free(point); 247 EC_POINT_free(point);
248 BN_clear_free(X); 248 BN_free(X);
249 return (ret); 249 return (ret);
250} 250}
251 251
@@ -412,12 +412,12 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len,
412 ret = NULL; 412 ret = NULL;
413 } 413 }
414 BN_CTX_free(ctx); 414 BN_CTX_free(ctx);
415 BN_clear_free(b); 415 BN_free(b);
416 BN_clear_free(binv); 416 BN_free(binv);
417 BN_clear_free(bm); 417 BN_free(bm);
418 BN_clear_free(bxr); 418 BN_free(bxr);
419 BN_clear_free(kinv); 419 BN_free(kinv);
420 BN_clear_free(m); 420 BN_free(m);
421 BN_free(order); 421 BN_free(order);
422 BN_free(range); 422 BN_free(range);
423 return ret; 423 return ret;