Add and use a constant-time memcmp.
[openssl.git] / crypto / rsa / rsa_oaep.c
index 546ae5fcb2edc01a0ff45d5daf357c81f5955a89..b8e3edc000f2a82cb6eb16fbd257ae5d519d6bf9 100644 (file)
@@ -143,7 +143,7 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
 
        EVP_Digest((void *)param, plen, phash, NULL, EVP_sha1(), NULL);
 
-       if (memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad)
+       if (CRYPTO_memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad)
                goto decoding_err;
        else
                {