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

Unified Diff: components/cronet/android/test/mock_cert_verifier.cc

Issue 2052363002: Enable public key pinning of local trust anchors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ryan's comments + unit tests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/test/mock_cert_verifier.cc
diff --git a/components/cronet/android/test/mock_cert_verifier.cc b/components/cronet/android/test/mock_cert_verifier.cc
index 945f5ea2d67e48cbd807c1d1fe9e7a40578fb60e..a70a9ea9c2cbfda3630a46d7fc1384078d0c75c4 100644
--- a/components/cronet/android/test/mock_cert_verifier.cc
+++ b/components/cronet/android/test/mock_cert_verifier.cc
@@ -55,6 +55,7 @@ static jlong CreateMockCertVerifier(
JNIEnv* env,
const JavaParamRef<jclass>& jcaller,
const JavaParamRef<jobjectArray>& jcerts,
+ const jboolean jknown_root,
const JavaParamRef<jstring>& jtest_data_dir) {
base::FilePath test_data_dir(
base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
@@ -68,9 +69,8 @@ static jlong CreateMockCertVerifier(
verify_result.verified_cert =
net::ImportCertFromFile(net::GetTestCertsDirectory(), cert);
- // Let the cert be treated as a known root cert.
- // This will enable HPKP verification.
- verify_result.is_issued_by_known_root = true;
+ // By default, HPKP verification is enabled for known trust roots only.
+ verify_result.is_issued_by_known_root = jknown_root;
// Calculate the public key hash and add it to the verify_result.
net::HashValue hashValue;

Powered by Google App Engine
This is Rietveld 408576698