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

Issue 66213002: NSS: {EC,RSA}PrivateKey shouldn't call crypto::GetPublicNSSKeySlot or GetPrivateNSSKeySlot. (Closed)

Created:
7 years, 1 month ago by mattm
Modified:
7 years, 1 month ago
Reviewers:
wtc, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, Ryan Sleevi
Visibility:
Public.

Description

NSS: {EC,RSA}PrivateKey shouldn't call crypto::GetPublicNSSKeySlot or GetPrivateNSSKeySlot. Make ECPrivateKey use PK11_GetInternalKeySlot for temporary keys. Make ECPrivateKey and RSAPrivateKey "sensitive" functions take slot as parameter. This avoids calling non-thread-safe functions in nss_util on arbitrary threads. Also removes the ANNOTATE_SCOPED_MEMORY_LEAK from RSAPrivateKey which should no longer be necessary. BUG=125848, 34742 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=234726

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : gyp fixes #

Total comments: 54

Patch Set 5 : review changes up to comment #6 #

Patch Set 6 : compile fix #

Patch Set 7 : rebase #

Patch Set 8 : remove the checks again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -113 lines) Patch
M crypto/ec_private_key.h View 1 2 3 4 4 chunks +18 lines, -10 lines 0 comments Download
M crypto/ec_private_key_nss.cc View 1 2 3 4 5 6 7 9 chunks +37 lines, -39 lines 0 comments Download
M crypto/ec_private_key_openssl.cc View 1 2 2 chunks +0 lines, -15 lines 0 comments Download
M crypto/rsa_private_key.h View 1 2 3 4 5 chunks +18 lines, -11 lines 0 comments Download
M crypto/rsa_private_key_nss.cc View 1 2 3 4 5 6 7 5 chunks +30 lines, -38 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
mattm
I started looking at some of the thread safety issues with nss_util (see also https://codereview.chromium.org/64723006). ...
7 years, 1 month ago (2013-11-08 22:40:15 UTC) #1
Ryan Sleevi
https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc File crypto/rsa_private_key_nss.cc (left): https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc#oldcode218 crypto/rsa_private_key_nss.cc:218: PK11_GetInternalSlot()); Pretty sure ChromeOS is relying on this for ...
7 years, 1 month ago (2013-11-09 02:26:46 UTC) #2
mattm
https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc File crypto/rsa_private_key_nss.cc (left): https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc#oldcode218 crypto/rsa_private_key_nss.cc:218: PK11_GetInternalSlot()); On 2013/11/09 02:26:47, Ryan Sleevi wrote: > Pretty ...
7 years, 1 month ago (2013-11-09 03:44:32 UTC) #3
wtc
Patch set 4 LGTM. IMPORTANT: is this CL complete? I expected to see changes to ...
7 years, 1 month ago (2013-11-11 20:56:25 UTC) #4
wtc
https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc File crypto/rsa_private_key_nss.cc (left): https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc#oldcode218 crypto/rsa_private_key_nss.cc:218: PK11_GetInternalSlot()); On 2013/11/09 03:44:32, mattm wrote: > > However, ...
7 years, 1 month ago (2013-11-11 20:58:19 UTC) #5
wtc
https://codereview.chromium.org/66213002/diff/120001/crypto/ec_private_key_nss.cc File crypto/ec_private_key_nss.cc (right): https://codereview.chromium.org/66213002/diff/120001/crypto/ec_private_key_nss.cc#newcode338 crypto/ec_private_key_nss.cc:338: bool success = ECPrivateKey::ImportFromEncryptedPrivateKeyInfo( Could you take the opportunity ...
7 years, 1 month ago (2013-11-11 22:18:54 UTC) #6
mattm
Updated CL. One question: So I don't know what the procedure is for updating the ...
7 years, 1 month ago (2013-11-12 02:42:44 UTC) #7
wtc
Patch set 6 LGTM. Thanks. https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc File crypto/rsa_private_key_nss.cc (left): https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc#oldcode211 crypto/rsa_private_key_nss.cc:211: #endif On 2013/11/12 02:42:44, ...
7 years, 1 month ago (2013-11-12 18:49:42 UTC) #8
mattm
https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc File crypto/rsa_private_key_nss.cc (left): https://codereview.chromium.org/66213002/diff/120001/crypto/rsa_private_key_nss.cc#oldcode211 crypto/rsa_private_key_nss.cc:211: #endif On 2013/11/12 18:49:42, wtc wrote: > > On ...
7 years, 1 month ago (2013-11-12 22:27:03 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mattm@chromium.org/66213002/540001
7 years, 1 month ago (2013-11-12 22:32:27 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mattm@chromium.org/66213002/540001
7 years, 1 month ago (2013-11-12 23:39:45 UTC) #11
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 1 month ago (2013-11-13 01:48:30 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mattm@chromium.org/66213002/540001
7 years, 1 month ago (2013-11-13 01:56:02 UTC) #13
commit-bot: I haz the power
7 years, 1 month ago (2013-11-13 03:29:24 UTC) #14
Message was sent while issue was closed.
Change committed as 234726

Powered by Google App Engine
This is Rietveld 408576698