Chromium Code Reviews| 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 <openssl/err.h> | 10 #include <openssl/err.h> |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 848 SslSetClearMask mode; | 848 SslSetClearMask mode; |
| 849 | 849 |
| 850 #if defined(SSL_MODE_RELEASE_BUFFERS) | 850 #if defined(SSL_MODE_RELEASE_BUFFERS) |
| 851 mode.ConfigureFlag(SSL_MODE_RELEASE_BUFFERS, true); | 851 mode.ConfigureFlag(SSL_MODE_RELEASE_BUFFERS, true); |
| 852 #endif | 852 #endif |
| 853 | 853 |
| 854 #if defined(SSL_MODE_SMALL_BUFFERS) | 854 #if defined(SSL_MODE_SMALL_BUFFERS) |
| 855 mode.ConfigureFlag(SSL_MODE_SMALL_BUFFERS, true); | 855 mode.ConfigureFlag(SSL_MODE_SMALL_BUFFERS, true); |
| 856 #endif | 856 #endif |
| 857 | 857 |
| 858 #if defined(SSL_MODE_HANDSHAKE_CUTTHROUGH) | |
|
davidben
2014/04/11 18:20:17
How much do we need these ifdefs anyway? Is this b
| |
| 859 mode.ConfigureFlag(SSL_MODE_HANDSHAKE_CUTTHROUGH, | |
| 860 ssl_config_.false_start_enabled); | |
| 861 #endif | |
| 862 | |
| 858 SSL_set_mode(ssl_, mode.set_mask); | 863 SSL_set_mode(ssl_, mode.set_mask); |
| 859 SSL_clear_mode(ssl_, mode.clear_mask); | 864 SSL_clear_mode(ssl_, mode.clear_mask); |
| 860 | 865 |
| 861 // Removing ciphers by ID from OpenSSL is a bit involved as we must use the | 866 // Removing ciphers by ID from OpenSSL is a bit involved as we must use the |
| 862 // textual name with SSL_set_cipher_list because there is no public API to | 867 // textual name with SSL_set_cipher_list because there is no public API to |
| 863 // directly remove a cipher by ID. | 868 // directly remove a cipher by ID. |
| 864 STACK_OF(SSL_CIPHER)* ciphers = SSL_get_ciphers(ssl_); | 869 STACK_OF(SSL_CIPHER)* ciphers = SSL_get_ciphers(ssl_); |
| 865 DCHECK(ciphers); | 870 DCHECK(ciphers); |
| 866 // See SSLConfig::disabled_cipher_suites for description of the suites | 871 // See SSLConfig::disabled_cipher_suites for description of the suites |
| 867 // disabled by default. Note that !SHA256 and !SHA384 only remove HMAC-SHA256 | 872 // disabled by default. Note that !SHA256 and !SHA384 only remove HMAC-SHA256 |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1578 #endif | 1583 #endif |
| 1579 return SSL_TLSEXT_ERR_OK; | 1584 return SSL_TLSEXT_ERR_OK; |
| 1580 } | 1585 } |
| 1581 | 1586 |
| 1582 scoped_refptr<X509Certificate> | 1587 scoped_refptr<X509Certificate> |
| 1583 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const { | 1588 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const { |
| 1584 return server_cert_; | 1589 return server_cert_; |
| 1585 } | 1590 } |
| 1586 | 1591 |
| 1587 } // namespace net | 1592 } // namespace net |
| OLD | NEW |