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

Issue 2084153003: Remove the test-only X509Certificate constructor (Closed)

Created:
4 years, 6 months ago by Ryan Sleevi
Modified:
4 years, 6 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, Eran Messeri, certificate-transparency-chrome_googlegroups.com, tburkard+watch_chromium.org, jam, msramek+watch_chromium.org, raymes+watch_chromium.org, Randy Smith (Not in Mondays), gavinp+prer_chromium.org, darin-cc_chromium.org, loading-reviews_chromium.org, chromium-apps-reviews_chromium.org, markusheintz_
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove the test-only X509Certificate constructor net::X509Certificate had a constructor that was intended for test-only code that allowed minting a fake certificate. However, this is a frequent source of test bugs, because these certificates violate one of X509Certificate's core guarantees - that there's always an associated OSCertHandle for an X509Certificate. This removes the ctor and all usages of it. Code either imports a test certificate directly or mints them on the fly, as appropriate. BUG=526899 TBR=rdevlin.cronin@chromium.org Committed: https://crrev.com/f300d683274a040d68a367aeed7aecbdc3a611a8 Cr-Commit-Position: refs/heads/master@{#401430}

Patch Set 1 #

Patch Set 2 : Fix #

Patch Set 3 : Fixes #

Patch Set 4 : Prerender fix #

Patch Set 5 : Fixup .isolate for GYP build #

Total comments: 9

Patch Set 6 : Fix isolate #

Patch Set 7 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -182 lines) Patch
M chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 5 chunks +24 lines, -15 lines 0 comments Download
M chrome/browser/ssl/captive_portal_blocking_page_browsertest.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/session_state_delegate_chromeos_unittest.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/website_settings/website_settings_unittest.cc View 1 2 3 4 5 6 2 chunks +5 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/interstitials/interstitial_ui.cc View 3 chunks +0 lines, -6 lines 0 comments Download
M content/browser/loader/resource_loader_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M extensions/browser/api/cast_channel/cast_socket_unittest.cc View 1 2 3 4 5 6 2 chunks +6 lines, -4 lines 0 comments Download
M extensions/extensions_unittests.isolate View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M ios/web/net/request_tracker_impl_unittest.mm View 1 2 3 4 5 6 1 chunk +2 lines, -4 lines 0 comments Download
M net/cert/ct_policy_enforcer_unittest.cc View 1 2 3 4 5 6 4 chunks +48 lines, -65 lines 0 comments Download
M net/cert/x509_certificate.h View 1 chunk +0 lines, -5 lines 0 comments Download
M net/cert/x509_certificate.cc View 1 chunk +0 lines, -11 lines 0 comments Download
M net/cert/x509_util_unittest.cc View 1 2 1 chunk +42 lines, -16 lines 0 comments Download
M net/ssl/ssl_client_auth_cache_unittest.cc View 1 2 3 4 5 6 5 chunks +40 lines, -41 lines 0 comments Download

Messages

