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 // 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 Loading... |
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 |
| 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) && |
| 986 IsTLSVersionAdequateForHTTP2(ssl_config_)); |
978 rv = SSL_SetNextProtoNego( | 987 rv = SSL_SetNextProtoNego( |
979 nss_fd_, wire_protos.empty() ? NULL : &wire_protos[0], | 988 nss_fd_, wire_protos.empty() ? NULL : &wire_protos[0], |
980 wire_protos.size()); | 989 wire_protos.size()); |
981 if (rv != SECSuccess) | 990 if (rv != SECSuccess) |
982 LogFailedNSSFunction(*weak_net_log_, "SSL_SetNextProtoNego", ""); | 991 LogFailedNSSFunction(*weak_net_log_, "SSL_SetNextProtoNego", ""); |
983 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_ALPN, PR_TRUE); | 992 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_ALPN, PR_TRUE); |
984 if (rv != SECSuccess) | 993 if (rv != SECSuccess) |
985 LogFailedNSSFunction(*weak_net_log_, "SSL_OptionSet", "SSL_ENABLE_ALPN"); | 994 LogFailedNSSFunction(*weak_net_log_, "SSL_OptionSet", "SSL_ENABLE_ALPN"); |
986 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_NPN, PR_TRUE); | 995 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_NPN, PR_TRUE); |
987 if (rv != SECSuccess) | 996 if (rv != SECSuccess) |
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3618 scoped_refptr<X509Certificate> | 3627 scoped_refptr<X509Certificate> |
3619 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { | 3628 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { |
3620 return core_->state().server_cert.get(); | 3629 return core_->state().server_cert.get(); |
3621 } | 3630 } |
3622 | 3631 |
3623 ChannelIDService* SSLClientSocketNSS::GetChannelIDService() const { | 3632 ChannelIDService* SSLClientSocketNSS::GetChannelIDService() const { |
3624 return channel_id_service_; | 3633 return channel_id_service_; |
3625 } | 3634 } |
3626 | 3635 |
3627 } // namespace net | 3636 } // namespace net |
OLD | NEW |