Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 757033004: Do not use HTTP/2 without adequate security. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert SerializeNextProtos first argument type change. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_nss.cc
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 3651e8d62466696169433993af5f4cd92d62b67b..39a5c2a4edbaf7481f909ea3fd0af6dc151283d7 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -973,8 +973,23 @@ bool SSLClientSocketNSS::Core::Init(PRFileDesc* socket,
SECStatus rv = SECSuccess;
if (!ssl_config_.next_protos.empty()) {
- std::vector<uint8_t> wire_protos =
- SerializeNextProtos(ssl_config_.next_protos);
+ //EnsureNSSSSLInit();
Bence 2014/12/10 18:05:21 davidben: do I need EnsureNSSSSLInit() here, or is
davidben 2014/12/10 21:29:57 NSS is initialized at this point.
+ DCHECK(NSS_IsInitialized());
+ const std::vector<uint16> cipher_suites = GetNSSEnabledCipherSuites();
+ // We still have to apply the disabled_cipher_suites list to these cipher
+ // suites, because NSS does not know about them quite yet.
+ std::vector<uint16> enabled_cipher_suites;
+ for (std::vector<uint16>::const_iterator it = cipher_suites.begin();
+ it != cipher_suites.end(); ++it) {
+ if (std::find(ssl_config_.disabled_cipher_suites.begin(),
+ ssl_config_.disabled_cipher_suites.end(),
+ *it) == ssl_config_.disabled_cipher_suites.end()) {
+ enabled_cipher_suites.push_back(*it);
+ }
+ }
+ std::vector<uint8_t> wire_protos = SerializeNextProtos(
+ ssl_config_.next_protos,
+ IsSecurityAdequateForHTTP2(ssl_config_, enabled_cipher_suites));
rv = SSL_SetNextProtoNego(
nss_fd_, wire_protos.empty() ? NULL : &wire_protos[0],
wire_protos.size());
« no previous file with comments | « net/socket/ssl_client_socket.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698