Reject invalid PSS parameters.
[openssl.git] / crypto / rsa / rsa_ameth.c
index 5e8701ac0ab6b8a73ba5a58e2630cb626c390b1b..6f4c1048588da9b388fd995c4fd47709b690cf0f 100644 (file)
@@ -703,9 +703,10 @@ static int rsa_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
         RSAerr(RSA_F_RSA_ITEM_VERIFY, RSA_R_UNSUPPORTED_SIGNATURE_TYPE);
         return -1;
     }
-    if (rsa_pss_to_ctx(ctx, NULL, sigalg, pkey))
+    if (rsa_pss_to_ctx(ctx, NULL, sigalg, pkey) > 0) {
         /* Carry on */
         return 2;
+    }
     return -1;
 }