Check that we have enough padding characters
[platform/upstream/nodejs.git] / deps / openssl / openssl / crypto / evp / e_aes_cbc_hmac_sha1.c
old mode 100644 (file)
new mode 100755 (executable)
index 8330964..ccf3043
@@ -578,6 +578,8 @@ static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
             maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
             maxpad &= 255;
 
+            ret &= constant_time_ge(maxpad, pad);
+
             inp_len = len - (SHA_DIGEST_LENGTH + pad + 1);
             mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1)));
             inp_len &= mask;