Fix an overflow bug in rsaz_512_sqr
authorAndy Polyakov <appro@openssl.org>
Wed, 4 Dec 2019 11:48:21 +0000 (12:48 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 6 Dec 2019 12:36:16 +0000 (13:36 +0100)
commit419102400a2811582a7a3d4a4e317d72e5ce0a8f
treed4dfa1120e45a03a2ce5c74ce586480ca87ed827
parent7a4d39f0d176f0d17f2de15672e1869b22f3e1d8
Fix an overflow bug in rsaz_512_sqr

There is an overflow bug in the x64_64 Montgomery squaring procedure used in
exponentiation with 512-bit moduli. No EC algorithms are affected. Analysis
suggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a
result of this defect would be very difficult to perform and are not believed
likely. Attacks against DH512 are considered just feasible. However, for an
attack the target would have to re-use the DH512 private key, which is not
recommended anyway. Also applications directly using the low level API
BN_mod_exp may be affected if they use BN_FLG_CONSTTIME.

CVE-2019-1551

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/10575)
crypto/bn/asm/rsaz-x86_64.pl