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

Unified Diff: content/browser/loader/resource_loader.cc

Issue 859213006: Cancel client auth requests when not promptable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-auth-cancel-1
Patch Set: mmenke comments Created 5 years, 10 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: content/browser/loader/resource_loader.cc
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index f1157bda985870c34ecd16abec8e5ca19a02e335..adfa8b24667b51ab817b18866e7ac36f7c2f0295 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -316,8 +316,7 @@ void ResourceLoader::OnCertificateRequested(
<< "OnCertificateRequested called with ssl_client_auth_handler pending";
ssl_client_auth_handler_.reset(new SSLClientAuthHandler(
GetRequestInfo()->GetContext()->CreateClientCertStore(), request_.get(),
- cert_info, base::Bind(&ResourceLoader::ContinueWithCertificate,
- weak_ptr_factory_.GetWeakPtr())));
+ cert_info, this));
ssl_client_auth_handler_->SelectCertificate();
}
@@ -508,6 +507,18 @@ void ResourceLoader::ContinueSSLRequest() {
request_->ContinueDespiteLastError();
}
+void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) {
+ DCHECK(ssl_client_auth_handler_);
+ ssl_client_auth_handler_.reset();
+ request_->ContinueWithCertificate(cert);
+}
+
+void ResourceLoader::CancelCertificateSelection() {
+ DCHECK(ssl_client_auth_handler_);
+ ssl_client_auth_handler_.reset();
+ request_->CancelWithError(net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED);
+}
+
void ResourceLoader::Resume() {
DCHECK(!is_transferring_);
@@ -856,9 +867,4 @@ void ResourceLoader::RecordHistograms() {
}
}
-void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) {
- ssl_client_auth_handler_.reset();
- request_->ContinueWithCertificate(cert);
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698