summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
authortedu <>2014-06-19 21:29:51 +0000
committertedu <>2014-06-19 21:29:51 +0000
commit3f4e4aa9316cf074c27b03455dc6d2b35f06ba13 (patch)
tree7d822bfb3203433ec1d2621e3b77a893bd97b408 /src/lib/libssl/t1_lib.c
parent416121b0444310ecca72bead1f9225d6cb93aef5 (diff)
downloadopenbsd-3f4e4aa9316cf074c27b03455dc6d2b35f06ba13.tar.gz
openbsd-3f4e4aa9316cf074c27b03455dc6d2b35f06ba13.tar.bz2
openbsd-3f4e4aa9316cf074c27b03455dc6d2b35f06ba13.zip
convert CRYPTO_memcmp to timingsafe_memcmp based on current policy favoring
libc interfaces over libcrypto interfaces. for now we also prefer timingsafe_memcmp over timingsafe_bcmp, even when the latter is acceptable. ok beck deraadt matthew miod
Diffstat (limited to 'src/lib/libssl/t1_lib.c')
-rw-r--r--src/lib/libssl/t1_lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 054de0ceef..7b3393820b 100644
--- a/src/lib/libssl/t1_lib.c
+++ b/src/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_lib.c,v 1.47 2014/06/18 04:49:40 miod Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.48 2014/06/19 21:29:51 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1879,7 +1879,7 @@ tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen,
1879 renew_ticket = 1; 1879 renew_ticket = 1;
1880 } else { 1880 } else {
1881 /* Check key name matches */ 1881 /* Check key name matches */
1882 if (CRYPTO_memcmp(etick, tctx->tlsext_tick_key_name, 16)) 1882 if (timingsafe_memcmp(etick, tctx->tlsext_tick_key_name, 16))
1883 return 2; 1883 return 2;
1884 HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16, 1884 HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16,
1885 tlsext_tick_md(), NULL); 1885 tlsext_tick_md(), NULL);
@@ -1899,7 +1899,7 @@ tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen,
1899 HMAC_Update(&hctx, etick, eticklen); 1899 HMAC_Update(&hctx, etick, eticklen);
1900 HMAC_Final(&hctx, tick_hmac, NULL); 1900 HMAC_Final(&hctx, tick_hmac, NULL);
1901 HMAC_CTX_cleanup(&hctx); 1901 HMAC_CTX_cleanup(&hctx);
1902 if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen)) { 1902 if (timingsafe_memcmp(tick_hmac, etick + eticklen, mlen)) {
1903 EVP_CIPHER_CTX_cleanup(&ctx); 1903 EVP_CIPHER_CTX_cleanup(&ctx);
1904 return 2; 1904 return 2;
1905 } 1905 }