summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-01-15 13:58:45 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-01-15 13:58:45 +0000
commite0d03d121f1dff0dfc9bda8c1eced3e5657218c7 (patch)
tree7bd8549776c728c4542d598463606ec07ab93725
parentc69007e5df12e21d1a0eecadb7969a5dbf47e9d8 (diff)
gost: add missing BN_CTX_{start,end}() pair
The new BN_CTX code enforces that the context be started before a BIGNUM can be obtained from it via BN_CTX_get(), tests for ssl/interop and the openssl app broke, implying missing test coverage in libcrypto itself. Add the obviously missing bits. reported by anton ok jsing
-rw-r--r--lib/libcrypto/gost/gostr341001_key.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcrypto/gost/gostr341001_key.c b/lib/libcrypto/gost/gostr341001_key.c
index af3a3fcd383..e44c48622c7 100644
--- a/lib/libcrypto/gost/gostr341001_key.c
+++ b/lib/libcrypto/gost/gostr341001_key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gostr341001_key.c,v 1.10 2022/11/26 16:08:53 tb Exp $ */
+/* $OpenBSD: gostr341001_key.c,v 1.11 2023/01/15 13:58:44 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -193,6 +193,8 @@ GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y)
if (ctx == NULL)
goto err;
+ BN_CTX_start(ctx);
+
point = EC_POINT_new(key->group);
if (point == NULL)
goto err;
@@ -225,6 +227,7 @@ GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y)
err:
EC_POINT_free(point);
+ BN_CTX_end(ctx);
BN_CTX_free(ctx);
return ok;