openssl/crypto/rsa
Matt Caswell f296e411ef 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:21:53 +01:00
..
.cvsignore
Makefile RT3066: rewrite RSA padding checks to be slightly more constant time. 2014-09-24 12:47:19 +02:00
rsa.h Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_ameth.c Reject invalid PSS parameters. 2015-03-19 12:58:35 +00:00
rsa_asn1.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_chk.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_crpt.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_depr.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_eay.c Rerun util/openssl-format-source -v -c . 2015-01-22 09:31:48 +00:00
rsa_err.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_gen.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_lib.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_locl.h Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_none.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_null.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_oaep.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_pk1.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_pmeth.c Fix buffer overrun in RSA signing 2015-04-30 23:21:53 +01:00
rsa_prn.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_pss.c Re-align some comments after running the reformat script. 2015-01-22 09:31:48 +00:00
rsa_saos.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_sign.c Remove obsolete support for old code. 2015-01-26 11:06:28 -05:00
rsa_ssl.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_test.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
rsa_x931.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00