You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2022/06/26 14:23:45 UTC

[commons-crypto] branch sebb-mac-test updated: Seems to have a strange library version

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch sebb-mac-test
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/sebb-mac-test by this push:
     new df7efb3  Seems to have a strange library version
df7efb3 is described below

commit df7efb33f92b8a6726993931d5fcfaac6306ae48
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jun 26 15:23:39 2022 +0100

    Seems to have a strange library version
---
 src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c b/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
index 5833a08..1218f44 100644
--- a/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
+++ b/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
@@ -60,10 +60,11 @@ static void get_methods(JNIEnv *env, HMODULE openssl)
   LOAD_OPENSSL_VERSION_FUNCTION(dlsym_OpenSSL_version_num, env, openssl);
   fprintf(stderr, "dlsym_OpenSSL_version_num() => %lx\n", dlsym_OpenSSL_version_num());
 #ifdef UNIX
-  if (dlsym_OpenSSL_version_num() > VERSION_1_1_X) {
-    LOAD_DYNAMIC_SYMBOL(dlsym_OpenSSL_version, env, openssl, "OpenSSL_version");
-  } else {
+  long version = dlsym_OpenSSL_version_num();
+  if ((version <= VERSION_1_1_X) || version == 0x20000000) {
     LOAD_DYNAMIC_SYMBOL(dlsym_OpenSSL_version, env, openssl, "SSLeay_version");
+  } else {
+    LOAD_DYNAMIC_SYMBOL(dlsym_OpenSSL_version, env, openssl, "OpenSSL_version");
   }
 #endif
 #ifdef WINDOWS