diff --git a/closed/src/java.base/share/native/libjncrypto/NativeCrypto.c b/closed/src/java.base/share/native/libjncrypto/NativeCrypto.c index 0e06b77e841..a80bd25fa86 100644 --- a/closed/src/java.base/share/native/libjncrypto/NativeCrypto.c +++ b/closed/src/java.base/share/native/libjncrypto/NativeCrypto.c @@ -640,6 +640,7 @@ find_crypto_library(jboolean traceEnabled, const char *chomepath) "libcrypto.so.3", /* 3.x library name */ "libcrypto.a(libcrypto64.so.1.1)", /* 1.1.x library name from archive file */ "libcrypto.so.1.1", /* 1.1.x library name */ + "libcrypto.a(libcrypto.so.1.0.0)", /* 1.1.x library name from archive file */ "libcrypto.so.1.0.0", /* 1.0.x library name */ #elif defined(__APPLE__) /* defined(_AIX) */ "libcrypto.3.dylib", /* 3.x library name */ @@ -765,23 +766,19 @@ find_crypto_library(jboolean traceEnabled, const char *chomepath) continue; } - if (i >= num_of_generic) { - /* If library checked is not a generic one, there is no need to check further. */ - if (previousVersion > tempVersion) { - unload_crypto_library(result); - return prevResult; - } else { - if (previousVersion != 0) { - unload_crypto_library(prevResult); - } - return result; + if (tempVersion > previousVersion) { + if (0 != previousVersion) { + unload_crypto_library(prevResult); } + previousVersion = tempVersion; + prevResult = result; } else { - /* If library checked is a generic one, we need to keep checking for higher versions. */ - if (tempVersion > previousVersion) { - previousVersion = tempVersion; - prevResult = result; - } + unload_crypto_library(result); + } + + /* If library checked is not a generic one, there is no need to check further. */ + if (i >= num_of_generic) { + break; } }