diff options
| author | tb <> | 2023-06-23 10:50:47 +0000 |
|---|---|---|
| committer | tb <> | 2023-06-23 10:50:47 +0000 |
| commit | cd8a35403eca59025f86b12bff4b62dc923f2274 (patch) | |
| tree | 404eb48f17d204d2e99554b5d291d4054f54c45a /src | |
| parent | 03192bd2803d5709fc909973fdedc8b7237ab2dc (diff) | |
| download | openbsd-cd8a35403eca59025f86b12bff4b62dc923f2274.tar.gz openbsd-cd8a35403eca59025f86b12bff4b62dc923f2274.tar.bz2 openbsd-cd8a35403eca59025f86b12bff4b62dc923f2274.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: |
