diff options
author | bcook <> | 2016-03-13 18:22:43 +0000 |
---|---|---|
committer | bcook <> | 2016-03-13 18:22:43 +0000 |
commit | 2bae55188c77df70108a2fe686cff583e08b7ffb (patch) | |
tree | 99bf4db31252e8c69350c59b387c22666dd9ce01 | |
parent | ab3ae8f97f04e92c32ecd62b8d9baf270a635ab7 (diff) | |
download | openbsd-2bae55188c77df70108a2fe686cff583e08b7ffb.tar.gz openbsd-2bae55188c77df70108a2fe686cff583e08b7ffb.tar.bz2 openbsd-2bae55188c77df70108a2fe686cff583e08b7ffb.zip |
check return value for BN_hex2bn in regression tests
-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) { |