1 --- ssl/s3_srvr.c 29 Nov 2002 11:31:51 -0000 1.85.2.14
2 +++ ssl/s3_srvr.c 19 Mar 2003 18:00:00 -0000
4 if (i != SSL_MAX_MASTER_KEY_LENGTH)
6 al=SSL_AD_DECODE_ERROR;
7 - SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT);
8 + /* SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT); */
11 if ((al == -1) && !((p[0] == (s->client_version>>8)) && (p[1] == (s->client_version & 0xff))))
12 @@ -1463,30 +1463,29 @@
13 (p[0] == (s->version>>8)) && (p[1] == (s->version & 0xff))))
15 al=SSL_AD_DECODE_ERROR;
16 - SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER);
18 + /* SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */
20 + /* The Klima-Pokorny-Rosa extension of Bleichenbacher's attack
21 + * (http://eprint.iacr.org/2003/052/) exploits the version
22 + * number check as a "bad version oracle" -- an alert would
23 + * reveal that the plaintext corresponding to some ciphertext
24 + * made up by the adversary is properly formatted except
25 + * that the version number is wrong. To avoid such attacks,
26 + * we should treat this just like any other decryption error. */
27 + p[0] = (char)(int) "CAN-2003-0131 patch 2003-03-19";
36 /* Some decryption failure -- use random value instead as countermeasure
37 * against Bleichenbacher's attack on PKCS #1 v1.5 RSA padding
38 - * (see RFC 2246, section 7.4.7.1).
39 - * But note that due to length and protocol version checking, the
40 - * attack is impractical anyway (see section 5 in D. Bleichenbacher:
41 - * "Chosen Ciphertext Attacks Against Protocols Based on the RSA
42 - * Encryption Standard PKCS #1", CRYPTO '98, LNCS 1462, pp. 1-12).
44 + * (see RFC 2246, section 7.4.7.1). */
46 i = SSL_MAX_MASTER_KEY_LENGTH;
47 p[0] = s->client_version >> 8;
48 p[1] = s->client_version & 0xff;
49 RAND_pseudo_bytes(p+2, i-2); /* should be RAND_bytes, but we cannot work around a failure */
53 s->session->master_key_length=