mirror of
https://github.com/openssl/openssl.git
synced 2024-12-09 05:51:54 +08:00
7fc67e0a33
The RSA decryption as implemented before required very careful handling of both the exit code returned by OpenSSL and the potentially returned ciphertext. Looking at the recent security vulnerabilities (CVE-2020-25659 and CVE-2020-25657) it is unlikely that most users of OpenSSL do it correctly. Given that correct code requires side channel secure programming in application code, we can classify the existing RSA decryption methods as CWE-676, which in turn likely causes CWE-208 and CWE-385 in application code. To prevent that, we can use a technique called "implicit rejection". For that we generate a random message to be returned in case the padding check fails. We generate the message based on static secret data (the private exponent) and the provided ciphertext (so that the attacker cannot determine that the returned value is randomly generated instead of result of decryption and de-padding). We return it in case any part of padding check fails. The upshot of this approach is that then not only is the length of the returned message useless as the Bleichenbacher oracle, so are the actual bytes of the returned message. So application code doesn't have to perform any operations on the returned message in side-channel free way to remain secure against Bleichenbacher attacks. Note: this patch implements a specific algorithm, shared with Mozilla NSS, so that the attacker cannot use one library as an oracle against the other in heterogeneous environments. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13817) |
||
---|---|---|
.. | ||
build.info | ||
CA.pl.pod | ||
openssl-asn1parse.pod.in | ||
openssl-ca.pod.in | ||
openssl-ciphers.pod.in | ||
openssl-cmds.pod.in | ||
openssl-cmp.pod.in | ||
openssl-cms.pod.in | ||
openssl-crl2pkcs7.pod.in | ||
openssl-crl.pod.in | ||
openssl-dgst.pod.in | ||
openssl-dhparam.pod.in | ||
openssl-dsa.pod.in | ||
openssl-dsaparam.pod.in | ||
openssl-ec.pod.in | ||
openssl-ecparam.pod.in | ||
openssl-enc.pod.in | ||
openssl-engine.pod.in | ||
openssl-errstr.pod.in | ||
openssl-fipsinstall.pod.in | ||
openssl-format-options.pod | ||
openssl-gendsa.pod.in | ||
openssl-genpkey.pod.in | ||
openssl-genrsa.pod.in | ||
openssl-info.pod.in | ||
openssl-kdf.pod.in | ||
openssl-list.pod.in | ||
openssl-mac.pod.in | ||
openssl-namedisplay-options.pod | ||
openssl-nseq.pod.in | ||
openssl-ocsp.pod.in | ||
openssl-passphrase-options.pod | ||
openssl-passwd.pod.in | ||
openssl-pkcs7.pod.in | ||
openssl-pkcs8.pod.in | ||
openssl-pkcs12.pod.in | ||
openssl-pkey.pod.in | ||
openssl-pkeyparam.pod.in | ||
openssl-pkeyutl.pod.in | ||
openssl-prime.pod.in | ||
openssl-rand.pod.in | ||
openssl-rehash.pod.in | ||
openssl-req.pod.in | ||
openssl-rsa.pod.in | ||
openssl-rsautl.pod.in | ||
openssl-s_client.pod.in | ||
openssl-s_server.pod.in | ||
openssl-s_time.pod.in | ||
openssl-sess_id.pod.in | ||
openssl-smime.pod.in | ||
openssl-speed.pod.in | ||
openssl-spkac.pod.in | ||
openssl-srp.pod.in | ||
openssl-storeutl.pod.in | ||
openssl-ts.pod.in | ||
openssl-verification-options.pod | ||
openssl-verify.pod.in | ||
openssl-version.pod.in | ||
openssl-x509.pod.in | ||
openssl.pod | ||
tsget.pod |