Reviewed-by: Emilia Käsper <emilia@openssl.org>
CVE-2016-2107
MR: #2572
#include <openssl/rand.h>
#include "modes_lcl.h"
#include "internal/evp_int.h"
+#include "internal/constant_time_locl.h"
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
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;
#include <openssl/sha.h>
#include <openssl/rand.h>
#include "modes_lcl.h"
+#include "internal/constant_time_locl.h"
#include "internal/evp_int.h"
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
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;