Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cherry picked from commit 2ee798880a)
Conflicts:
crypto/crypto.h
ssl/t1_lib.c
(cherry picked from commit dc406b59f3169fe191e58906df08dce97edb727c)
Conflicts:
crypto/crypto.h
ssl/d1_pkt.c
ssl/s3_pkt.c
This commit is contained in:
committed by
Dr. Stephen Henson
parent
affe98998a
commit
2708813166
@@ -935,7 +935,7 @@ static int get_server_verify(SSL *s)
|
||||
s->msg_callback(0, s->version, 0, p, len, s, s->msg_callback_arg); /* SERVER-VERIFY */
|
||||
p += 1;
|
||||
|
||||
if (memcmp(p,s->s2->challenge,s->s2->challenge_length) != 0)
|
||||
if (CRYPTO_memcmp(p,s->s2->challenge,s->s2->challenge_length) != 0)
|
||||
{
|
||||
ssl2_return_error(s,SSL2_PE_UNDEFINED_ERROR);
|
||||
SSLerr(SSL_F_GET_SERVER_VERIFY,SSL_R_CHALLENGE_IS_DIFFERENT);
|
||||
|
||||
Reference in New Issue
Block a user