summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2015-09-28 17:10:49 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-28 17:10:49 +0000
commita18ebd194ea82c5190f86fe62b56f0e46b1b36cd (patch)
tree0471ac3cd7b796d0c7669722aa8281610962bd20
parentaad953fae0bfad5c06fcb60bd1b527312f387d1e (diff)
parent66b3ce6970f1462c81ddd7301914e60b3e8d663a (diff)
downloadlibcore-a18ebd194ea82c5190f86fe62b56f0e46b1b36cd.zip
libcore-a18ebd194ea82c5190f86fe62b56f0e46b1b36cd.tar.gz
libcore-a18ebd194ea82c5190f86fe62b56f0e46b1b36cd.tar.bz2
am 66b3ce69: am 70a463cb: Merge "Fix the ENGINE_finish/ENGINE_free mixup The tests were calling finish when it meant free. This caused tests to segmentation fault next time the ENGINE was looked up in the dynamic engine list. (from cl/107214) b/23693318" into kitkat-c
* commit '66b3ce6970f1462c81ddd7301914e60b3e8d663a': Fix the ENGINE_finish/ENGINE_free mixup The tests were calling finish when it meant free. This caused tests to segmentation fault next time the ENGINE was looked up in the dynamic engine list. (from cl/107214) b/23693318
-rw-r--r--crypto/src/test/java/org/conscrypt/NativeCryptoTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/src/test/java/org/conscrypt/NativeCryptoTest.java b/crypto/src/test/java/org/conscrypt/NativeCryptoTest.java
index 1118a49..ca5f498 100644
--- a/crypto/src/test/java/org/conscrypt/NativeCryptoTest.java
+++ b/crypto/src/test/java/org/conscrypt/NativeCryptoTest.java
@@ -2054,7 +2054,7 @@ public class NativeCryptoTest extends TestCase {
long engine = NativeCrypto.ENGINE_by_id("non-existent");
if (engine != 0) {
- NativeCrypto.ENGINE_finish(engine);
+ NativeCrypto.ENGINE_free(engine);
fail("should not acquire reference to non-existent engine");
}
}
@@ -2066,7 +2066,7 @@ public class NativeCryptoTest extends TestCase {
public static void loadTestEngine() throws Exception {
long testEngine = NativeCrypto.ENGINE_by_id(TEST_ENGINE_ID);
if (testEngine != 0) {
- NativeCrypto.ENGINE_finish(testEngine);
+ NativeCrypto.ENGINE_free(testEngine);
return;
}
@@ -2096,14 +2096,14 @@ public class NativeCryptoTest extends TestCase {
NativeCrypto.ENGINE_ctrl_cmd_string(dynEngine, "ID", TEST_ENGINE_ID, 0));
assertEquals(1, NativeCrypto.ENGINE_ctrl_cmd_string(dynEngine, "LOAD", null, 0));
} finally {
- NativeCrypto.ENGINE_finish(dynEngine);
+ NativeCrypto.ENGINE_free(dynEngine);
}
testEngine = NativeCrypto.ENGINE_by_id(TEST_ENGINE_ID);
if (testEngine == 0) {
fail("could not load test engine");
}
- NativeCrypto.ENGINE_finish(testEngine);
+ NativeCrypto.ENGINE_free(testEngine);
}
public void test_ENGINE_by_id_TestEngine() throws Exception {
@@ -2112,6 +2112,7 @@ public class NativeCryptoTest extends TestCase {
long engine = NativeCrypto.ENGINE_by_id(TEST_ENGINE_ID);
assertTrue(engine != 0);
NativeCrypto.ENGINE_add(engine);
+ NativeCrypto.ENGINE_init(engine);
long pkey = NULL;
try {