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

Unified Diff: net/socket/ssl_client_socket_impl.cc

Issue 2040513003: Implement Expect-Staple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Start writing tests Created 4 years, 6 months 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
Index: net/socket/ssl_client_socket_impl.cc
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index 12867ad2e3a3d44dc10e6373c346b4e2af7adfa0..62b3b826b993066f6744bfcf2544f2aaff08a7c7 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -1359,6 +1359,8 @@ int SSLClientSocketImpl::DoVerifyCertComplete(int result) {
// the connection.
VerifyCT();
+ CheckOCSP();
estark 2016/06/09 21:24:15 Could you pass in |server_cert_| as an argument so
dadrian 2016/06/10 01:05:53 Yes, though it will eventually need both the certi
+
DCHECK(!certificate_verified_);
certificate_verified_ = true;
MaybeCacheSession();
@@ -1453,6 +1455,18 @@ void SSLClientSocketImpl::VerifyCT() {
}
}
+void SSLClientSocketImpl::CheckOCSP() {
+ TransportSecurityState::ExpectStapleState expect_staple_state;
+ if (!transport_security_state_->GetStaticExpectStapleState(
+ host_and_port_.host(), &expect_staple_state)) {
+ return;
+ }
+ SSLInfo ssl_info;
+ GetSSLInfo(&ssl_info);
+ transport_security_state_->CheckExpectStaple(
+ host_and_port_, expect_staple_state, *ssl_info.cert, ocsp_response_);
estark 2016/06/09 21:24:15 Is |ocsp_response_| already always populated? I th
dadrian 2016/06/10 01:05:53 I'll make sure it gets populated if enable_static_
+}
+
void SSLClientSocketImpl::OnHandshakeIOComplete(int result) {
int rv = DoHandshakeLoop(result);
if (rv != ERR_IO_PENDING) {

Powered by Google App Engine
This is Rietveld 408576698