017f695f2c
The problem occurs in EVP_PKEY_sign() when using RSA with X931 padding.
It is only triggered if the RSA key size is smaller than the digest length.
So with SHA512 you can trigger the overflow with anything less than an RSA
512 bit key. I managed to trigger a 62 byte overflow when using a 16 bit RSA
key. This wasn't sufficient to cause a crash, although your mileage may
vary.
In practice RSA keys of this length are never used and X931 padding is very
rare. Even if someone did use an excessively short RSA key, the chances of
them combining that with a longer digest and X931 padding is very
small. For these reasons I do not believe there is a security implication to
this. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3
Solutions) for reporting this issue.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit
|
||
---|---|---|
.. | ||
.cvsignore | ||
Makefile | ||
rsa.h | ||
rsa_ameth.c | ||
rsa_asn1.c | ||
rsa_chk.c | ||
rsa_crpt.c | ||
rsa_depr.c | ||
rsa_eay.c | ||
rsa_err.c | ||
rsa_gen.c | ||
rsa_lib.c | ||
rsa_locl.h | ||
rsa_none.c | ||
rsa_null.c | ||
rsa_oaep.c | ||
rsa_pk1.c | ||
rsa_pmeth.c | ||
rsa_prn.c | ||
rsa_pss.c | ||
rsa_saos.c | ||
rsa_sign.c | ||
rsa_ssl.c | ||
rsa_test.c | ||
rsa_x931.c |