Make sure a bad parameter to RSA_verify_PKCS1_PSS() doesn't lead to a crash.
[openssl.git] / crypto / rsa / rsa_pss.c
index 7d5b478..2e44194 100644 (file)
@@ -81,6 +81,12 @@ int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
        EVP_MD_CTX ctx;
        unsigned char H_[EVP_MAX_MD_SIZE];
 
+       if (Hash == NULL)
+               {
+               RSAerr(RSA_F_RSA_VERIFY_PKCS1_PSS, RSA_R_BAD_ARGUMENT);
+               goto err;
+               }
+
        hLen = EVP_MD_size(Hash);
        /*
         * Negative sLen has special meanings: