commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject commons-crypto git commit: CRYPTO-108 OpenSSL does not handle Native code loading failure
Date Wed, 06 Jul 2016 22:56:19 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master aaae85c8a -> edbdf9185


CRYPTO-108 OpenSSL does not handle Native code loading failure

Don't construct class if it won't work

Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/edbdf918
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/edbdf918
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/edbdf918

Branch: refs/heads/master
Commit: edbdf9185f45ce218c5b4b6ba18324d14aa8485d
Parents: aaae85c
Author: Sebb <sebb@apache.org>
Authored: Wed Jul 6 23:56:16 2016 +0100
Committer: Sebb <sebb@apache.org>
Committed: Wed Jul 6 23:56:16 2016 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/edbdf918/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 ad66572..64487d4 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
@@ -137,9 +137,13 @@ final class OpenSsl {
      *         specified algorithm.
      * @throws NoSuchPaddingException if <code>transformation</code> contains
a
      *         padding scheme that is not available.
+     * @throws IllegalStateException if native code cannot be initialised
      */
     public static OpenSsl getInstance(String transformation)
             throws NoSuchAlgorithmException, NoSuchPaddingException {
+        if (loadingFailureReason != null) {
+            throw new IllegalStateException(loadingFailureReason);
+        }
         Transform transform = tokenizeTransformation(transformation);
         int algorithmMode = AlgorithmMode.get(transform.algorithm,
                 transform.mode);


Mime
View raw message