diff options
Diffstat (limited to 'src/lib/libssl/ssl_srvr.c')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index f1a0c9ae03..e72593e6b1 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_srvr.c,v 1.28 2018/01/28 09:21:34 inoguchi Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.29 2018/04/11 17:47:36 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1772,36 +1772,21 @@ ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n) | |||
1772 | if ((al == -1) && !((p[0] == (s->client_version >> 8)) && | 1772 | if ((al == -1) && !((p[0] == (s->client_version >> 8)) && |
1773 | (p[1] == (s->client_version & 0xff)))) { | 1773 | (p[1] == (s->client_version & 0xff)))) { |
1774 | /* | 1774 | /* |
1775 | * The premaster secret must contain the same version | 1775 | * The premaster secret must contain the same version number |
1776 | * number as the ClientHello to detect version rollback | 1776 | * as the ClientHello to detect version rollback attacks |
1777 | * attacks (strangely, the protocol does not offer such | 1777 | * (strangely, the protocol does not offer such protection for |
1778 | * protection for DH ciphersuites). | 1778 | * DH ciphersuites). |
1779 | * However, buggy clients exist that send the negotiated | 1779 | * |
1780 | * protocol version instead if the server does not | 1780 | * The Klima-Pokorny-Rosa extension of Bleichenbacher's attack |
1781 | * support the requested protocol version. | 1781 | * (http://eprint.iacr.org/2003/052/) exploits the version |
1782 | * If SSL_OP_TLS_ROLLBACK_BUG is set, tolerate such | 1782 | * number check as a "bad version oracle" -- an alert would |
1783 | * clients. | 1783 | * reveal that the plaintext corresponding to some ciphertext |
1784 | * made up by the adversary is properly formatted except that | ||
1785 | * the version number is wrong. To avoid such attacks, we should | ||
1786 | * treat this just like any other decryption error. | ||
1784 | */ | 1787 | */ |
1785 | if (!((s->internal->options & SSL_OP_TLS_ROLLBACK_BUG) && | 1788 | al = SSL_AD_DECODE_ERROR; |
1786 | (p[0] == (s->version >> 8)) && | 1789 | /* SSLerror(s, SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */ |
1787 | (p[1] == (s->version & 0xff)))) { | ||
1788 | al = SSL_AD_DECODE_ERROR; | ||
1789 | /* SSLerror(s, SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */ | ||
1790 | |||
1791 | /* | ||
1792 | * The Klima-Pokorny-Rosa extension of | ||
1793 | * Bleichenbacher's attack | ||
1794 | * (http://eprint.iacr.org/2003/052/) exploits | ||
1795 | * the version number check as a "bad version | ||
1796 | * oracle" -- an alert would reveal that the | ||
1797 | * plaintext corresponding to some ciphertext | ||
1798 | * made up by the adversary is properly | ||
1799 | * formatted except that the version number is | ||
1800 | * wrong. | ||
1801 | * To avoid such attacks, we should treat this | ||
1802 | * just like any other decryption error. | ||
1803 | */ | ||
1804 | } | ||
1805 | } | 1790 | } |
1806 | 1791 | ||
1807 | if (al != -1) { | 1792 | if (al != -1) { |