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:19:24 +0000 (08:19 +1000)
commit781378dacaac8357e8df5b3ab5e811962dd72bc2
tree65246fb7d8902857db7491d1e1ca16a53ad3777e
parent04c71d860491fab3ce54a7ead79f68cf35ae76d4
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)

(cherry picked from commit 3afd537a3c2319f68280804004e9bf2e798a43f7)
crypto/bn/bn_exp.c
test/bntest.c