diff --git a/library/pk.c b/library/pk.c index a7440d1ffc..f91a8cab0a 100644 --- a/library/pk.c +++ b/library/pk.c @@ -1346,15 +1346,11 @@ int mbedtls_pk_sign_ext(mbedtls_pk_type_t pk_type, #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) - if (pk_type == MBEDTLS_PK_RSASSA_PSS) { - mbedtls_rsa_alt_context *rsa_alt = ctx->pk_ctx; - mbedtls_rsa_context *rsa = (mbedtls_rsa_context *)rsa_alt->key; - mbedtls_rsa_set_padding(rsa, MBEDTLS_RSA_PKCS_V21, md_alg); - return mbedtls_pk_sign(ctx, md_alg, hash, hash_len, - sig, sig_size, sig_len, f_rng, p_rng); - } else { - return MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE; - } + mbedtls_rsa_alt_context *rsa_alt = ctx->pk_ctx; + mbedtls_rsa_context *rsa = (mbedtls_rsa_context *)rsa_alt->key; + mbedtls_rsa_set_padding(rsa, MBEDTLS_RSA_PKCS_V21, md_alg); + return mbedtls_pk_sign(ctx, md_alg, hash, hash_len, + sig, sig_size, sig_len, f_rng, p_rng); #else