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: Also catch UnsatisfiedLinkError in case OpenSSL library cannot be found
Date Sat, 09 Jul 2016 16:40:08 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master a1089e1fa -> f4d5737e3


Also catch UnsatisfiedLinkError in case OpenSSL library cannot be found

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

Branch: refs/heads/master
Commit: f4d5737e3906350eaf7cdcd6dd188ababa79220d
Parents: a1089e1
Author: Sebb <sebb@apache.org>
Authored: Sat Jul 9 17:39:59 2016 +0100
Committer: Sebb <sebb@apache.org>
Committed: Sat Jul 9 17:39:59 2016 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java    | 2 ++
 .../org/apache/commons/crypto/random/OpenSslCryptoRandom.java  | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/f4d5737e/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 64487d4..0898158 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
@@ -98,6 +98,8 @@ final class OpenSsl {
             }
         } catch (Exception t) {
             loadingFailure = t.getMessage();
+        } catch (UnsatisfiedLinkError t) {
+            loadingFailure = t.getMessage();            
         } finally {
             loadingFailureReason = loadingFailure;
         }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/f4d5737e/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java b/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
index d3877cb..54c0697 100644
--- a/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
@@ -46,17 +46,19 @@ class OpenSslCryptoRandom extends Random implements CryptoRandom {
 
     private static final boolean nativeEnabled;
 
-    private static final Exception initException;
+    private static final Throwable initException;
 
     static {
         boolean opensslLoaded = false;
-        Exception except = null;
+        Throwable except = null;
         if (Crypto.isNativeCodeLoaded()) {
             try {
                 OpenSslCryptoRandomNative.initSR();
                 opensslLoaded = true;
             } catch (Exception t) {
                 except = t;
+            } catch (UnsatisfiedLinkError t) {
+                except = t;
             }
         }
         nativeEnabled = opensslLoaded;


Mime
View raw message