]> granicus.if.org Git - openssl/commit
Fix BN error reporting
authorMatt Caswell <matt@openssl.org>
Tue, 6 Aug 2019 12:39:00 +0000 (13:39 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 7 Aug 2019 10:46:59 +0000 (11:46 +0100)
commitc50fd0f959de5b256d8eefb8ad2a82fcdcb899c3
tree54911bc22f372987dee8953c8745e791d68a2060
parentf305ecdac0b7048e7ef38a7196f4393fa7ceff38
Fix BN error reporting

Commit ed57f7f935 implemented the macro ERR_raise and updated err.h to use
it. A typo in err.h means that errors in the BN library are mistakenly
attributed to the RSA library.

This was found due to the following error appearing in a travis log:

00:07:CB:13:05:7F:00:00:error:0400006C:rsa routines::data greater than mod
len:crypto/bn/bn_gcd.c:613:
00:07:CB:13:05:7F:00:00:error:04000003:rsa routines::BN
lib:crypto/rsa/rsa_gen.c:393:
/home/travis/build/openssl/openssl/util/shlib_wrap.sh
/home/travis/build/openssl/openssl/apps/openssl genrsa -out rsamptest.pem
-primes 5 8192 => 1
not ok 12 - genrsa 8192p5

The line in question (crypto/bn/bn_gcd.c:613) actually looks like this:

        BNerr(BN_F_BN_MOD_INVERSE_NO_BRANCH, BN_R_NO_INVERSE);

The test was checking for that error being raised, but was instead seeing
a different error and thus failing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/9539)
include/openssl/err.h