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

Side by Side 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: Update function call in test. 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 unified diff | Download patch
OLDNEW
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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived
6 // from AuthCertificateCallback() in 6 // from AuthCertificateCallback() in
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp.
8 8
9 /* ***** BEGIN LICENSE BLOCK ***** 9 /* ***** BEGIN LICENSE BLOCK *****
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 memio_Private* buffers) { 965 memio_Private* buffers) {
966 DCHECK(OnNetworkTaskRunner()); 966 DCHECK(OnNetworkTaskRunner());
967 DCHECK(!nss_fd_); 967 DCHECK(!nss_fd_);
968 DCHECK(!nss_bufs_); 968 DCHECK(!nss_bufs_);
969 969
970 nss_fd_ = socket; 970 nss_fd_ = socket;
971 nss_bufs_ = buffers; 971 nss_bufs_ = buffers;
972 972
973 SECStatus rv = SECSuccess; 973 SECStatus rv = SECSuccess;
974 974
975 #if !defined(CKM_AES_GCM)
976 #define CKM_AES_GCM 0x00001087
977 #endif
Ryan Sleevi 2014/12/12 21:33:28 Don't mix #defines in bodies like this. This block
Bence 2014/12/12 22:08:43 Done.
978
975 if (!ssl_config_.next_protos.empty()) { 979 if (!ssl_config_.next_protos.empty()) {
976 std::vector<uint8_t> wire_protos = 980 // On platforms using NSS, AES-GCM is the only mechanism that satisfies the
977 SerializeNextProtos(ssl_config_.next_protos); 981 // security requirements of HTTP/2.
982 // TODO(bnc): Check if ssl_config_.disabled_cipher_suites contains all
983 // AES-GCM ciphersuites.
984 std::vector<uint8_t> wire_protos = SerializeNextProtos(
985 ssl_config_.next_protos, PK11_TokenExists(CKM_AES_GCM));
Ryan Sleevi 2014/12/12 21:33:28 I'm fine with the simplified form - the death of N
davidben 2014/12/12 21:56:22 Wait, seriously, we can't do ECDH on Fedora, Red H
Bence 2014/12/12 22:08:43 Done.
978 rv = SSL_SetNextProtoNego( 986 rv = SSL_SetNextProtoNego(
979 nss_fd_, wire_protos.empty() ? NULL : &wire_protos[0], 987 nss_fd_, wire_protos.empty() ? NULL : &wire_protos[0],
980 wire_protos.size()); 988 wire_protos.size());
981 if (rv != SECSuccess) 989 if (rv != SECSuccess)
982 LogFailedNSSFunction(*weak_net_log_, "SSL_SetNextProtoNego", ""); 990 LogFailedNSSFunction(*weak_net_log_, "SSL_SetNextProtoNego", "");
983 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_ALPN, PR_TRUE); 991 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_ALPN, PR_TRUE);
984 if (rv != SECSuccess) 992 if (rv != SECSuccess)
985 LogFailedNSSFunction(*weak_net_log_, "SSL_OptionSet", "SSL_ENABLE_ALPN"); 993 LogFailedNSSFunction(*weak_net_log_, "SSL_OptionSet", "SSL_ENABLE_ALPN");
986 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_NPN, PR_TRUE); 994 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_NPN, PR_TRUE);
987 if (rv != SECSuccess) 995 if (rv != SECSuccess)
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after
3618 scoped_refptr<X509Certificate> 3626 scoped_refptr<X509Certificate>
3619 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { 3627 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const {
3620 return core_->state().server_cert.get(); 3628 return core_->state().server_cert.get();
3621 } 3629 }
3622 3630
3623 ChannelIDService* SSLClientSocketNSS::GetChannelIDService() const { 3631 ChannelIDService* SSLClientSocketNSS::GetChannelIDService() const {
3624 return channel_id_service_; 3632 return channel_id_service_;
3625 } 3633 }
3626 3634
3627 } // namespace net 3635 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698