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

Issue 1286793002: Treat failure to parse certificates as SSL protocol errors. (Closed)

Created:
5 years, 4 months ago by davidben
Modified:
5 years, 4 months ago
Reviewers:
felt, sky, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, mmenke, felt
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Treat failure to parse certificates as SSL protocol errors. Right now, failure to parse certificates map to ERR_SSL_PROTOCOL_ERROR (or ERR_FAILED in NSS because our error-mapping logic isn't very good for either case), however since we use two certificate libraries together, it's possible for BoringSSL to accept a certificate while the platform doesn't. (Especially so because BoringSSL is still using OpenSSL's legacy X.509 stack which is very shoddy. Also Windows will refuse to parse things like certificates which expire on 0001-01-01.) Today, this results in ERR_CERT_INVALID (IsCertificateError gives true) with a NULL X509Certificate, crashing everywhere. Instead, these errors should be treated the same as if BoringSSL internally rejected the certificate. Map them to a new error code (for ease of debugging), ERR_SSL_SERVER_CERT_BAD_FORMAT. IsCertificateError will return false for this error. We should now actually maintain the invariant that IsCertificateError implies there is a certificate available. The user-visible error page just inherits ERR_SSL_PROTOCOL_ERROR's strings, as there is no meaningful difference between "BoringSSL rejected the cert" and "BoringSSL rejected the cert but Windows didn't". Likewise, this error is unrecoverable, matching ERR_SSL_PROTOCOL_ERROR. This removes support for using SSLClientSocket in an environment where X509Certificates cannot be created. With remoting no longer using the internal plugin, this is no longer necessary. BUG=91341 Committed: https://crrev.com/c6435a7aa061b2c32d2a015cd7acb57f4e395888 Cr-Commit-Position: refs/heads/master@{#343720}

Patch Set 1 #

Total comments: 4

Patch Set 2 : sleevi comments #

Total comments: 6

Patch Set 3 : use generate-test-certs.sh #

Patch Set 4 : and now with more keys #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -17 lines) Patch
M chrome/common/localized_error.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M net/base/net_error_list.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M net/data/ssl/certificates/README View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/bad_validity.pem View 1 2 3 1 chunk +109 lines, -0 lines 0 comments Download
M net/data/ssl/scripts/generate-test-certs.sh View 1 2 3 2 chunks +13 lines, -0 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 2 chunks +6 lines, -8 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 2 chunks +6 lines, -9 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 1 chunk +21 lines, -0 lines 0 comments Download
M net/test/spawned_test_server/base_test_server.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M net/test/spawned_test_server/base_test_server.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (6 generated)
davidben
rsleevi: Do you have opinions on whether we add a separate error code or just ...
5 years, 4 months ago (2015-08-11 19:48:57 UTC) #2
Ryan Sleevi
Where muh tests at? :D https://codereview.chromium.org/1286793002/diff/1/net/base/net_error_list.h File net/base/net_error_list.h (right): https://codereview.chromium.org/1286793002/diff/1/net/base/net_error_list.h#newcode351 net/base/net_error_list.h:351: // not a certificate ...
5 years, 4 months ago (2015-08-11 23:25:25 UTC) #3
davidben
Added a test at the SSLClientSocket layer. https://codereview.chromium.org/1286793002/diff/1/net/base/net_error_list.h File net/base/net_error_list.h (right): https://codereview.chromium.org/1286793002/diff/1/net/base/net_error_list.h#newcode351 net/base/net_error_list.h:351: // not ...
5 years, 4 months ago (2015-08-12 21:40:02 UTC) #4
Ryan Sleevi
https://codereview.chromium.org/1286793002/diff/20001/net/data/ssl/certificates/README File net/data/ssl/certificates/README (right): https://codereview.chromium.org/1286793002/diff/20001/net/data/ssl/certificates/README#newcode133 net/data/ssl/certificates/README:133: Windows refuses to parse this certificate. It'd be preferable ...
5 years, 4 months ago (2015-08-12 22:03:19 UTC) #5
davidben
https://codereview.chromium.org/1286793002/diff/20001/net/data/ssl/certificates/README File net/data/ssl/certificates/README (right): https://codereview.chromium.org/1286793002/diff/20001/net/data/ssl/certificates/README#newcode133 net/data/ssl/certificates/README:133: Windows refuses to parse this certificate. On 2015/08/12 22:03:19, ...
5 years, 4 months ago (2015-08-12 22:14:05 UTC) #6
felt
this is a nice idea, thanks for the heads up !
5 years, 4 months ago (2015-08-13 16:42:21 UTC) #9
Ryan Sleevi
https://codereview.chromium.org/1286793002/diff/20001/net/data/ssl/certificates/README File net/data/ssl/certificates/README (right): https://codereview.chromium.org/1286793002/diff/20001/net/data/ssl/certificates/README#newcode133 net/data/ssl/certificates/README:133: Windows refuses to parse this certificate. On 2015/08/12 22:14:05, ...
5 years, 4 months ago (2015-08-13 22:54:57 UTC) #10
Ryan Sleevi
Oh, forgot to add an LGTM, since I know (well, trust) you'll clean up after ...
5 years, 4 months ago (2015-08-14 00:49:32 UTC) #11
davidben
Fired new try jobs to see if generated cert also trips up Windows since I ...
5 years, 4 months ago (2015-08-14 22:42:36 UTC) #12
davidben
Oh, +sky for chrome/common/localized_error.cc
5 years, 4 months ago (2015-08-14 22:43:15 UTC) #14
sky
LGTM
5 years, 4 months ago (2015-08-14 22:56:30 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1286793002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1286793002/60001
5 years, 4 months ago (2015-08-17 17:04:09 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 4 months ago (2015-08-17 18:29:00 UTC) #19
commit-bot: I haz the power
5 years, 4 months ago (2015-08-17 18:29:34 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/c6435a7aa061b2c32d2a015cd7acb57f4e395888
Cr-Commit-Position: refs/heads/master@{#343720}

Powered by Google App Engine
This is Rietveld 408576698