Check that we have enough padding characters
[platform/upstream/nodejs.git] / deps / openssl / openssl / crypto / evp / e_aes_cbc_hmac_sha256.c
old mode 100644 (file)
new mode 100755 (executable)
index 3780021..3faae63
@@ -589,6 +589,8 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx,
             maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
             maxpad &= 255;
 
+            ret &= constant_time_ge(maxpad, pad);
+
             inp_len = len - (SHA256_DIGEST_LENGTH + pad + 1);
             mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1)));
             inp_len &= mask;