You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2016/07/06 20:57:44 UTC
commons-crypto git commit: Also need to check if JNI code was
actually loaded
Repository: commons-crypto
Updated Branches:
refs/heads/master 670b462be -> 44c440ed4
Also need to check if JNI code was actually loaded
Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/44c440ed
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/44c440ed
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/44c440ed
Branch: refs/heads/master
Commit: 44c440ed4006dc190cd7f188f48e2b86c0bb304f
Parents: 670b462
Author: Sebb <se...@apache.org>
Authored: Wed Jul 6 21:57:41 2016 +0100
Committer: Sebb <se...@apache.org>
Committed: Wed Jul 6 21:57:41 2016 +0100
----------------------------------------------------------------------
.../apache/commons/crypto/cipher/CryptoCipherFactoryTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/44c440ed/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java b/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
index f47e7e0..5776b24 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
@@ -20,6 +20,7 @@ package org.apache.commons.crypto.cipher;
import java.security.GeneralSecurityException;
import java.util.Properties;
+import org.apache.commons.crypto.Crypto;
import org.junit.Assert;
import org.junit.Test;
@@ -29,7 +30,7 @@ public class CryptoCipherFactoryTest {
CryptoCipher defaultCipher = CryptoCipherFactory
.getCryptoCipher("AES/CBC/NoPadding");
final String name = defaultCipher.getClass().getName();
- if (OpenSsl.getLoadingFailureReason() == null) {
+ if (Crypto.isNativeCodeLoaded() && OpenSsl.getLoadingFailureReason() == null) {
Assert.assertEquals(OpenSslCipher.class.getName(), name);
} else {
Assert.assertEquals(JceCipher.class.getName(), name);
@@ -43,7 +44,7 @@ public class CryptoCipherFactoryTest {
CryptoCipher defaultCipher = CryptoCipherFactory.getCryptoCipher(
"AES/CBC/NoPadding", properties);
final String name = defaultCipher.getClass().getName();
- if (OpenSsl.getLoadingFailureReason() == null) {
+ if (Crypto.isNativeCodeLoaded() && OpenSsl.getLoadingFailureReason() == null) {
Assert.assertEquals(OpenSslCipher.class.getName(), name);
} else {
Assert.assertEquals(JceCipher.class.getName(), name);