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

Issue 12220104: Wire up SSL client authentication for OpenSSL/Android through the net/ stack (Closed)

Created:
7 years, 10 months ago by digit1
Modified:
7 years, 9 months ago
Reviewers:
wtc, Ryan Sleevi, ppi
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Wire up SSL client authentication for OpenSSL/Android through the net/ stack Because OpenSSL/Android do not have the ability to discover if a private key exists for a given certificate/public key, net::OpenSSLClientKeyStore is used instead to store that information. OpenSSLClientKeyStore is fed information by higher layers, which are expected to use JNI and the Android KeyChain APIs to discover the associated private key/alias for a given certificate. Other work in this CL: - Moved generate-client-certificates.sh to net/data/ssl/scripts/ from net/data/ssl/scripts/client_authentication/ Also removed the run-test-server.sh script which is only used to perform manual local testing. Updated the client certificates under net/data/ssl/certificates/ and list then properly in the README file. - Added new unit test to check OpenSSL-based client authentication against the TestServer. Details are in net/socket/ssl_client_socket_openssl_unittests.cc - Modified generate-client-certificates.sh script to use a password for the client certificates it generates. This is to work around a platform bug in Android 4.0.3 and older, where the CertInstaller cannot install password-less PKCS#12 files. The password is 'chrome'. - Added GetTestClientCertsDirectory() to net/base/test_data_directory.h to deal with the fact that remote and local test servers don't accept the same kind of paths when reading the |client_authorities| field of an SSLConfig object. BUG=166642, 172902, 134418 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=185785

Patch Set 1 #

Total comments: 45

Patch Set 2 : simplify + add client authentication unit test (net) #

Patch Set 3 : un-inline constructors to appease Clang #

Patch Set 4 : Fix net/net.gyp typo #

Patch Set 5 : remove chrome/browser changes + fix linux_redux build #

Total comments: 48

Patch Set 6 : address recent nits #

Total comments: 53

Patch Set 7 : #

Total comments: 18

Patch Set 8 : Separate OpenSSLClientKeyStore from OpenSSLPrivateKeyStore #

Patch Set 9 : Fix linux_redux build. #

Total comments: 15

Patch Set 10 : address nits #

Total comments: 16

Patch Set 11 : restore in-memory public/private in-memory store for Linux/OpenSSL build. #

Total comments: 4

