Repository: commons-crypto Updated Branches: refs/heads/master 352e89a94 -> 079c15896
CRYPTO-108 OpenSSL does not handle Native code loading failure Save load failure message, so getLoadingFailureReason == null means code loaded and init OK TODO prevent instantiation if init not done OK Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/079c1589 Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/079c1589 Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/079c1589 Branch: refs/heads/master Commit: 079c158968bffa8c8ab8ea4e59592056c9af100a Parents: 352e89a Author: Sebb <[email protected]> Authored: Wed Jul 6 22:23:01 2016 +0100 Committer: Sebb <[email protected]> Committed: Wed Jul 6 22:23:01 2016 +0100 ---------------------------------------------------------------------- src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/079c1589/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java b/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java index 231c3bc..ad66572 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java +++ b/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java @@ -93,6 +93,8 @@ final class OpenSsl { try { if (Crypto.isNativeCodeLoaded()) { OpenSslNative.initIDs(); + } else { + loadingFailure = Crypto.getLoadingError().getMessage(); } } catch (Exception t) { loadingFailure = t.getMessage(); @@ -104,7 +106,7 @@ final class OpenSsl { /** * Gets the failure reason when loading OpenSsl native. * - * @return the failure reason. + * @return the failure reason; null if it was loaded and initialised successfully */ public static String getLoadingFailureReason() { return loadingFailureReason;
