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

Issue 1178193002: Sign CertificateVerify messages on a background thread. (Closed)

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

Description

Sign CertificateVerify messages on a background thread. In the general case, client certificates may involve accessing a smart card (slow). Now that BoringSSL supports asynchronous certificate signing operations in the SSL layer, use it on Mac and Windows ports. This will avoid janking the IO thread in this (extremely uncommon) use case. Moreover, some Windows smartcard drivers will show UI which, as IPC traffic between UI thread and GPU process increases, causes deadlocks. This introduces an SSLPrivateKey interface on the Chromium side which implements an asynchronous signing operation. We then add a ThreadedSSLPrivateKey implementation which pushes otherwise synchronous signatures to a base::TaskRunner and implement Windows and Mac bridges to it. These SSLPrivateKey implementations are still vended from an X509Certificate for now, but https://crbug.com/394131 will track moving it up the stack for testability (at which point it'll also gain a Copy method). Android will be switched to use it in a follow-up. (The Android codepath goes through this OpenSSLClientKeyStore hack so doing it separately is easier.) BUG=493575, 347404 Committed: https://crrev.com/1d48952e7ac455a52ffbe6597b58a571faab42e6 Cr-Commit-Position: refs/heads/master@{#337079}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 38

Patch Set 4 : rsleevi comments #

Total comments: 14

Patch Set 5 : sleevi comments, no static privates #

Patch Set 6 : rebase #

Patch Set 7 : additional comments #

Patch Set 8 : gn issue #

Patch Set 9 : rebase (try jobs can finally run) #

Patch Set 10 : fix net_nacl #

Total comments: 37

Patch Set 11 : rsleevi comments #

Patch Set 12 : rebase #

Total comments: 1

Patch Set 13 : copyright, remove enum runtime check #

Patch Set 14 : fix build #

Patch Set 15 : mac fix, edge case from downstream cl #

