Reduce inputs before the RSAZ code.
authorDavid Benjamin <davidben@google.com>
Tue, 11 Sep 2018 20:49:28 +0000 (13:49 -0700)
committerPauli <paul.dale@oracle.com>
Wed, 16 Jan 2019 22:17:59 +0000 (08:17 +1000)
commit3afd537a3c2319f68280804004e9bf2e798a43f7
treef97399d578d4531f6168b76fd49c28b538e73f49
parent9b10986d7742a5105ac8c5f4eba8b103caf57ae9
Reduce inputs before the RSAZ code.

The RSAZ code requires the input be fully-reduced. To be consistent with the
other codepaths, move the BN_nnmod logic before the RSAZ check.

This fixes an oft-reported fuzzer bug.
https://github.com/google/oss-fuzz/issues/1761

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7187)
crypto/bn/bn_exp.c
test/bntest.c