+6
-0
lines changedFilter options
+6
-0
lines changed Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@
59
59
#include <openssl/rand.h>
60
60
#include "modes_lcl.h"
61
61
#include "internal/evp_int.h"
62
+
#include "internal/constant_time_locl.h"
62
63
63
64
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
64
65
# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
@@ -583,6 +584,8 @@ static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
583
584
maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
584
585
maxpad &= 255;
585
586
587
+
ret &= constant_time_ge(maxpad, pad);
588
+
586
589
inp_len = len - (SHA_DIGEST_LENGTH + pad + 1);
587
590
mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1)));
588
591
inp_len &= mask;
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@
59
59
#include <openssl/sha.h>
60
60
#include <openssl/rand.h>
61
61
#include "modes_lcl.h"
62
+
#include "internal/constant_time_locl.h"
62
63
#include "internal/evp_int.h"
63
64
64
65
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
@@ -594,6 +595,8 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx,
594
595
maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
595
596
maxpad &= 255;
596
597
598
+
ret &= constant_time_ge(maxpad, pad);
599
+
597
600
inp_len = len - (SHA256_DIGEST_LENGTH + pad + 1);
598
601
mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1)));
599
602
inp_len &= mask;
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4