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

Unified Diff: net/android/keystore_openssl.cc

Issue 166143002: Refactoring AndroidKeyStore to support a KeyStore running in another process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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: net/android/keystore_openssl.cc
diff --git a/net/android/keystore_openssl.cc b/net/android/keystore_openssl.cc
index 5ad847344aaee22b414d3e0dbd2e610a7e85ce71..afdca30de0d772d51261d9dfa7dbda242374e0bf 100644
--- a/net/android/keystore_openssl.cc
+++ b/net/android/keystore_openssl.cc
@@ -208,8 +208,7 @@ int RsaMethodFinish(RSA* rsa) {
jobject key = reinterpret_cast<jobject>(RSA_get_app_data(rsa));
if (key != NULL) {
RSA_set_app_data(rsa, NULL);
- JNIEnv* env = base::android::AttachCurrentThread();
- env->DeleteGlobalRef(key);
+ ReleaseKey(key);
}
// Actual return value is ignored by OpenSSL. There are no docs
// explaining what this is supposed to be.
@@ -413,8 +412,7 @@ int DsaMethodFinish(DSA* dsa) {
jobject key = reinterpret_cast<jobject>(DSA_get_ex_data(dsa,0));
if (key != NULL) {
DSA_set_ex_data(dsa, 0, NULL);
- JNIEnv* env = base::android::AttachCurrentThread();
- env->DeleteGlobalRef(key);
+ ReleaseKey(key);
}
// Actual return value is ignored by OpenSSL. There are no docs
// explaining what this is supposed to be.
@@ -493,9 +491,7 @@ void ExDataFree(void* parent,
return;
CRYPTO_set_ex_data(ad, idx, NULL);
-
- JNIEnv* env = base::android::AttachCurrentThread();
- env->DeleteGlobalRef(private_key);
+ ReleaseKey(private_key);
}
int ExDataDup(CRYPTO_EX_DATA* to,

Powered by Google App Engine
This is Rietveld 408576698