Skip to content

Commit

Permalink
Address comments 2
Browse files Browse the repository at this point in the history
  • Loading branch information
KostasTsiounis committed Nov 1, 2024
1 parent 899c1d8 commit fb51d77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,13 @@ public static final boolean isAlgorithmAvailable(String algorithm) {
if (disallowedAlgosFIPS.contains(algorithm)) {
isAlgorithmAvailable = false;
}
}
switch (algorithm) {
case "MD5":
isAlgorithmAvailable = isMD5Available();
default:
isAlgorithmAvailable = true;
} else {
switch (algorithm) {
case "MD5":
isAlgorithmAvailable = isMD5Available();
default:
isAlgorithmAvailable = true;
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions closed/src/java.base/share/native/libjncrypto/NativeCrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,16 @@ JNIEXPORT jlong JNICALL Java_jdk_crypto_jniprovider_NativeCrypto_loadCrypto
/* Check whether the loaded OpenSSL library is in FIPS mode. */
if (ossl_ver >= OPENSSL_VERSION_3_0_0) {
typedef int OSSL_fipsmode_t(OSSL_LIB_CTX *);
OSSL_fipsmode_t* OSSL_fipsmode = (OSSL_fipsmode_t*)find_crypto_symbol(crypto_library, "EVP_default_properties_is_fips_enabled");
if ((NULL != OSSL_fipsmode) && (1 == (*OSSL_fipsmode)(NULL))) {
OSSL_fipsmode_t* ossl_fipsmode = (OSSL_fipsmode_t*)find_crypto_symbol(crypto_library, "EVP_default_properties_is_fips_enabled");
if ((NULL != ossl_fipsmode) && (1 == (*ossl_fipsmode)(NULL))) {
OSSL_IS_FIPS = JNI_TRUE;
} else {
OSSL_IS_FIPS = JNI_FALSE;
}
} else {
typedef int OSSL_fipsmode_t(void);
OSSL_fipsmode_t* OSSL_fipsmode = (OSSL_fipsmode_t*)find_crypto_symbol(crypto_library, "FIPS_mode");
if ((NULL != OSSL_fipsmode) && (1 == (*OSSL_fipsmode)())) {
OSSL_fipsmode_t* ossl_fipsmode = (OSSL_fipsmode_t*)find_crypto_symbol(crypto_library, "FIPS_mode");
if ((NULL != ossl_fipsmode) && (1 == (*ossl_fipsmode)())) {
OSSL_IS_FIPS = JNI_TRUE;
} else {
OSSL_IS_FIPS = JNI_FALSE;
Expand Down

0 comments on commit fb51d77

Please sign in to comment.