1
From e42a2abadc90664e2615dc63ba7f79cf163f780a Mon Sep 17 00:00:00 2001
2
From: "Dr. Stephen Henson" <steve@openssl.org>
3
Date: Fri, 24 Oct 2014 12:30:33 +0100
4
Subject: [PATCH] ECDH downgrade bug fix.
6
Fix bug where an OpenSSL client would accept a handshake using an
7
ephemeral ECDH ciphersuites with the server key exchange message omitted.
9
Thanks to Karthikeyan Bhargavan for reporting this issue.
12
Reviewed-by: Matt Caswell <matt@openssl.org>
14
(cherry picked from commit b15f8769644b00ef7283521593360b7b2135cb63)
21
ssl/s3_clnt.c | 15 +++++++++++++--
22
2 files changed, 20 insertions(+), 2 deletions(-)
24
Index: openssl-0.9.8k/ssl/s3_clnt.c
25
===================================================================
26
--- openssl-0.9.8k.orig/ssl/s3_clnt.c 2015-01-09 11:14:28.542516654 -0500
27
+++ openssl-0.9.8k/ssl/s3_clnt.c 2015-01-09 11:14:28.538516618 -0500
28
@@ -1111,8 +1111,21 @@
30
if (!ok) return((int)n);
32
+ alg=s->s3->tmp.new_cipher->algorithms;
33
+ EVP_MD_CTX_init(&md_ctx);
35
if (s->s3->tmp.message_type != SSL3_MT_SERVER_KEY_EXCHANGE)
38
+ * Can't skip server key exchange if this is an ephemeral
41
+ if (alg & (SSL_kEDH|SSL_kECDHE))
43
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_UNEXPECTED_MESSAGE);
44
+ al = SSL_AD_UNEXPECTED_MESSAGE;
47
s->s3->tmp.reuse_message=1;
54
- alg=s->s3->tmp.new_cipher->algorithms;
55
- EVP_MD_CTX_init(&md_ctx);
57
#ifndef OPENSSL_NO_RSA