| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
| 6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
| 7 | 7 |
| 8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
| 9 | 9 |
| 10 #include <errno.h> | 10 #include <errno.h> |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 mode.ConfigureFlag(SSL_MODE_CBC_RECORD_SPLITTING, true); | 964 mode.ConfigureFlag(SSL_MODE_CBC_RECORD_SPLITTING, true); |
| 965 | 965 |
| 966 mode.ConfigureFlag(SSL_MODE_ENABLE_FALSE_START, | 966 mode.ConfigureFlag(SSL_MODE_ENABLE_FALSE_START, |
| 967 ssl_config_.false_start_enabled); | 967 ssl_config_.false_start_enabled); |
| 968 | 968 |
| 969 mode.ConfigureFlag(SSL_MODE_SEND_FALLBACK_SCSV, ssl_config_.version_fallback); | 969 mode.ConfigureFlag(SSL_MODE_SEND_FALLBACK_SCSV, ssl_config_.version_fallback); |
| 970 | 970 |
| 971 SSL_set_mode(ssl_, mode.set_mask); | 971 SSL_set_mode(ssl_, mode.set_mask); |
| 972 SSL_clear_mode(ssl_, mode.clear_mask); | 972 SSL_clear_mode(ssl_, mode.clear_mask); |
| 973 | 973 |
| 974 // See SSLConfig::disabled_cipher_suites for description of the suites | 974 // Use BoringSSL defaults, but disable HMAC-SHA256 and HMAC-SHA384 ciphers |
| 975 // disabled by default. Note that SHA256 and SHA384 only select HMAC-SHA256 | 975 // (note that SHA256 and SHA384 only select legacy CBC ciphers). Also disable |
| 976 // and HMAC-SHA384 cipher suites, not GCM cipher suites with SHA256 or SHA384 | 976 // DHE_RSA_WITH_AES_256_GCM_SHA384. Historically, AES_256_GCM was not |
| 977 // as the handshake hash. | 977 // supported. As DHE is being deprecated, don't add a cipher only to remove it |
| 978 std::string command("DEFAULT:!SHA256:-SHA384:!AESGCM+AES256:!aPSK"); | 978 // immediately. |
| 979 std::string command( |
| 980 "DEFAULT:!SHA256:!SHA384:!DHE-RSA-AES256-GCM-SHA384:!aPSK"); |
| 979 | 981 |
| 980 if (ssl_config_.require_ecdhe) | 982 if (ssl_config_.require_ecdhe) |
| 981 command.append(":!kRSA:!kDHE"); | 983 command.append(":!kRSA:!kDHE"); |
| 982 | 984 |
| 983 if (!(ssl_config_.rc4_enabled && | 985 if (!(ssl_config_.rc4_enabled && |
| 984 ssl_config_.deprecated_cipher_suites_enabled)) { | 986 ssl_config_.deprecated_cipher_suites_enabled)) { |
| 985 command.append(":!RC4"); | 987 command.append(":!RC4"); |
| 986 } | 988 } |
| 987 | 989 |
| 988 if (!ssl_config_.deprecated_cipher_suites_enabled) { | 990 if (!ssl_config_.deprecated_cipher_suites_enabled) { |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 tb_was_negotiated_ = true; | 2313 tb_was_negotiated_ = true; |
| 2312 return 1; | 2314 return 1; |
| 2313 } | 2315 } |
| 2314 } | 2316 } |
| 2315 | 2317 |
| 2316 *out_alert_value = SSL_AD_ILLEGAL_PARAMETER; | 2318 *out_alert_value = SSL_AD_ILLEGAL_PARAMETER; |
| 2317 return 0; | 2319 return 0; |
| 2318 } | 2320 } |
| 2319 | 2321 |
| 2320 } // namespace net | 2322 } // namespace net |
| OLD | NEW |