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

Side by Side Diff: net/socket/ssl_client_socket_nss.cc

Issue 8869004: Revert 113419 - Revert 113409 - Add a new method to SSLClientSocket: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 PR_FALSE); 1710 PR_FALSE);
1711 net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED, 1711 net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
1712 make_scoped_refptr(new NetLogIntegerParameter("cert_count", 1712 make_scoped_refptr(new NetLogIntegerParameter("cert_count",
1713 cert_chain->len))); 1713 cert_chain->len)));
1714 SECStatus rv; 1714 SECStatus rv;
1715 rv = SSL_RestartHandshakeAfterCertReq(nss_fd_, cert, key, cert_chain); 1715 rv = SSL_RestartHandshakeAfterCertReq(nss_fd_, cert, key, cert_chain);
1716 if (rv != SECSuccess) 1716 if (rv != SECSuccess)
1717 return MapNSSError(PORT_GetError()); 1717 return MapNSSError(PORT_GetError());
1718 1718
1719 GotoState(STATE_HANDSHAKE); 1719 GotoState(STATE_HANDSHAKE);
1720 set_was_origin_bound_cert_sent(true);
1720 return OK; 1721 return OK;
1721 } 1722 }
1722 1723
1723 int SSLClientSocketNSS::DoVerifyDNSSEC(int result) { 1724 int SSLClientSocketNSS::DoVerifyDNSSEC(int result) {
1724 if (ssl_config_.dns_cert_provenance_checking_enabled && 1725 if (ssl_config_.dns_cert_provenance_checking_enabled &&
1725 dns_cert_checker_) { 1726 dns_cert_checker_) {
1726 PeerCertificateChain certs(nss_fd_); 1727 PeerCertificateChain certs(nss_fd_);
1727 dns_cert_checker_->DoAsyncVerification( 1728 dns_cert_checker_->DoAsyncVerification(
1728 host_and_port_.host(), certs.AsStringPieceVector()); 1729 host_and_port_.host(), certs.AsStringPieceVector());
1729 } 1730 }
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 return SECWouldBlock; 2266 return SECWouldBlock;
2266 } 2267 }
2267 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SSL_GET_ORIGIN_BOUND_CERT, 2268 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SSL_GET_ORIGIN_BOUND_CERT,
2268 error); 2269 error);
2269 2270
2270 SECStatus rv = SECSuccess; 2271 SECStatus rv = SECSuccess;
2271 if (error == OK) { 2272 if (error == OK) {
2272 // Synchronous success. 2273 // Synchronous success.
2273 int result = ImportOBCertAndKey(result_certificate, 2274 int result = ImportOBCertAndKey(result_certificate,
2274 result_private_key); 2275 result_private_key);
2275 if (result != OK) 2276 if (result == OK)
2277 set_was_origin_bound_cert_sent(true);
2278 else
2276 rv = SECFailure; 2279 rv = SECFailure;
wtc 2011/12/07 22:59:59 Nit: let's take the opportunity to add curly brace
Ryan Hamilton 2011/12/07 23:02:31 Done.
2277 } else { 2280 } else {
2278 rv = SECFailure; // Synchronous failure. 2281 rv = SECFailure; // Synchronous failure.
2279 } 2282 }
2280 2283
2281 int cert_count = (rv == SECSuccess) ? 1 : 0; 2284 int cert_count = (rv == SECSuccess) ? 1 : 0;
2282 net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED, 2285 net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
2283 make_scoped_refptr(new NetLogIntegerParameter("cert_count", 2286 make_scoped_refptr(new NetLogIntegerParameter("cert_count",
2284 cert_count))); 2287 cert_count)));
2285 return rv; 2288 return rv;
2286 } 2289 }
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
2754 valid_thread_id_ = base::PlatformThread::CurrentId(); 2757 valid_thread_id_ = base::PlatformThread::CurrentId();
2755 } 2758 }
2756 2759
2757 bool SSLClientSocketNSS::CalledOnValidThread() const { 2760 bool SSLClientSocketNSS::CalledOnValidThread() const {
2758 EnsureThreadIdAssigned(); 2761 EnsureThreadIdAssigned();
2759 base::AutoLock auto_lock(lock_); 2762 base::AutoLock auto_lock(lock_);
2760 return valid_thread_id_ == base::PlatformThread::CurrentId(); 2763 return valid_thread_id_ == base::PlatformThread::CurrentId();
2761 } 2764 }
2762 2765
2763 } // namespace net 2766 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698