Patch Set 12 : git cl try #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1125 lines, -430 lines) Patch
M net/base/cert_database_openssl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +18 lines, -2 lines 0 comments Download
M net/base/keygen_handler_openssl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
A net/base/openssl_client_key_store.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +108 lines, -0 lines 0 comments Download
A net/base/openssl_client_key_store.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +140 lines, -0 lines 0 comments Download
A net/base/openssl_client_key_store_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +173 lines, -0 lines 0 comments Download
D net/base/openssl_memory_private_key_store.cc View 1 2 3 4 5 6 1 chunk +0 lines, -68 lines 0 comments Download
M net/base/openssl_private_key_store.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +28 lines, -26 lines 0 comments Download
M net/base/openssl_private_key_store_android.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -64 lines 0 comments Download
A + net/base/openssl_private_key_store_memory.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +22 lines, -16 lines 0 comments Download
M net/base/test_data_directory.h View 1 2 3 4 5 6 1 chunk +5 lines, -3 lines 0 comments Download
M net/base/test_data_directory.cc View 1 2 3 4 5 6 1 chunk +5 lines, -1 line 0 comments Download
M net/data/ssl/certificates/README View 1 1 chunk +16 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/client_1.key View 1 1 chunk +27 lines, -0 lines 0 comments Download
M net/data/ssl/certificates/client_1.pem View 1 1 chunk +48 lines, -48 lines 0 comments Download
A net/data/ssl/certificates/client_1_root.pem View 1 2 3 4 5 1 chunk +66 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/client_2.key View 1 1 chunk +27 lines, -0 lines 0 comments Download
M net/data/ssl/certificates/client_2.pem View 1 1 chunk +48 lines, -48 lines 0 comments Download
A net/data/ssl/certificates/client_2_root.pem View 1 2 3 4 5 1 chunk +66 lines, -0 lines 0 comments Download
A + net/data/ssl/scripts/client_authentication.cnf View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D net/data/ssl/scripts/client_authentication/client_authentication.cnf View 1 1 chunk +0 lines, -35 lines 0 comments Download
D net/data/ssl/scripts/client_authentication/generate-client-certificates.sh View 1 1 chunk +0 lines, -79 lines 0 comments Download
D net/data/ssl/scripts/client_authentication/run-test-server.sh View 1 1 chunk +0 lines, -16 lines 0 comments Download
A + net/data/ssl/scripts/generate-client-certificates.sh View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 6 chunks +11 lines, -3 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 3 4 5 6 7 2 chunks +9 lines, -6 lines 0 comments Download
A net/socket/ssl_client_socket_openssl_unittest.cc View 1 2 3 4 5 6 7 1 chunk +273 lines, -0 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 2 3 4 5 6 2 chunks +3 lines, -14 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
digit1
7 years, 10 months ago (2013-02-11 22:54:00 UTC) #1
digit1
Hello Ryan and ppi, This is the first version of this patch. It builds correctly, ...
7 years, 10 months ago (2013-02-11 23:15:22 UTC) #2
Ryan Sleevi
On 2013/02/11 23:15:22, digit1 wrote: > Hello Ryan and ppi, > > This is the ...
7 years, 10 months ago (2013-02-11 23:59:03 UTC) #3
Ryan Sleevi
I feel like design wise, we're getting into "thousand cuts" territory. I've already raised concerns ...
7 years, 10 months ago (2013-02-12 00:25:16 UTC) #4
digit1
On 2013/02/11 23:59:03, Ryan Sleevi wrote: > > WFM. DSA certs are the white whales ...
7 years, 10 months ago (2013-02-12 13:08:44 UTC) #5
digit1
On 2013/02/12 00:25:16, Ryan Sleevi wrote: > I feel like design wise, we're getting into ...
7 years, 10 months ago (2013-02-12 14:19:47 UTC) #6
digit1
https://chromiumcodereview.appspot.com/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc File chrome/browser/ui/android/ssl_client_certificate_selector_android.cc (right): https://chromiumcodereview.appspot.com/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc#newcode75 chrome/browser/ui/android/ssl_client_certificate_selector_android.cc:75: namespace browser { On 2013/02/12 00:25:17, Ryan Sleevi wrote: ...
7 years, 10 months ago (2013-02-12 15:05:25 UTC) #7
Ryan Sleevi
On 2013/02/12 13:08:44, digit1 wrote: > The run-test-server.sh and run-forwarder-test-server.sh are _only_ to perform > ...
7 years, 10 months ago (2013-02-12 18:38:45 UTC) #8
Ryan Sleevi
On 2013/02/12 14:19:47, digit1 wrote: > On 2013/02/12 00:25:16, Ryan Sleevi wrote: > > I ...
7 years, 10 months ago (2013-02-12 18:43:43 UTC) #9
digit1
On 2013/02/12 18:43:43, Ryan Sleevi wrote: > > More importantly than avoiding OpenSSL-specific code is ...
7 years, 10 months ago (2013-02-12 19:31:49 UTC) #10
Ryan Sleevi
https://codereview.chromium.org/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc File chrome/browser/ui/android/ssl_client_certificate_selector_android.cc (right): https://codereview.chromium.org/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc#newcode167 chrome/browser/ui/android/ssl_client_certificate_selector_android.cc:167: LOG(INFO) << "Client certificate request cancelled"; seems unnecessarily log ...
7 years, 10 months ago (2013-02-12 20:12:58 UTC) #11
Ryan Sleevi
On 2013/02/12 19:31:49, digit1 wrote: > On 2013/02/12 18:43:43, Ryan Sleevi wrote: > > > ...
7 years, 10 months ago (2013-02-12 20:15:14 UTC) #12
digit1
FYI, I'm uploading a few intermediate patches to test them on the bots. There is ...
7 years, 10 months ago (2013-02-13 17:16:07 UTC) #13
digit1
I've removed all the chrome/ changes from this Issue (to be revived in a later ...
7 years, 10 months ago (2013-02-13 18:24:34 UTC) #14
Ryan Sleevi
https://chromiumcodereview.appspot.com/12220104/diff/22002/net/base/cert_database_openssl.cc File net/base/cert_database_openssl.cc (right): https://chromiumcodereview.appspot.com/12220104/diff/22002/net/base/cert_database_openssl.cc#newcode32 net/base/cert_database_openssl.cc:32: cert, &private_key)) indents https://chromiumcodereview.appspot.com/12220104/diff/22002/net/base/openssl_private_key_store.h File net/base/openssl_private_key_store.h (right): https://chromiumcodereview.appspot.com/12220104/diff/22002/net/base/openssl_private_key_store.h#newcode57 net/base/openssl_private_key_store.h:57: ...
7 years, 10 months ago (2013-02-13 23:25:55 UTC) #15
Ryan Sleevi
https://codereview.chromium.org/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc File chrome/browser/ui/android/ssl_client_certificate_selector_android.cc (right): https://codereview.chromium.org/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc#newcode167 chrome/browser/ui/android/ssl_client_certificate_selector_android.cc:167: LOG(INFO) << "Client certificate request cancelled"; On 2013/02/13 18:24:34, ...
7 years, 10 months ago (2013-02-13 23:32:26 UTC) #16
digit1
https://codereview.chromium.org/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc File chrome/browser/ui/android/ssl_client_certificate_selector_android.cc (right): https://codereview.chromium.org/12220104/diff/1/chrome/browser/ui/android/ssl_client_certificate_selector_android.cc#newcode167 chrome/browser/ui/android/ssl_client_certificate_selector_android.cc:167: LOG(INFO) << "Client certificate request cancelled"; Point taken then, ...
7 years, 10 months ago (2013-02-14 06:23:50 UTC) #17
Ryan Sleevi
https://codereview.chromium.org/12220104/diff/22002/net/base/openssl_private_key_store.h File net/base/openssl_private_key_store.h (right): https://codereview.chromium.org/12220104/diff/22002/net/base/openssl_private_key_store.h#newcode57 net/base/openssl_private_key_store.h:57: }; On 2013/02/14 06:23:50, digit1 wrote: > ok, I ...
7 years, 10 months ago (2013-02-14 07:15:00 UTC) #18
Ryan Sleevi
https://codereview.chromium.org/12220104/diff/21041/net/base/cert_database_openssl.cc File net/base/cert_database_openssl.cc (right): https://codereview.chromium.org/12220104/diff/21041/net/base/cert_database_openssl.cc#newcode32 net/base/cert_database_openssl.cc:32: cert, &private_key)) Braces https://codereview.chromium.org/12220104/diff/21041/net/socket/ssl_client_socket_openssl_unittest.cc File net/socket/ssl_client_socket_openssl_unittest.cc (right): https://codereview.chromium.org/12220104/diff/21041/net/socket/ssl_client_socket_openssl_unittest.cc#newcode44 net/socket/ssl_client_socket_openssl_unittest.cc:44: ...
7 years, 10 months ago (2013-02-14 07:54:01 UTC) #19
digit1
https://codereview.chromium.org/12220104/diff/22002/net/base/openssl_private_key_store.h File net/base/openssl_private_key_store.h (right): https://codereview.chromium.org/12220104/diff/22002/net/base/openssl_private_key_store.h#newcode57 net/base/openssl_private_key_store.h:57: }; On 2013/02/14 07:15:00, Ryan Sleevi wrote: > I'm ...
7 years, 10 months ago (2013-02-14 08:24:38 UTC) #20
Ryan Sleevi
Will finish the review in a few hours. Sorry about the BIO mixup. https://codereview.chromium.org/12220104/diff/22002/net/socket/ssl_client_socket_openssl_unittest.cc File ...
7 years, 10 months ago (2013-02-14 08:51:15 UTC) #21
ppi
This looks great! I remember the hard time I had reading the OpenSSL key stores ...
7 years, 10 months ago (2013-02-15 19:54:46 UTC) #22
Ryan Sleevi
https://codereview.chromium.org/12220104/diff/21041/net/base/openssl_memory_private_key_store.cc File net/base/openssl_memory_private_key_store.cc (right): https://codereview.chromium.org/12220104/diff/21041/net/base/openssl_memory_private_key_store.cc#newcode20 net/base/openssl_memory_private_key_store.cc:20: // This is the linux_redux specific implementation of nit: ...
7 years, 10 months ago (2013-02-15 23:53:26 UTC) #23
digit1
https://codereview.chromium.org/12220104/diff/21041/net/base/cert_database_openssl.cc File net/base/cert_database_openssl.cc (right): https://codereview.chromium.org/12220104/diff/21041/net/base/cert_database_openssl.cc#newcode32 net/base/cert_database_openssl.cc:32: cert, &private_key)) On 2013/02/14 07:54:01, Ryan Sleevi wrote: > ...
7 years, 10 months ago (2013-02-25 14:26:22 UTC) #24
Ryan Sleevi
Better, although the design of the key store still feels off. Comments bellow. https://codereview.chromium.org/12220104/diff/21041/net/base/openssl_private_key_store_unittest.cc File ...
7 years, 10 months ago (2013-02-25 19:51:07 UTC) #25
digit1
https://codereview.chromium.org/12220104/diff/21041/net/base/openssl_private_key_store_unittest.cc File net/base/openssl_private_key_store_unittest.cc (right): https://codereview.chromium.org/12220104/diff/21041/net/base/openssl_private_key_store_unittest.cc#newcode33 net/base/openssl_private_key_store_unittest.cc:33: virtual void TearDown() OVERRIDE { Can you clarify? I've ...
7 years, 10 months ago (2013-02-26 11:03:13 UTC) #26
Ryan Sleevi
Mostly nits, in the home stretch here. https://codereview.chromium.org/12220104/diff/38017/net/base/openssl_client_key_store.cc File net/base/openssl_client_key_store.cc (right): https://codereview.chromium.org/12220104/diff/38017/net/base/openssl_client_key_store.cc#newcode26 net/base/openssl_client_key_store.cc:26: if (key ...
7 years, 10 months ago (2013-02-27 01:08:20 UTC) #27
digit1
https://codereview.chromium.org/12220104/diff/38017/net/base/openssl_client_key_store.cc File net/base/openssl_client_key_store.cc (right): https://codereview.chromium.org/12220104/diff/38017/net/base/openssl_client_key_store.cc#newcode26 net/base/openssl_client_key_store.cc:26: if (key != NULL) On 2013/02/27 01:08:20, Ryan Sleevi ...
7 years, 9 months ago (2013-02-27 10:24:27 UTC) #28
Ryan Sleevi
LGTM with nits. However, if you find yourself changing any other aspects, please wait for ...
7 years, 9 months ago (2013-02-28 00:58:35 UTC) #29
digit1
https://codereview.chromium.org/12220104/diff/43002/net/base/cert_database_openssl.cc File net/base/cert_database_openssl.cc (left): https://codereview.chromium.org/12220104/diff/43002/net/base/cert_database_openssl.cc#oldcode32 net/base/cert_database_openssl.cc:32: return ERR_NO_PRIVATE_KEY_FOR_CERT; On 2013/02/28 00:58:35, Ryan Sleevi wrote: > ...
7 years, 9 months ago (2013-02-28 15:46:56 UTC) #30
wtc
Review comments on patch set 11: Many of the files are missing when I view ...
7 years, 9 months ago (2013-02-28 17:24:24 UTC) #31
digit1
https://codereview.chromium.org/12220104/diff/49001/net/base/openssl_client_key_store.h File net/base/openssl_client_key_store.h (right): https://codereview.chromium.org/12220104/diff/49001/net/base/openssl_client_key_store.h#newcode23 net/base/openssl_client_key_store.h:23: // certificate private keys. Because the platforms where OpenSSL ...
7 years, 9 months ago (2013-03-02 17:55:58 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/12220104/47006
7 years, 9 months ago (2013-03-02 22:13:34 UTC) #33
commit-bot: I haz the power
7 years, 9 months ago (2013-03-02 22:54:43 UTC) #34
Message was sent while issue was closed.
Change committed as 185785

Powered by Google App Engine
This is Rietveld 408576698