@@ -669,7 +669,20 @@ find_crypto_library(jboolean traceEnabled, const char *chomepath)
669
669
#endif /* defined(_AIX) */
670
670
};
671
671
672
+ /** OpenSSL library names associated with bundled library. */
673
+ static const char * const bundledLibName [] = {
674
+ #if defined(_AIX )
675
+ "libcrypto-semeru.so" ,
676
+ #elif defined(__APPLE__ ) /* defined(_AIX) */
677
+ "libcrypto-semeru.dylib" ,
678
+ #elif defined(_WIN32 ) /* defined(__APPLE__) */
679
+ "crypto-semeru.dll" ,
680
+ #else /* defined(_WIN32) */
681
+ "libcrypto-semeru.so" ,
682
+ #endif /* defined(_AIX) */
683
+ };
672
684
const size_t numOfLibs = sizeof (libNames ) / sizeof (libNames [0 ]);
685
+ const size_t bundledNumOfLibs = sizeof (bundledLibName ) / sizeof (bundledLibName [0 ]);
673
686
#if defined(_AIX )
674
687
const size_t num_of_generic = 4 ;
675
688
#elif defined(__linux__ ) /* defined(_AIX) */
@@ -710,8 +723,8 @@ find_crypto_library(jboolean traceEnabled, const char *chomepath)
710
723
fprintf (stdout , "Attempting to load library bundled with JDK from: %s\n" , libPath );
711
724
}
712
725
713
- for (i = 0 ; i < numOfLibs ; i ++ ) {
714
- size_t file_len = strlen (libNames [i ]);
726
+ for (i = 0 ; i < bundledNumOfLibs ; i ++ ) {
727
+ size_t file_len = strlen (bundledLibName [i ]);
715
728
/* Allocate memory for the new file name with the path. */
716
729
char * libNameWithPath = (char * )malloc (path_len + file_len + 1 );
717
730
@@ -723,11 +736,11 @@ find_crypto_library(jboolean traceEnabled, const char *chomepath)
723
736
}
724
737
725
738
strcpy (libNameWithPath , libPath );
726
- strcat (libNameWithPath , libNames [i ]);
739
+ strcat (libNameWithPath , bundledNumOfLibs [i ]);
727
740
728
741
/* Load OpenSSL Crypto library bundled with JDK. */
729
742
if (traceEnabled ) {
730
- fprintf (stdout , "\tAttempting to load: %s\n" , libNames [i ]);
743
+ fprintf (stdout , "\tAttempting to load: %s\n" , bundledNumOfLibs [i ]);
731
744
}
732
745
result = load_crypto_library (traceEnabled , libNameWithPath );
733
746
0 commit comments