diff options
author | tb <> | 2023-06-23 10:50:47 +0000 |
---|---|---|
committer | tb <> | 2023-06-23 10:50:47 +0000 |
commit | 23a3848bc1a71df07b287b04bc2f6ed7af1c1bbc (patch) | |
tree | 404eb48f17d204d2e99554b5d291d4054f54c45a /src | |
parent | 7dcef4f02ec5e543cc1748a3a8489a53576f18ec (diff) | |
download | openbsd-23a3848bc1a71df07b287b04bc2f6ed7af1c1bbc.tar.gz openbsd-23a3848bc1a71df07b287b04bc2f6ed7af1c1bbc.tar.bz2 openbsd-23a3848bc1a71df07b287b04bc2f6ed7af1c1bbc.zip |
Codify BN_asc2bn(NULL, *) behavior in regress.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_convert.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_convert.c b/src/regress/lib/libcrypto/bn/bn_convert.c index 147bb6839a..69f7da43b1 100644 --- a/src/regress/lib/libcrypto/bn/bn_convert.c +++ b/src/regress/lib/libcrypto/bn/bn_convert.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_convert.c,v 1.2 2023/05/27 15:50:56 jsing Exp $ */ | 1 | /* $OpenBSD: bn_convert.c,v 1.3 2023/06/23 10:50:47 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -214,6 +214,16 @@ test_bn_asc2bn(void) | |||
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
217 | /* | ||
218 | * While it makes little sense to call BN_asc2bn() with a NULL bn, | ||
219 | * check for consistent behavior. | ||
220 | */ | ||
221 | if (!BN_asc2bn(NULL, "1") || !BN_asc2bn(NULL, "-1") || | ||
222 | !BN_asc2bn(NULL, "0x1") || !BN_asc2bn(NULL, "-0x1")) { | ||
223 | fprintf(stderr, "FAIL: BN_asc2bn() with NULL BIGNUM failed\n"); | ||
224 | goto failure; | ||
225 | } | ||
226 | |||
217 | failed = 0; | 227 | failed = 0; |
218 | 228 | ||
219 | failure: | 229 | failure: |