openssl/crypto/rsa
Matt Caswell 017f695f2c Fix buffer overrun in RSA signing
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 34166d4189)
2015-04-30 23:27:07 +01:00
..
.cvsignore Add emacs cache files to .cvsignore. 2005-04-11 14:17:07 +00:00
Makefile RT3066: rewrite RSA padding checks to be slightly more constant time. 2014-09-24 14:17:41 +02:00
rsa.h Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_ameth.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_asn1.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_chk.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_crpt.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_depr.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_eay.c Rerun util/openssl-format-source -v -c . 2015-01-22 09:38:49 +00:00
rsa_err.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_gen.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_lib.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_locl.h Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_none.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_null.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_oaep.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_pk1.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_pmeth.c Fix buffer overrun in RSA signing 2015-04-30 23:27:07 +01:00
rsa_prn.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_pss.c Re-align some comments after running the reformat script. 2015-01-22 09:39:01 +00:00
rsa_saos.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_sign.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_ssl.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_test.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
rsa_x931.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00