Total messages: 40 (18 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2084153003/40001
4 years, 6 months ago (2016-06-21 23:44:49 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2084153003/60001
4 years, 6 months ago (2016-06-22 00:12:39 UTC) #4
Ryan Sleevi
thakis: Rubberstamp refactor for the //chrome land? :) wez: cast eugenebut: iOS mmenke: //net and ...
4 years, 6 months ago (2016-06-22 00:56:16 UTC) #10
Eugene But (OOO till 7-30)
ios lgtm
4 years, 6 months ago (2016-06-22 01:11:22 UTC) #11
Wez
cast rubber-stampish LGTM
4 years, 6 months ago (2016-06-22 01:22:14 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/189404)
4 years, 6 months ago (2016-06-22 02:17:31 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2084153003/80001
4 years, 6 months ago (2016-06-22 02:26:35 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/189494)
4 years, 6 months ago (2016-06-22 04:20:06 UTC) #18
Nico
chrome/ lgtm stamp https://codereview.chromium.org/2084153003/diff/80001/chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc File chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc (right): https://codereview.chromium.org/2084153003/diff/80001/chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc#newcode445 chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc:445: net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem")); (is there a bug ...
4 years, 6 months ago (2016-06-22 14:12:11 UTC) #19
Ryan Sleevi
https://codereview.chromium.org/2084153003/diff/80001/chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc File chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc (right): https://codereview.chromium.org/2084153003/diff/80001/chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc#newcode445 chrome/browser/chromeos/login/users/multi_profile_user_controller_unittest.cc:445: net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem")); On 2016/06/22 14:12:11, Nico wrote: > (is ...
4 years, 6 months ago (2016-06-22 15:22:26 UTC) #20
mmenke
You should probably have someone more familiar with the X509Certificate class review this - I'm ...
4 years, 6 months ago (2016-06-22 15:58:42 UTC) #21
Ryan Sleevi
Had been trying to diversify since it was largely test code being touched, and because ...
4 years, 6 months ago (2016-06-22 16:00:21 UTC) #23
eroman
lgtm https://codereview.chromium.org/2084153003/diff/80001/net/cert/ct_policy_enforcer_unittest.cc File net/cert/ct_policy_enforcer_unittest.cc (right): https://codereview.chromium.org/2084153003/diff/80001/net/cert/ct_policy_enforcer_unittest.cc#newcode480 net/cert/ct_policy_enforcer_unittest.cc:480: const base::Time& start = kTestData[i].validity_start; optional: could instead ...
4 years, 6 months ago (2016-06-22 16:51:08 UTC) #24
Ryan Sleevi
https://codereview.chromium.org/2084153003/diff/80001/net/ssl/ssl_client_auth_cache_unittest.cc File net/ssl/ssl_client_auth_cache_unittest.cc (right): https://codereview.chromium.org/2084153003/diff/80001/net/ssl/ssl_client_auth_cache_unittest.cc#newcode122 net/ssl/ssl_client_auth_cache_unittest.cc:122: ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem")); On 2016/06/22 16:51:08, eroman wrote: > Any ...
4 years, 6 months ago (2016-06-22 17:31:46 UTC) #25
mmenke
content/browser/loader LGTM, rubberstamp (Not sure if you already have reviewer coverage of that file)
4 years, 6 months ago (2016-06-22 17:33:59 UTC) #26
eroman
https://codereview.chromium.org/2084153003/diff/80001/net/ssl/ssl_client_auth_cache_unittest.cc File net/ssl/ssl_client_auth_cache_unittest.cc (right): https://codereview.chromium.org/2084153003/diff/80001/net/ssl/ssl_client_auth_cache_unittest.cc#newcode122 net/ssl/ssl_client_auth_cache_unittest.cc:122: ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem")); On 2016/06/22 17:31:45, Ryan Sleevi wrote: > ...
4 years, 6 months ago (2016-06-22 17:38:21 UTC) #27
Ryan Sleevi
https://codereview.chromium.org/2084153003/diff/80001/net/ssl/ssl_client_auth_cache_unittest.cc File net/ssl/ssl_client_auth_cache_unittest.cc (right): https://codereview.chromium.org/2084153003/diff/80001/net/ssl/ssl_client_auth_cache_unittest.cc#newcode122 net/ssl/ssl_client_auth_cache_unittest.cc:122: ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem")); On 2016/06/22 17:38:21, eroman wrote: > 55-61 ...
4 years, 6 months ago (2016-06-22 20:27:33 UTC) #28
Ryan Sleevi
maruel: For isolate changes
4 years, 6 months ago (2016-06-22 20:29:01 UTC) #30
M-A Ruel
oh no! Not another layering violation of unit test data!! lgtm
4 years, 6 months ago (2016-06-22 20:29:51 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2084153003/120001
4 years, 6 months ago (2016-06-22 20:37:37 UTC) #36
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 6 months ago (2016-06-22 22:11:03 UTC) #38
commit-bot: I haz the power
4 years, 6 months ago (2016-06-22 22:14:12 UTC) #40
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/f300d683274a040d68a367aeed7aecbdc3a611a8
Cr-Commit-Position: refs/heads/master@{#401430}

Powered by Google App Engine
This is Rietveld 408576698