JNI: Report no long PSS salt support on FIPS v7 and later

pull/265/head
Chris Conlon 2026-09-04 10:49:40 -06:00
parent 5d4a9ce24d
commit 05b0d9c62f
3 changed files with 10 additions and 6 deletions

View File

@ -527,7 +527,11 @@ JNIEXPORT jboolean JNICALL Java_com_wolfssl_wolfcrypt_FeatureDetect_RsaPssLongSa
{
(void)env;
(void)jcl;
#if !defined(NO_RSA) && defined(WC_RSA_PSS) && defined(WOLFSSL_PSS_LONG_SALT)
/* FIPS v7 and later cap the PSS salt at the digest length, even when
* WOLFSSL_PSS_LONG_SALT is defined */
#if !defined(NO_RSA) && defined(WC_RSA_PSS) && \
defined(WOLFSSL_PSS_LONG_SALT) && \
!(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 7))
return JNI_TRUE;
#else
return JNI_FALSE;

View File

@ -326,10 +326,10 @@ public class FeatureDetect {
public static native boolean RsaPssEnabled();
/**
* Tests if RSA-PSS salt lengths longer than the digest are compiled into
* the native wolfSSL library (WOLFSSL_PSS_LONG_SALT).
* Tests if RSA-PSS salt lengths longer than the digest are supported by
* the native wolfSSL library.
*
* @return true if enabled, otherwise false if not compiled in.
* @return true if supported, otherwise false.
*/
public static native boolean RsaPssLongSaltEnabled();

View File

@ -1821,7 +1821,7 @@ public class WolfCryptSignatureTest {
if (!FeatureDetect.RsaPssLongSaltEnabled()) {
System.out.println("\tSkipping max salt lengths, " +
"WOLFSSL_PSS_LONG_SALT not compiled in");
"long PSS salts not supported by native wolfSSL");
return;
}
@ -2218,7 +2218,7 @@ public class WolfCryptSignatureTest {
/* Uses the maximum salt length for each digest */
if (!FeatureDetect.RsaPssLongSaltEnabled()) {
System.out.println(
"\tSkipping, WOLFSSL_PSS_LONG_SALT not compiled in");
"\tSkipping, long PSS salts not supported by native wolfSSL");
return;
}