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

Unified Diff: net/android/network_library.cc

Issue 11031043: Fix handling of user and CA certificates on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
« no previous file with comments | « net/android/network_library.h ('k') | net/base/cert_database_openssl.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 ce5567928b4b4a8110ecc643f4b9e14e9d5cf67f..bd5038906a21e8187e6fa3a2b9d3351f393e4cff 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -64,6 +64,22 @@ bool StoreKeyPair(const uint8* public_key,
return ret;
}
+void StoreCertificateOrKeychain(const char* data,
+ size_t data_len,
+ bool is_pkcs12) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jbyteArray> data_array =
+ ToJavaByteArray(env, reinterpret_cast<const uint8*>(data), data_len);
+ jboolean ret = Java_AndroidNetworkLibrary_storeCertificateOrKeychain(env,
+ GetApplicationContext(), data_array.obj(), is_pkcs12);
+ LOG_IF(WARNING, !ret) <<
+ "Call to Java_AndroidNetworkLibrary_storeCertificateOrKeychain"
+ " failed";
+ // Intentionally do not return 'ret', there is little the caller can
+ // do in case of failure (the CertInstaller itself will deal with
+ // incorrect data and display the appropriate toast).
+}
+
bool HaveOnlyLoopbackAddresses() {
JNIEnv* env = AttachCurrentThread();
return Java_AndroidNetworkLibrary_haveOnlyLoopbackAddresses(env);
« no previous file with comments | « net/android/network_library.h ('k') | net/base/cert_database_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698