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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
991 if (rv != SECSuccess) { | 991 if (rv != SECSuccess) { |
992 LogFailedNSSFunction(*weak_net_log_, "SSL_GetClientAuthDataHook", ""); | 992 LogFailedNSSFunction(*weak_net_log_, "SSL_GetClientAuthDataHook", ""); |
993 return false; | 993 return false; |
994 } | 994 } |
995 | 995 |
996 if (ssl_config_.channel_id_enabled) { | 996 if (ssl_config_.channel_id_enabled) { |
997 if (!server_bound_cert_service_) { | 997 if (!server_bound_cert_service_) { |
998 DVLOG(1) << "NULL server_bound_cert_service_, not enabling channel ID."; | 998 DVLOG(1) << "NULL server_bound_cert_service_, not enabling channel ID."; |
999 } else if (!crypto::ECPrivateKey::IsSupported()) { | 999 } else if (!crypto::ECPrivateKey::IsSupported()) { |
1000 DVLOG(1) << "Elliptic Curve not supported, not enabling channel ID."; | 1000 DVLOG(1) << "Elliptic Curve not supported, not enabling channel ID."; |
1001 } else if (!server_bound_cert_service_->IsSystemTimeValid()) { | |
1002 DVLOG(1) << "System time is weird, not enabling channel ID."; | |
mattm
2013/03/29 02:59:48
Can not remove this (and associated stuff), since
thaidn_google
2013/03/29 18:48:01
Done.
| |
1003 } else { | 1001 } else { |
1004 rv = SSL_SetClientChannelIDCallback( | 1002 rv = SSL_SetClientChannelIDCallback( |
1005 nss_fd_, SSLClientSocketNSS::Core::ClientChannelIDHandler, this); | 1003 nss_fd_, SSLClientSocketNSS::Core::ClientChannelIDHandler, this); |
1006 if (rv != SECSuccess) | 1004 if (rv != SECSuccess) |
1007 LogFailedNSSFunction(*weak_net_log_, "SSL_SetClientChannelIDCallback", | 1005 LogFailedNSSFunction(*weak_net_log_, "SSL_SetClientChannelIDCallback", |
1008 ""); | 1006 ""); |
1009 } | 1007 } |
1010 } | 1008 } |
1011 | 1009 |
1012 rv = SSL_HandshakeCallback( | 1010 rv = SSL_HandshakeCallback( |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2536 void SSLClientSocketNSS::Core::RecordChannelIDSupport() const { | 2534 void SSLClientSocketNSS::Core::RecordChannelIDSupport() const { |
2537 if (nss_handshake_state_.resumed_handshake) | 2535 if (nss_handshake_state_.resumed_handshake) |
2538 return; | 2536 return; |
2539 | 2537 |
2540 // Since this enum is used for a histogram, do not change or re-use values. | 2538 // Since this enum is used for a histogram, do not change or re-use values. |
2541 enum { | 2539 enum { |
2542 DISABLED = 0, | 2540 DISABLED = 0, |
2543 CLIENT_ONLY = 1, | 2541 CLIENT_ONLY = 1, |
2544 CLIENT_AND_SERVER = 2, | 2542 CLIENT_AND_SERVER = 2, |
2545 CLIENT_NO_ECC = 3, | 2543 CLIENT_NO_ECC = 3, |
2546 CLIENT_BAD_SYSTEM_TIME = 4, | 2544 CLIENT_NO_SERVER_BOUND_CERT_SERVICE = 4, |
mattm
2013/03/29 02:59:48
see comment above ("Since this enum is used for a
thaidn_google
2013/03/29 18:48:01
Done.
| |
2547 CLIENT_NO_SERVER_BOUND_CERT_SERVICE = 5, | |
2548 DOMAIN_BOUND_CERT_USAGE_MAX | 2545 DOMAIN_BOUND_CERT_USAGE_MAX |
2549 } supported = DISABLED; | 2546 } supported = DISABLED; |
2550 if (channel_id_xtn_negotiated_) { | 2547 if (channel_id_xtn_negotiated_) { |
2551 supported = CLIENT_AND_SERVER; | 2548 supported = CLIENT_AND_SERVER; |
2552 } else if (ssl_config_.channel_id_enabled) { | 2549 } else if (ssl_config_.channel_id_enabled) { |
2553 if (!server_bound_cert_service_) | 2550 if (!server_bound_cert_service_) |
2554 supported = CLIENT_NO_SERVER_BOUND_CERT_SERVICE; | 2551 supported = CLIENT_NO_SERVER_BOUND_CERT_SERVICE; |
2555 else if (!crypto::ECPrivateKey::IsSupported()) | 2552 else if (!crypto::ECPrivateKey::IsSupported()) |
2556 supported = CLIENT_NO_ECC; | 2553 supported = CLIENT_NO_ECC; |
2557 else if (!server_bound_cert_service_->IsSystemTimeValid()) | |
2558 supported = CLIENT_BAD_SYSTEM_TIME; | |
2559 else | 2554 else |
2560 supported = CLIENT_ONLY; | 2555 supported = CLIENT_ONLY; |
2561 } | 2556 } |
2562 UMA_HISTOGRAM_ENUMERATION("DomainBoundCerts.Support", supported, | 2557 UMA_HISTOGRAM_ENUMERATION("DomainBoundCerts.Support", supported, |
2563 DOMAIN_BOUND_CERT_USAGE_MAX); | 2558 DOMAIN_BOUND_CERT_USAGE_MAX); |
2564 } | 2559 } |
2565 | 2560 |
2566 int SSLClientSocketNSS::Core::DoBufferRecv(IOBuffer* read_buffer, int len) { | 2561 int SSLClientSocketNSS::Core::DoBufferRecv(IOBuffer* read_buffer, int len) { |
2567 DCHECK(OnNetworkTaskRunner()); | 2562 DCHECK(OnNetworkTaskRunner()); |
2568 DCHECK_GT(len, 0); | 2563 DCHECK_GT(len, 0); |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3530 EnsureThreadIdAssigned(); | 3525 EnsureThreadIdAssigned(); |
3531 base::AutoLock auto_lock(lock_); | 3526 base::AutoLock auto_lock(lock_); |
3532 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 3527 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
3533 } | 3528 } |
3534 | 3529 |
3535 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3530 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3536 return server_bound_cert_service_; | 3531 return server_bound_cert_service_; |
3537 } | 3532 } |
3538 | 3533 |
3539 } // namespace net | 3534 } // namespace net |
OLD | NEW |