Patch Set 16 : more mac build fix, this is blind while mac checkout syncs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1232 lines, -1243 lines) Patch
M net/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +24 lines, -13 lines 0 comments Download
M net/log/net_log_event_type_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M net/net.gypi View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -4 lines 0 comments Download
M net/net_common.gypi View 1 2 3 4 5 6 3 chunks +12 lines, -5 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +31 lines, -13 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 3 4 5 6 7 8 9 10 11 22 chunks +277 lines, -48 lines 0 comments Download
D net/ssl/openssl_platform_key.h View 1 chunk +0 lines, -26 lines 0 comments Download
D net/ssl/openssl_platform_key_mac.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -468 lines 0 comments Download
D net/ssl/openssl_platform_key_nss.cc View 1 chunk +0 lines, -17 lines 0 comments Download
D net/ssl/openssl_platform_key_win.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -644 lines 0 comments Download
A net/ssl/ssl_platform_key.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -0 lines 0 comments Download
A net/ssl/ssl_platform_key_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +239 lines, -0 lines 0 comments Download
A + net/ssl/ssl_platform_key_nss.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -3 lines 0 comments Download
A net/ssl/ssl_platform_key_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +361 lines, -0 lines 0 comments Download
A net/ssl/ssl_private_key.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +71 lines, -0 lines 0 comments Download
A net/ssl/threaded_ssl_private_key.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +77 lines, -0 lines 0 comments Download
A net/ssl/threaded_ssl_private_key.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +86 lines, -0 lines 0 comments Download
M remoting/protocol/ssl_hmac_channel_authenticator.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (5 generated)
davidben
Sending this out for initial review. Try bots are red, but that's expected. This won't ...
5 years, 6 months ago (2015-06-12 21:39:01 UTC) #2
Ryan Sleevi
I haven't really closely dug into the implementation; I mostly focused on scanning the headers ...
5 years, 6 months ago (2015-06-12 23:37:20 UTC) #3
davidben
https://codereview.chromium.org/1178193002/diff/40001/net/BUILD.gn File net/BUILD.gn (right): https://codereview.chromium.org/1178193002/diff/40001/net/BUILD.gn#newcode250 net/BUILD.gn:250: "ssl/ssl_client_session_cache_openssl.h", On 2015/06/12 23:37:19, Ryan Sleevi wrote: > no ...
5 years, 6 months ago (2015-06-15 21:28:25 UTC) #4
Ryan Sleevi
https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h File net/socket/ssl_client_socket_openssl.h (right): https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h#newcode214 net/socket/ssl_client_socket_openssl.h:214: size_t max_out); On 2015/06/15 21:28:24, David Benjamin wrote: > ...
5 years, 6 months ago (2015-06-15 22:25:22 UTC) #5
Ryan Sleevi
https://codereview.chromium.org/1178193002/diff/40001/net/BUILD.gn File net/BUILD.gn (right): https://codereview.chromium.org/1178193002/diff/40001/net/BUILD.gn#newcode250 net/BUILD.gn:250: "ssl/ssl_client_session_cache_openssl.h", On 2015/06/15 21:28:24, David Benjamin wrote: > - ...
5 years, 6 months ago (2015-06-15 22:35:27 UTC) #6
davidben
https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h File net/socket/ssl_client_socket_openssl.h (right): https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h#newcode214 net/socket/ssl_client_socket_openssl.h:214: size_t max_out); On 2015/06/15 22:35:27, Ryan Sleevi wrote: > ...
5 years, 6 months ago (2015-06-15 22:37:44 UTC) #7
davidben
https://codereview.chromium.org/1178193002/diff/40001/net/ssl/ssl_private_key.h File net/ssl/ssl_private_key.h (right): https://codereview.chromium.org/1178193002/diff/40001/net/ssl/ssl_private_key.h#newcode21 net/ssl/ssl_private_key.h:21: using SignCallback = base::Callback<void(Error, const std::vector<uint8_t>&)>; On 2015/06/15 22:35:27, ...
5 years, 6 months ago (2015-06-15 22:41:20 UTC) #8
davidben
Last email I promise. :-) https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h File net/socket/ssl_client_socket_openssl.h (right): https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h#newcode214 net/socket/ssl_client_socket_openssl.h:214: size_t max_out); On 2015/06/15 ...
5 years, 6 months ago (2015-06-15 22:53:36 UTC) #9
Ryan Sleevi
https://codereview.chromium.org/1178193002/diff/60001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/1178193002/diff/60001/net/socket/ssl_client_socket_openssl.cc#newcode1302 net/socket/ssl_client_socket_openssl.cc:1302: // renegotiation handshake is in progress. I find this ...
5 years, 6 months ago (2015-06-15 22:55:23 UTC) #10
Ryan Sleevi
https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h File net/socket/ssl_client_socket_openssl.h (right): https://codereview.chromium.org/1178193002/diff/40001/net/socket/ssl_client_socket_openssl.h#newcode214 net/socket/ssl_client_socket_openssl.h:214: size_t max_out); On 2015/06/15 22:37:44, David Benjamin wrote: > ...
5 years, 6 months ago (2015-06-15 23:02:07 UTC) #11
davidben
So, I sorted out the visibility problems that kept me from putting the private key ...
5 years, 6 months ago (2015-06-17 20:47:03 UTC) #12
davidben
Sorry about that. Missed these comments somehow. Build exclusions restored. https://codereview.chromium.org/1178193002/diff/40001/net/BUILD.gn File net/BUILD.gn (right): https://codereview.chromium.org/1178193002/diff/40001/net/BUILD.gn#newcode250 ...
5 years, 6 months ago (2015-06-18 21:58:36 UTC) #13
davidben
(As before, try jobs are expected to be almost all red. I'm just interested in ...
5 years, 6 months ago (2015-06-18 21:58:59 UTC) #14
Ryan Sleevi
Implementation LGTM, although there's two nits that I think we want to hash out. - ...
5 years, 6 months ago (2015-06-23 15:27:30 UTC) #15
davidben
https://codereview.chromium.org/1178193002/diff/180001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/1178193002/diff/180001/net/socket/ssl_client_socket_openssl.cc#newcode164 net/socket/ssl_client_socket_openssl.cc:164: *hash = SSLPrivateKey::Hash::SHA224; On 2015/06/23 15:27:28, Ryan Sleevi wrote: ...
5 years, 6 months ago (2015-06-24 21:43:13 UTC) #16
davidben
https://codereview.chromium.org/1178193002/diff/180001/net/ssl/threaded_ssl_private_key.h File net/ssl/threaded_ssl_private_key.h (right): https://codereview.chromium.org/1178193002/diff/180001/net/ssl/threaded_ssl_private_key.h#newcode47 net/ssl/threaded_ssl_private_key.h:47: const scoped_refptr<base::TaskRunner>& task_runner); On 2015/06/24 21:43:13, David Benjamin wrote: ...
5 years, 6 months ago (2015-06-24 21:44:41 UTC) #17
davidben
https://codereview.chromium.org/1178193002/diff/180001/net/ssl/ssl_platform_key_mac.cc File net/ssl/ssl_platform_key_mac.cc (right): https://codereview.chromium.org/1178193002/diff/180001/net/ssl/ssl_platform_key_mac.cc#newcode185 net/ssl/ssl_platform_key_mac.cc:185: return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED; On 2015/06/24 21:43:12, David Benjamin wrote: > ...
5 years, 6 months ago (2015-06-24 21:48:44 UTC) #18
davidben
(Ryan, am I still waiting for a final stamp from you, since the last set ...
5 years, 5 months ago (2015-06-29 17:37:52 UTC) #20
Ryan Sleevi
Sorry, still LGTM. Should ahve been more explicit about that :) https://codereview.chromium.org/1178193002/diff/180001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): ...
5 years, 5 months ago (2015-06-30 10:18:22 UTC) #21
davidben
+garykac for remoting. (Seems sergeyu is OOO.)
5 years, 5 months ago (2015-06-30 20:01:54 UTC) #23
garykac
lgtm
5 years, 5 months ago (2015-07-01 18:39:36 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1178193002/290001
5 years, 5 months ago (2015-07-01 18:41:56 UTC) #27
commit-bot: I haz the power
Committed patchset #16 (id:290001)
5 years, 5 months ago (2015-07-01 18:48:52 UTC) #28
commit-bot: I haz the power
5 years, 5 months ago (2015-07-01 18:49:42 UTC) #29
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/1d48952e7ac455a52ffbe6597b58a571faab42e6
Cr-Commit-Position: refs/heads/master@{#337079}

Powered by Google App Engine
This is Rietveld 408576698