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

Issue 11031043: Fix handling of user and CA certificates on Android. (Closed)

Created:
8 years, 2 months ago by digit1
Modified:
8 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, cbentzel+watch_chromium.org, jam
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Fix handling of user and CA certificates on Android. This patch fixes several things in the Android Chromium build: - Fix two bugs that prevented the proper installation of keygen-ed (public,private) key pairs on the system. The key data format was invalid, due to the use of openssl's i2d_PrivateKey() and i2d_PublicKey(), and the keys were incorrectly swapped in the intent extras. - Allow Chromium to install CA certificates as well as PKCS#12 keychains. The code only supported user certificates. This is needed to match feature parity on Android with the native browser. The reason why this is *not* enabled on other platforms is to avoid denial-of-service issues, which are not present on Android, because the CertInstaller will always show a UI Dialog asking the user to name the installed certificate. - Fix the code used to install certificates on the system, i.e. directly launch the CertInstaller activity, passing it the appropriate bytes through an Intent. The old code used SSLAddCertHandler, which forced Chromium to perform minimal checks on the certificate's data validity. These checks always failed due to CertDatabase::CheckUserCert() failing in net/base/cert_database_openssl.cc due to the fact that OpenSSLKeyStoreAndroid::FetchPrivateKeyStore() is not implemented (and probably never will, since the platform doesn't provide APIs to retrieve stored private keys). Instead, the CertInstaller is entirely in charge of verifying the validity of certificates and display a UI toast (i.e. a tiny fading non-interactive dialog) to indicate installation success / failure. Note: It is not possible to test this with the upstream Chromium build for Android (neither the ContentShell or ChromiumTestShell support the necessary features to do it). The patch was tested by applying to the internal Chrome for Android tree, and checking manually that everything works as expected. BUG=154006

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -31 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/renderer_host/buffered_resource_handler.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/x509_user_cert_resource_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/x509_user_cert_resource_handler.cc View 4 chunks +17 lines, -1 line 0 comments Download
M content/public/browser/content_browser_client.h View 1 chunk +10 lines, -0 lines 0 comments Download
M net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java View 2 chunks +53 lines, -10 lines 0 comments Download
M net/android/network_library.h View 1 chunk +14 lines, -1 line 0 comments Download
M net/android/network_library.cc View 1 chunk +16 lines, -0 lines 0 comments Download
M net/base/cert_database_openssl.cc View 1 chunk +11 lines, -11 lines 0 comments Download
M net/base/mime_util.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M net/base/openssl_private_key_store_android.cc View 2 chunks +18 lines, -7 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
digit1
this is a first attempt at upstreaming the fix that was performed last week on ...
8 years, 2 months ago (2012-10-04 14:29:34 UTC) #1
Ryan Sleevi
Quick note: For upstreaming, I don't think we want to modify the content client, or ...
8 years, 2 months ago (2012-10-04 14:37:44 UTC) #2
Ryan Sleevi
On 2012/10/04 14:37:44, Ryan Sleevi wrote: > Quick note: > > For upstreaming, I don't ...
8 years, 2 months ago (2012-10-11 01:06:09 UTC) #3
Ryan Sleevi
Ping? Should this be closed in favor of https://codereview.chromium.org/11266008/ ?
8 years, 1 month ago (2012-11-13 19:29:07 UTC) #4
digit1
8 years, 1 month ago (2012-11-14 15:33:00 UTC) #5
On 2012/11/13 19:29:07, Ryan Sleevi wrote:
> Ping?
> 
> Should this be closed in favor of https://codereview.chromium.org/11266008/ ?

Yes absolutely, I'll close this.

Powered by Google App Engine
This is Rietveld 408576698