summaryrefslogtreecommitdiff
path: root/ssl/s3_both.c
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2013-01-28 17:30:38 +0000
committerDr. Stephen Henson <steve@openssl.org>2013-02-06 14:16:55 +0000
commit7c770d572a719fa40fa9c82807a0bd3840baf4a0 (patch)
treebc4d2be0bd12ef55460d16c760d87ff9ae954aa0 /ssl/s3_both.c
parentea34a58385058748c51037bfb2c3208ee639f5f1 (diff)
downloadopenssl-new-7c770d572a719fa40fa9c82807a0bd3840baf4a0.tar.gz
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 2ee798880a246d648ecddadc5b91367bee4a5d98)
Diffstat (limited to 'ssl/s3_both.c')
-rw-r--r--ssl/s3_both.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index 349531460d..a537738f42 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -265,7 +265,7 @@ int ssl3_get_finished(SSL *s, int a, int b)
goto f_err;
}
- if (memcmp(p, s->s3->tmp.peer_finish_md, i) != 0)
+ if (CRYPTO_memcmp(p, s->s3->tmp.peer_finish_md, i) != 0)
{
al=SSL_AD_DECRYPT_ERROR;
SSLerr(SSL_F_SSL3_GET_FINISHED,SSL_R_DIGEST_CHECK_FAILED);