diff options
| author | tb <> | 2023-01-15 13:58:44 +0000 |
|---|---|---|
| committer | tb <> | 2023-01-15 13:58:44 +0000 |
| commit | 49d88d95baa39b0a851c635858749b0c08bd8d52 (patch) | |
| tree | 2c99126e5e5391e363e1a1748cd072046f3ff4c6 /src | |
| parent | eb72d17d580445c364a2dfb2d637026a00e779eb (diff) | |
| download | openbsd-49d88d95baa39b0a851c635858749b0c08bd8d52.tar.gz openbsd-49d88d95baa39b0a851c635858749b0c08bd8d52.tar.bz2 openbsd-49d88d95baa39b0a851c635858749b0c08bd8d52.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/gost/gostr341001_key.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ | |||
| 1 | /* $OpenBSD: gostr341001_key.c,v 1.10 2022/11/26 16:08:53 tb Exp $ */ | 1 | /* $OpenBSD: gostr341001_key.c,v 1.11 2023/01/15 13:58:44 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
| 4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
| @@ -193,6 +193,8 @@ GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y) | |||
| 193 | if (ctx == NULL) | 193 | if (ctx == NULL) |
| 194 | goto err; | 194 | goto err; |
| 195 | 195 | ||
| 196 | BN_CTX_start(ctx); | ||
| 197 | |||
| 196 | point = EC_POINT_new(key->group); | 198 | point = EC_POINT_new(key->group); |
| 197 | if (point == NULL) | 199 | if (point == NULL) |
| 198 | goto err; | 200 | goto err; |
| @@ -225,6 +227,7 @@ GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y) | |||
| 225 | 227 | ||
| 226 | err: | 228 | err: |
| 227 | EC_POINT_free(point); | 229 | EC_POINT_free(point); |
| 230 | BN_CTX_end(ctx); | ||
| 228 | BN_CTX_free(ctx); | 231 | BN_CTX_free(ctx); |
| 229 | return ok; | 232 | return ok; |
| 230 | 233 | ||
