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

Issue 108653013: Export verified_cert and public_key_hashes on Android. (Closed)

Created:
7 years ago by davidben
Modified:
6 years, 11 months ago
CC:
chromium-reviews, craigdh+watch_chromium.org, cbentzel+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org, klundberg+watch_chromium.org, frankf+watch_chromium.org, Kenny Root (Google)
Visibility:
Public.

Description

Export verified_cert and public_key_hashes on Android. On API level 17 and up, X509TrustManager can export the verified chain. Use it to populate some of the fields in CertVerifyResult. Also correctly populate is_issued_by_known_root and enable intranet host checking. Add a test to make sure non-standard roots get flagged as such. If the APIs are not available, is_issued_by_known_root is always false. BUG=116838, 147945 TEST=CertVerifyProcTest.PublicKeyHashes CertVerifyProcTest.VerifyReturnChainBasic CertVerifyProcTest.VerifyReturnChainFiltersUnrelatedCerts CertVerifyProcTest.VerifyReturnChainProperlyOrdered CertVerifyProcTest.IntranetHostsRejected CertVerifyProcTest.IsIssuedByKnownRootIgnoresTestRoots CertVerifyProcTest.ExtraneousMD5RootCert CertVerifyProcTest.NameConstraintsFailure Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245649

Patch Set 1 #

Patch Set 2 : Missing files #

Patch Set 3 : Fix crash on CertVerifyProcTest.PaypalNullCertParsing #

Patch Set 4 : Fix android_webview build. #

Patch Set 5 : More webview #

Patch Set 6 : Appease findbugs #

Patch Set 7 : Populate is_issued_by_known_root #

Patch Set 8 : Add CertVerifyProcTest.NonStandardRoot #

Patch Set 9 : Rebase #

Total comments: 7

Patch Set 10 : Comments #

Patch Set 11 : Add missing old-Android test suppression. #

Patch Set 12 : Enable more tests. #

Total comments: 2

Patch Set 13 : Rebase, check exceptions #

