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

Issue 1128153003: Reland "Don't use RSAPrivateKey in NSS integration code." (Closed)

Created:
5 years, 7 months ago by davidben
Modified:
5 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, dzhioev+watch_chromium.org, stevenjb+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org, mattm
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland "Don't use RSAPrivateKey in NSS integration code." This is a reland of https://codereview.chromium.org/1106103003/ with fixes to ensure callers never pass in a null slot. Currently some NSS platform integration logic transits private keys through RSAPrivateKey on CrOS. This prevents incrementally switching RSAPrivateKey to BoringSSL while keeping platform integrations on NSS. The intent of this change is to clarify RSAPrivateKey as a BoringSSL vs NSS internal crypto library (use_openssl=0 vs use_openssl=1) abstraction. It's primarily to be used with SignatureCreator. Code which uses NSS based on use_nss_certs rather than use_openssl because the underlying platform is NSS should call NSS routines directly, or introduce different abstractions. Remove the problematic RSAPrivateKey methods and instead add crypto/nss_key_util.h which contains some helper functions for manipulating NSS keys. This is sufficient to allow consumers of the removed methods to use NSS directly with about as much code. (This should not set back migrating that logic to NSS as that code was already very NSS-specific; those APIs assumed PK11SlotInfo.) nss_key_util.h, like nss_util.h, is built whenever NSS is used either internally or for platform integrations. This is so rsa_private_key_nss.cc can continue to use the helper functions to implement the NSS-agnostic interface. With this, the chimera CrOS configuration should build. The RSAPrivateKey logic is functional with the exception of some logic in components/ownership. That will be resolved in a future CL. BUG=478777, 483606 Committed: https://crrev.com/85bad9e7d11461b7599967c9a504da9ac96f11b3 Cr-Commit-Position: refs/heads/master@{#329227}

Patch Set 1 : actual previous version #

Patch Set 2 : fix crash #

Total comments: 12

Patch Set 3 : various comments, fix test #

Total comments: 2

Patch Set 4 : Add TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+478 lines, -434 lines) Patch
M chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc View 1 2 3 8 chunks +24 lines, -18 lines 0 comments Download
M chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc View 1 2 4 chunks +14 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/platform_keys/platform_keys_nss.cc View 1 6 chunks +26 lines, -16 lines 0 comments Download
M components/ownership.gypi View 1 chunk +5 lines, -0 lines 0 comments Download
M components/ownership/BUILD.gn View 2 chunks +5 lines, -0 lines 0 comments Download
M components/ownership/owner_key_util_impl.cc View 1 2 2 chunks +20 lines, -1 line 0 comments Download
M crypto/BUILD.gn View 4 chunks +14 lines, -9 lines 0 comments Download
M crypto/crypto.gyp View 4 chunks +8 lines, -8 lines 0 comments Download
M crypto/crypto.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
A crypto/nss_key_util.h View 1 chunk +58 lines, -0 lines 0 comments Download
A crypto/nss_key_util.cc View 1 1 chunk +163 lines, -0 lines 0 comments Download
A crypto/nss_key_util_unittest.cc View 1 chunk +87 lines, -0 lines 0 comments Download
M crypto/rsa_private_key.h View 2 chunks +1 line, -68 lines 0 comments Download
M crypto/rsa_private_key_nss.cc View 7 chunks +26 lines, -207 lines 0 comments Download
D crypto/rsa_private_key_nss_unittest.cc View 1 chunk +0 lines, -66 lines 0 comments Download
M net/net.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M net/test/cert_test_util.h View 2 chunks +6 lines, -9 lines 0 comments Download
M net/test/cert_test_util_nss.cc View 2 chunks +10 lines, -19 lines 0 comments Download

Messages

Total messages: 27 (10 generated)
davidben
rsleevi for crypto and net, dpolukhin for chromeos and ownership. The main difference is that ...
5 years, 7 months ago (2015-05-06 18:48:39 UTC) #3
Ryan Sleevi
Tagging in pneubeck to help me make sense of this. I definitely need another set ...
5 years, 7 months ago (2015-05-06 23:46:03 UTC) #5
Dmitry Polukhin
+ cmasone@ https://codereview.chromium.org/1128153003/diff/40001/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc File chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc (right): https://codereview.chromium.org/1128153003/diff/40001/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc#newcode87 chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc:87: public_slot.get()); On 2015/05/06 23:46:03, Ryan Sleevi wrote: ...
5 years, 7 months ago (2015-05-07 10:59:16 UTC) #7
pneubeck (no reviews)
https://codereview.chromium.org/1128153003/diff/40001/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc File chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc (right): https://codereview.chromium.org/1128153003/diff/40001/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc#newcode74 chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc:74: } On 2015/05/06 18:48:38, David Benjamin wrote: > I ...
5 years, 7 months ago (2015-05-07 12:19:16 UTC) #8
davidben
https://codereview.chromium.org/1128153003/diff/40001/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc File chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc (right): https://codereview.chromium.org/1128153003/diff/40001/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc#newcode74 chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.cc:74: } On 2015/05/07 12:19:16, pneubeck wrote: > On 2015/05/06 ...
5 years, 7 months ago (2015-05-07 20:51:44 UTC) #9
Ryan Sleevi
Thanks all for reminding me of the code that I suggested :P While it's possible ...
5 years, 7 months ago (2015-05-08 00:11:52 UTC) #10
pneubeck (no reviews)
lgtm
5 years, 7 months ago (2015-05-08 08:08:41 UTC) #11
Dmitry Polukhin
lgtm
5 years, 7 months ago (2015-05-08 09:27:53 UTC) #12
davidben
+erikwright for components/ownership.gypi > The easy unlock stuff is sketchy - it sounds like Easy ...
5 years, 7 months ago (2015-05-09 00:41:56 UTC) #14
erikwright (departed)
Please add a new entry for this gypi file in components/OWNERS LGTM.
5 years, 7 months ago (2015-05-11 14:08:57 UTC) #16
davidben
On 2015/05/11 14:08:57, erikwright wrote: > Please add a new entry for this gypi file ...
5 years, 7 months ago (2015-05-11 18:18:38 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1128153003/80001
5 years, 7 months ago (2015-05-11 18:24:16 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/86775)
5 years, 7 months ago (2015-05-11 18:43:36 UTC) #22
davidben
On 2015/05/11 18:43:36, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 7 months ago (2015-05-11 19:26:46 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1128153003/80001
5 years, 7 months ago (2015-05-11 19:27:09 UTC) #25
commit-bot: I haz the power
Committed patchset #4 (id:80001)
5 years, 7 months ago (2015-05-11 20:20:20 UTC) #26
commit-bot: I haz the power
5 years, 7 months ago (2015-05-11 20:21:22 UTC) #27
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/85bad9e7d11461b7599967c9a504da9ac96f11b3
Cr-Commit-Position: refs/heads/master@{#329227}

Powered by Google App Engine
This is Rietveld 408576698