@@ -2541,9 +2541,11 @@ WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_E
25412541#if !defined(NO_RSA )
25422542 ctx -> padding = WC_RSA_PKCS1_PADDING ;
25432543 ctx -> md = NULL ;
2544+ #ifdef WC_RSA_PSS
25442545 ctx -> mgf1_md = NULL ;
25452546 ctx -> saltlen = 0 ;
25462547#endif
2548+ #endif
25472549#ifdef HAVE_ECC
25482550 if (pkey -> ecc && pkey -> ecc -> group ) {
25492551 /* set curve NID from pkey if available */
@@ -3330,7 +3332,7 @@ int wolfSSL_EVP_PKEY_sign(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *sig,
33303332 return WOLFSSL_SUCCESS ;
33313333 }
33323334
3333- #if defined(OPENSSL_ALL ) && (!defined(HAVE_FIPS ) || FIPS_VERSION_GT (2 ,0 ))
3335+ #if defined(WC_RSA_PSS ) && (!defined(HAVE_FIPS ) || FIPS_VERSION_GT (2 ,0 ))
33343336 /* Handle PSS padding using RSA_padding_add_PKCS1_PSS_mgf1 if saltlen
33353337 * or mgf1 hash were set. Use generic signing otherwise. */
33363338 if (ctx -> mgf1_md || ctx -> saltlen ) {
@@ -3372,7 +3374,7 @@ int wolfSSL_EVP_PKEY_sign(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *sig,
33723374 * siglen = (size_t )usiglen ;
33733375 return WOLFSSL_SUCCESS ;
33743376 } else
3375- #endif /* OPENSSL_ALL */
3377+ #endif /* WC_RSA_PSS && (!HAVE_FIPS || FIPS_VERSION > 2.0) */
33763378 {
33773379 /* Use existing method for other padding types */
33783380 if (wolfSSL_RSA_sign_generic_padding (wolfSSL_EVP_MD_type (ctx -> md ), tbs ,
@@ -3519,7 +3521,7 @@ int wolfSSL_EVP_PKEY_verify(WOLFSSL_EVP_PKEY_CTX *ctx, const unsigned char *sig,
35193521 switch (ctx -> pkey -> type ) {
35203522#ifndef NO_RSA
35213523 case WC_EVP_PKEY_RSA :
3522- #if defined(OPENSSL_ALL ) && (!defined(HAVE_FIPS ) || FIPS_VERSION_GT (2 ,0 ))
3524+ #if defined(WC_RSA_PSS ) && (!defined(HAVE_FIPS ) || FIPS_VERSION_GT (2 ,0 ))
35233525 /* Verify PSS padding using wolfSSL_RSA_verify_PKCS1_PSS_mgf1 if saltlen
35243526 * or mgf1 hash were set. Do generic verification otherwise. */
35253527 if (ctx -> mgf1_md || ctx -> saltlen ) {
@@ -3557,7 +3559,7 @@ int wolfSSL_EVP_PKEY_verify(WOLFSSL_EVP_PKEY_CTX *ctx, const unsigned char *sig,
35573559
35583560 return WOLFSSL_SUCCESS ;
35593561 } else
3560- #endif /* OPENSSL_ALL */
3562+ #endif /* WC_RSA_PSS && (!HAVE_FIPS || FIPS_VERSION > 2.0) */
35613563 {
35623564 /* Use existing method for other padding types */
35633565 return wolfSSL_RSA_verify_ex (wolfSSL_EVP_MD_type (ctx -> md ), tbs ,
0 commit comments