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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 1286793002: Treat failure to parse certificates as SSL protocol errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and now with more keys Created 5 years, 4 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
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index a2fd5b14d2d18b697a57f099a889bfbd449e993e..20c6233f3685f594c09c58d8924db47388a783ff 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -1180,6 +1180,12 @@ int SSLClientSocketOpenSSL::DoVerifyCert(int result) {
GotoState(STATE_VERIFY_CERT_COMPLETE);
+ // OpenSSL decoded the certificate, but the platform certificate
+ // implementation could not. This is treated as a fatal SSL-level protocol
+ // error rather than a certificate error. See https://crbug.com/91341.
+ if (!server_cert_.get())
+ return ERR_SSL_SERVER_CERT_BAD_FORMAT;
+
// If the certificate is bad and has been previously accepted, use
// the previous status and bypass the error.
base::StringPiece der_cert;
@@ -1196,15 +1202,6 @@ int SSLClientSocketOpenSSL::DoVerifyCert(int result) {
return OK;
}
- // When running in a sandbox, it may not be possible to create an
- // X509Certificate*, as that may depend on OS functionality blocked
- // in the sandbox.
- if (!server_cert_.get()) {
- server_cert_verify_result_.Reset();
- server_cert_verify_result_.cert_status = CERT_STATUS_INVALID;
- return ERR_CERT_INVALID;
- }
-
std::string ocsp_response;
if (cert_verifier_->SupportsOCSPStapling()) {
const uint8_t* ocsp_response_raw;
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698