Patch Set 14 : Remove unnecessary NET_EXPORT. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+468 lines, -139 lines) Patch
M android_webview/Android.mk View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M android_webview/all_webview.gyp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M build/android/findbugs_filter/findbugs_known_bugs.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M build/android/pylib/gtest/filter/net_unittests_disabled View 1 chunk +0 lines, -4 lines 0 comments Download
M net/android/cert_verify_result_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +18 lines, -4 lines 0 comments Download
A net/android/cert_verify_result_android.cc View 1 2 3 4 5 6 1 chunk +40 lines, -0 lines 0 comments Download
D net/android/cert_verify_result_android_list.h View 1 chunk +0 lines, -31 lines 0 comments Download
A + net/android/cert_verify_status_android_list.h View 1 chunk +7 lines, -7 lines 0 comments Download
D net/android/java/CertVerifyResultAndroid.template View 1 chunk +0 lines, -10 lines 0 comments Download
A + net/android/java/CertVerifyStatusAndroid.template View 1 chunk +3 lines, -3 lines 0 comments Download
A net/android/java/src/org/chromium/net/AndroidCertVerifyResult.java View 1 2 3 4 5 6 1 chunk +73 lines, -0 lines 0 comments Download
M net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java View 1 chunk +10 lines, -6 lines 0 comments Download
M net/android/java/src/org/chromium/net/X509Util.java View 1 2 3 4 5 6 11 chunks +150 lines, -22 lines 3 comments Download
M net/android/net_jni_registrar.cc View 1 chunk +1 line, -0 lines 0 comments Download
M net/android/network_library.h View 1 2 3 4 5 6 1 chunk +6 lines, -3 lines 0 comments Download
M net/android/network_library.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +19 lines, -6 lines 1 comment Download
M net/cert/cert_verify_proc.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -5 lines 0 comments Download
M net/cert/cert_verify_proc_android.cc View 1 2 3 4 5 6 5 chunks +42 lines, -9 lines 1 comment Download
M net/cert/cert_verify_proc_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 11 chunks +90 lines, -21 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +7 lines, -5 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
davidben
Here's an initial version. I haven't actually ran the tests that I've enabled; if the ...
7 years ago (2013-12-18 02:03:20 UTC) #1
davidben
Alright, it should populate is_issued_by_known_root correctly now. I've added a test to cover this case ...
7 years ago (2013-12-18 23:49:08 UTC) #2
Ryan Sleevi
I've copied Kenny on here, because of a question below. The Android bits should be ...
7 years ago (2013-12-19 00:06:58 UTC) #3
davidben
https://codereview.chromium.org/108653013/diff/160001/net/android/java/src/org/chromium/net/X509Util.java File net/android/java/src/org/chromium/net/X509Util.java (right): https://codereview.chromium.org/108653013/diff/160001/net/android/java/src/org/chromium/net/X509Util.java#newcode218 net/android/java/src/org/chromium/net/X509Util.java:218: Certificate cert = systemKeyStore.getCertificate(alias); On 2013/12/19 00:06:59, Ryan Sleevi ...
7 years ago (2013-12-19 00:42:51 UTC) #4
davidben
Updated to enable a couple more tests that should work now.
7 years ago (2013-12-20 17:37:09 UTC) #5
Ryan Sleevi
On 2013/12/20 17:37:09, David Benjamin wrote: > Updated to enable a couple more tests that ...
6 years, 11 months ago (2014-01-11 01:48:55 UTC) #6
Kenny Root
Sorry, I didn't click publish draft comments apparently. https://codereview.chromium.org/108653013/diff/160001/net/android/java/src/org/chromium/net/X509Util.java File net/android/java/src/org/chromium/net/X509Util.java (right): https://codereview.chromium.org/108653013/diff/160001/net/android/java/src/org/chromium/net/X509Util.java#newcode218 net/android/java/src/org/chromium/net/X509Util.java:218: Certificate ...
6 years, 11 months ago (2014-01-13 17:35:49 UTC) #7
Ryan Sleevi
LGTM, mod one pre-existing bug. You'll need one of the Android guys to stamp the ...
6 years, 11 months ago (2014-01-16 23:29:41 UTC) #8
davidben
+benm for android_webview/ as well. (Just buildsystem stuff.) https://codereview.chromium.org/108653013/diff/210001/net/android/network_library.cc File net/android/network_library.cc (right): https://codereview.chromium.org/108653013/diff/210001/net/android/network_library.cc#newcode49 net/android/network_library.cc:49: On ...
6 years, 11 months ago (2014-01-17 17:52:58 UTC) #9
benm (inactive)
On 2014/01/17 17:52:58, David Benjamin wrote: > +benm for android_webview/ as well. (Just buildsystem stuff.) ...
6 years, 11 months ago (2014-01-17 17:58:24 UTC) #10
Yaron
lgtm
6 years, 11 months ago (2014-01-17 19:31:56 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davidben@chromium.org/108653013/530001
6 years, 11 months ago (2014-01-17 20:17:47 UTC) #12
commit-bot: I haz the power
Change committed as 245649
6 years, 11 months ago (2014-01-17 22:52:18 UTC) #13
joth
Minor drive-by comments. Great to see this hooked up! https://codereview.chromium.org/108653013/diff/530001/net/android/java/src/org/chromium/net/X509Util.java File net/android/java/src/org/chromium/net/X509Util.java (right): https://codereview.chromium.org/108653013/diff/530001/net/android/java/src/org/chromium/net/X509Util.java#newcode204 net/android/java/src/org/chromium/net/X509Util.java:204: ...
6 years, 11 months ago (2014-01-18 00:23:13 UTC) #14
davidben
Uploaded https://codereview.chromium.org/144153002 for those comments. https://codereview.chromium.org/108653013/diff/530001/net/android/java/src/org/chromium/net/X509Util.java File net/android/java/src/org/chromium/net/X509Util.java (right): https://codereview.chromium.org/108653013/diff/530001/net/android/java/src/org/chromium/net/X509Util.java#newcode204 net/android/java/src/org/chromium/net/X509Util.java:204: KeyStore systemKeyStore = KeyStore.getInstance("AndroidCAStore"); ...
6 years, 11 months ago (2014-01-21 17:28:56 UTC) #15
joth
6 years, 11 months ago (2014-01-21 19:15:20 UTC) #16
On 21 January 2014 09:28, <davidben@chromium.org> wrote:

> Uploaded https://codereview.chromium.org/144153002 for those comments.
>
>
>
> https://codereview.chromium.org/108653013/diff/530001/net/
> android/java/src/org/chromium/net/X509Util.java
> File net/android/java/src/org/chromium/net/X509Util.java (right):
>
> https://codereview.chromium.org/108653013/diff/530001/net/
> android/java/src/org/chromium/net/X509Util.java#newcode204
> net/android/java/src/org/chromium/net/X509Util.java:204: KeyStore
> systemKeyStore = KeyStore.getInstance("AndroidCAStore");
> On 2014/01/18 00:23:13, joth (inactive) wrote:
>
>> Note "AndroidCAStore" is really an internal detail of the platform,
>>
> and any
>
>> given device might legitimately not have such a key store (i.e., no
>>
> CTS test
>
>> would break if it was removed) (see
>>
> http://b/5826113#ISSUE_HistoryHeader55)
>
>  Hence I'd suggest getting a KeyStoreException here should not be
>>
> treated like
>
>> other key store exceptions (which result in the entire cert check to
>>
> fail), and
>
>> instead just cause the 'is known root' to always be true (as it was
>>
> prior to
>
>> this CL, I think?).
>>
>
> Oh hrm. I'll defer to Ryan, but defaulting to false is probably better?
> That's what this CL currently does if the APIs are missing. It used to
> default true, but also disabled every check that depends on this. False
> would probably break fewer things. Though yeah, either way it should
> probably be treating KeyStoreException differently here.
>
>
Ah just saw this after the other CL. You're right, I was misremembering.
false is (at least, was when I looked at it) safest from the "not break
things" sense.  Over to Ryan on which is correct here. (It seems running on
pre-JB device and failing to find this 'hidden' API should be treated
equivalently, anyway)

Definite +1 for adding the histogram, very good idea.

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698