Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/crypto/dist/openssl/ssl Pull up revision 1.4 (requested...



details:   https://anonhg.NetBSD.org/src/rev/58e484e3d6b3
branches:  netbsd-1-6
changeset: 530182:58e484e3d6b3
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Mar 20 09:48:11 2003 +0000

description:
Pull up revision 1.4 (requested by itojun in ticket #1222):
OpenSSL Security Advisory [19 March 2003]
Klima-Pokorny-Rosa attack on RSA in SSL/TLS

diffstat:

 crypto/dist/openssl/ssl/s3_srvr.c |  25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diffs (54 lines):

diff -r fff29b9fe05f -r 58e484e3d6b3 crypto/dist/openssl/ssl/s3_srvr.c
--- a/crypto/dist/openssl/ssl/s3_srvr.c Thu Mar 20 09:47:01 2003 +0000
+++ b/crypto/dist/openssl/ssl/s3_srvr.c Thu Mar 20 09:48:11 2003 +0000
@@ -1418,7 +1418,7 @@
                if (i != SSL_MAX_MASTER_KEY_LENGTH)
                        {
                        al=SSL_AD_DECODE_ERROR;
-                       SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT);
+                       /* SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT); */
                        }
 
                if ((al == -1) && !((p[0] == (s->client_version>>8)) && (p[1] == (s->client_version & 0xff))))
@@ -1434,30 +1434,29 @@
                                (p[0] == (s->version>>8)) && (p[1] == (s->version & 0xff))))
                                {
                                al=SSL_AD_DECODE_ERROR;
-                               SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER);
-                               goto f_err;
+                               /* SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */
+
+                               /* The Klima-Pokorny-Rosa extension of Bleichenbacher's attack
+                                * (http://eprint.iacr.org/2003/052/) exploits the version
+                                * number check as a "bad version oracle" -- an alert would
+                                * reveal that the plaintext corresponding to some ciphertext
+                                * made up by the adversary is properly formatted except
+                                * that the version number is wrong.  To avoid such attacks,
+                                * we should treat this just like any other decryption error. */
+                               p[0] = (char)(int) "CAN-2003-0131 patch 2003-03-19";
                                }
                        }
 
                if (al != -1)
                        {
-#if 0
-                       goto f_err;
-#else
                        /* Some decryption failure -- use random value instead as countermeasure
                         * against Bleichenbacher's attack on PKCS #1 v1.5 RSA padding
-                        * (see RFC 2246, section 7.4.7.1).
-                        * But note that due to length and protocol version checking, the
-                        * attack is impractical anyway (see section 5 in D. Bleichenbacher:
-                        * "Chosen Ciphertext Attacks Against Protocols Based on the RSA
-                        * Encryption Standard PKCS #1", CRYPTO '98, LNCS 1462, pp. 1-12).
-                        */
+                        * (see RFC 2246, section 7.4.7.1). */
                        ERR_clear_error();
                        i = SSL_MAX_MASTER_KEY_LENGTH;
                        p[0] = s->client_version >> 8;
                        p[1] = s->client_version & 0xff;
                        RAND_pseudo_bytes(p+2, i-2); /* should be RAND_bytes, but we cannot work around a failure */
-#endif
                        }
        
                s->session->master_key_length=



Home | Main Index | Thread Index | Old Index