vanzin commented on a change in pull request #92: OpenSSL 1.1.0 updates with 
backward compatibility for OpenSSL 1.0.2 and 1.0.1
URL: https://github.com/apache/commons-crypto/pull/92#discussion_r244818064
 
 

 ##########
 File path: src/main/java/org/apache/commons/crypto/jna/OpenSslNativeJna.java
 ##########
 @@ -20,271 +20,319 @@
 
 import java.nio.ByteBuffer;
 
-import com.sun.jna.Native;
+import com.sun.jna.Function;
+import com.sun.jna.NativeLibrary;
 import com.sun.jna.NativeLong;
 import com.sun.jna.ptr.PointerByReference;
 
 class OpenSslNativeJna {
 
-    static final int OPENSSL_INIT_ENGINE_RDRAND = 0x00000200;
-
-    static final int OOSL_JNA_ENCRYPT_MODE = 1;
-    static final int OOSL_JNA_DECRYPT_MODE = 0;
-
-    static final boolean INIT_OK;
-
-    static final Throwable INIT_ERROR;
-
-    static {
-        boolean ok = false;
-        Throwable thrown = null;
-        try {
-            Native.register("crypto");
-            ERR_load_crypto_strings();
-            ok = true;
-        } catch (Exception e) {
-            thrown = e;
-        } catch (UnsatisfiedLinkError e) {
-            thrown = e;
-        } finally {
-            INIT_OK = ok;
-            INIT_ERROR = thrown;
-        }
+  static final int OPENSSL_INIT_ENGINE_RDRAND = 0x00000200;
+
+  static final int OOSL_JNA_ENCRYPT_MODE = 1;
+  static final int OOSL_JNA_DECRYPT_MODE = 0;
+
+  static final boolean INIT_OK;
+
+  static final Throwable INIT_ERROR;
+
+  public static final long VERSION;
+  public static final long VERSION_1_0_X = 0x10000000;
+  public static final long VERSION_1_1_X = 0x10100000;
+
+  static {
+    NativeLibrary crypto = NativeLibrary.getInstance("crypto");
+    Function version = null;
+    try {
+      version = crypto.getFunction("SSLeay");
+      } catch (UnsatisfiedLinkError e) {
 
 Review comment:
   Indentation is off from here on.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to