[GitHub] 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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] 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

GitBox
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_r244819457
 
 

 ##########
 File path: src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
 ##########
 @@ -98,24 +84,26 @@ static int load_library(JNIEnv *env)
   return 1;
 }
 
-JNIEXPORT jstring JNICALL Java_org_apache_commons_crypto_OpenSslInfoNative_SSLeayVersion
-    (JNIEnv *env, jclass clazz, jint type)
+#ifdef UNIX
+static void get_methods(JNIEnv *env, void *openssl)
+#endif
+#ifdef WINDOWS
+static void get_methods(JNIEnv *env, HMODULE openssl)
+#endif
 {
-    if (!load_library(env)) {
-        return NULL;
-    }
-
-    jstring answer = (*env)->NewStringUTF(env,dlsym_SSLeay_version(type));
-    return answer;
-}
+#ifdef UNIX
+  dlerror();  // Clear any existing error
+#if OPENSSL_VERSION_NUMBER > VERSION_1_1_x
 
 Review comment:
   This prevents the JNI library from working against different versions of OpenSSL right? This should be a runtime check, not a compile-time check.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]