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

Unified Diff: net/android/network_library.cc

Issue 11316210: Implement TestRootCerts for Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address Ryan's remarks Created 8 years 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
« no previous file with comments | « net/android/network_library.h ('k') | net/base/test_root_certs_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/network_library.cc
diff --git a/net/android/network_library.cc b/net/android/network_library.cc
index ed538a23c1ea833d1fbb26103e84f02d50e07809..c1c4d5dbb543fccc057c1221b2672d7058402faf 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -43,6 +43,18 @@ VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain,
return trusted ? VERIFY_OK : VERIFY_NO_TRUSTED_ROOT;
}
+void AddTestRootCertificate(const uint8* cert, size_t len) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jbyteArray> cert_array = ToJavaByteArray(env, cert, len);
+ DCHECK(!cert_array.is_null());
+ Java_AndroidNetworkLibrary_addTestRootCertificate(env, cert_array.obj());
+}
+
+void ClearTestRootCertificates() {
+ JNIEnv* env = AttachCurrentThread();
+ Java_AndroidNetworkLibrary_clearTestRootCertificates(env);
+}
+
bool StoreKeyPair(const uint8* public_key,
size_t public_len,
const uint8* private_key,
« no previous file with comments | « net/android/network_library.h ('k') | net/base/test_root_certs_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698