summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/ssl/s3_lib.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-02-08 22:06:49 +0000
committermiod <miod@openbsd.org>2015-02-08 22:06:49 +0000
commitc8890e32263d4a86fa0ed6ba01e21006868df07b (patch)
treec906d34bb9021bd412272bcc0baf0fc00719d6f8 /lib/libssl/src/ssl/s3_lib.c
parentSeparate the two usages for cu so you can either give it -l and -s (like (diff)
downloadwireguard-openbsd-c8890e32263d4a86fa0ed6ba01e21006868df07b.tar.xz
wireguard-openbsd-c8890e32263d4a86fa0ed6ba01e21006868df07b.zip
Rely upon enc_flags rather than the tls version, to upgrade SHA1+MD5 to
SHA256 in ssl_get_algorithm2(). From OpenSSL HEAD; ok jsing@
Diffstat (limited to 'lib/libssl/src/ssl/s3_lib.c')
-rw-r--r--lib/libssl/src/ssl/s3_lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libssl/src/ssl/s3_lib.c b/lib/libssl/src/ssl/s3_lib.c
index aae497abede..c6062934dc1 100644
--- a/lib/libssl/src/ssl/s3_lib.c
+++ b/lib/libssl/src/ssl/s3_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_lib.c,v 1.94 2015/02/07 05:46:01 jsing Exp $ */
+/* $OpenBSD: s3_lib.c,v 1.95 2015/02/08 22:06:49 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -2850,15 +2850,15 @@ ssl3_renegotiate_check(SSL *s)
return (ret);
}
/*
- * If we are using TLS v1.2 or later and default SHA1+MD5 algorithms switch
- * to new SHA256 PRF and handshake macs
+ * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF
+ * and handshake macs if required.
*/
long
ssl_get_algorithm2(SSL *s)
{
long alg2 = s->s3->tmp.new_cipher->algorithm2;
- if (s->method->version == TLS1_2_VERSION &&
+ if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF &&
alg2 == (SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF))
return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
return alg2;