From 2994748fbb9da0ea1469bb730a4125d8341972a9 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 15 Jan 2023 13:58:44 +0000 Subject: 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 --- src/lib/libcrypto/gost/gostr341001_key.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/gost/gostr341001_key.c b/src/lib/libcrypto/gost/gostr341001_key.c index af3a3fcd38..e44c48622c 100644 --- a/src/lib/libcrypto/gost/gostr341001_key.c +++ b/src/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 * 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; -- cgit v1.2.3-55-g6feb