diff options
| author | bcook <> | 2016-03-13 18:22:43 +0000 |
|---|---|---|
| committer | bcook <> | 2016-03-13 18:22:43 +0000 |
| commit | 4f318dbd3fc00556c0c150ffedea1853d3b4c9b4 (patch) | |
| tree | 99bf4db31252e8c69350c59b387c22666dd9ce01 | |
| parent | 4370e6e15c5a4bc87266e9d098990dc0c7c2932d (diff) | |
| download | openbsd-4f318dbd3fc00556c0c150ffedea1853d3b4c9b4.tar.gz openbsd-4f318dbd3fc00556c0c150ffedea1853d3b4c9b4.tar.bz2 openbsd-4f318dbd3fc00556c0c150ffedea1853d3b4c9b4.zip | |
check return value for BN_hex2bn in regression tests
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libcrypto/bn/general/bntest.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/bn/general/bntest.c b/src/regress/lib/libcrypto/bn/general/bntest.c index 892206f462..c6bd788b54 100644 --- a/src/regress/lib/libcrypto/bn/general/bntest.c +++ b/src/regress/lib/libcrypto/bn/general/bntest.c | |||
| @@ -721,8 +721,11 @@ test_sqr(BIO *bp, BN_CTX *ctx) | |||
| 721 | } | 721 | } |
| 722 | 722 | ||
| 723 | /* Regression test for a BN_sqr overflow bug. */ | 723 | /* Regression test for a BN_sqr overflow bug. */ |
| 724 | BN_hex2bn(&a, "80000000000000008000000000000001" | 724 | if (!BN_hex2bn(&a, "80000000000000008000000000000001" |
| 725 | "FFFFFFFFFFFFFFFE0000000000000000"); | 725 | "FFFFFFFFFFFFFFFE0000000000000000")) { |
| 726 | fprintf(stderr, "BN_hex2bn failed\n"); | ||
| 727 | goto err; | ||
| 728 | } | ||
| 726 | BN_sqr(c, a, ctx); | 729 | BN_sqr(c, a, ctx); |
| 727 | if (bp != NULL) { | 730 | if (bp != NULL) { |
| 728 | if (!results) { | 731 | if (!results) { |
| @@ -743,8 +746,11 @@ test_sqr(BIO *bp, BN_CTX *ctx) | |||
| 743 | } | 746 | } |
| 744 | 747 | ||
| 745 | /* Regression test for a BN_sqr overflow bug. */ | 748 | /* Regression test for a BN_sqr overflow bug. */ |
| 746 | BN_hex2bn(&a, "80000000000000000000000080000001" | 749 | if (!BN_hex2bn(&a, "80000000000000000000000080000001" |
| 747 | "FFFFFFFE000000000000000000000000"); | 750 | "FFFFFFFE000000000000000000000000")) { |
| 751 | fprintf(stderr, "BN_hex2bn failed\n"); | ||
| 752 | goto err; | ||
| 753 | } | ||
| 748 | BN_sqr(c, a, ctx); | 754 | BN_sqr(c, a, ctx); |
| 749 | if (bp != NULL) { | 755 | if (bp != NULL) { |
| 750 | if (!results) { | 756 | if (!results) { |
