Limit size of modulus for bn_mul_mont and BN_mod_exp_mont_consttime
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 8 Nov 2022 16:43:22 +0000 (17:43 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 14 Jan 2023 10:51:54 +0000 (11:51 +0100)
commit5bbd921ff5610bb5cca7475813f7f689f2a670e6
treeab5115be1de816420ccec47a16ecf4ba849cf802
parent1d0fa26428d28339b561d511076aed7276b1aa18
Limit size of modulus for bn_mul_mont and BN_mod_exp_mont_consttime

Otherwise the alloca can cause an exception.

Issue reported by Jiayi Lin.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19735)
crypto/bn/bn_exp.c
crypto/bn/bn_local.h
crypto/bn/bn_mont.c
test/exptest.c