From 7988163c3bd5d4c72e12ac7db960da57eba4eb0e Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 19 Dec 2013 14:42:39 -0500 Subject: [PATCH] Allow "DHE" and "kDHE" as synonyms of "EDH" and "kEDH" when specifiying ciphers The standard terminology in https://tools.ietf.org/html/rfc5426 is "DHE". "openssl ciphers" outputs "DHE" (for the most part). But users of the library currently cannot specify "DHE", they must currently specify "EDH". This change allows users to specify the common term in cipher suite strings without breaking backward compatibility. --- ssl/ssl.h | 6 ++++-- ssl/ssl_ciph.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ssl/ssl.h b/ssl/ssl.h index 1c8309eef7..3c49a38ab0 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -244,7 +244,8 @@ extern "C" { #define SSL_TXT_kDHr "kDHr" #define SSL_TXT_kDHd "kDHd" #define SSL_TXT_kDH "kDH" -#define SSL_TXT_kEDH "kEDH" +#define SSL_TXT_kEDH "kEDH" /* alias for kDHE */ +#define SSL_TXT_kDHE "kDHE" #define SSL_TXT_kKRB5 "kKRB5" #define SSL_TXT_kECDHr "kECDHr" #define SSL_TXT_kECDHe "kECDHe" @@ -268,7 +269,8 @@ extern "C" { #define SSL_TXT_DSS "DSS" #define SSL_TXT_DH "DH" -#define SSL_TXT_EDH "EDH" /* same as "kEDH:-ADH" */ +#define SSL_TXT_DHE "DHE" /* same as "kDHE:-ADH" */ +#define SSL_TXT_EDH "EDH" /* alias for DHE */ #define SSL_TXT_ADH "ADH" #define SSL_TXT_RSA "RSA" #define SSL_TXT_ECDH "ECDH" diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 60b1456eb2..846478483b 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -242,6 +242,7 @@ static const SSL_CIPHER cipher_aliases[]={ {0,SSL_TXT_kDHd,0, SSL_kDHd, 0,0,0,0,0,0,0,0}, {0,SSL_TXT_kDH,0, SSL_kDHr|SSL_kDHd,0,0,0,0,0,0,0,0}, {0,SSL_TXT_kEDH,0, SSL_kEDH, 0,0,0,0,0,0,0,0}, + {0,SSL_TXT_kDHE,0, SSL_kEDH, 0,0,0,0,0,0,0,0}, {0,SSL_TXT_DH,0, SSL_kDHr|SSL_kDHd|SSL_kEDH,0,0,0,0,0,0,0,0}, {0,SSL_TXT_kKRB5,0, SSL_kKRB5, 0,0,0,0,0,0,0,0}, @@ -274,6 +275,7 @@ static const SSL_CIPHER cipher_aliases[]={ /* aliases combining key exchange and server authentication */ {0,SSL_TXT_EDH,0, SSL_kEDH,~SSL_aNULL,0,0,0,0,0,0,0}, + {0,SSL_TXT_DHE,0, SSL_kEDH,~SSL_aNULL,0,0,0,0,0,0,0}, {0,SSL_TXT_EECDH,0, SSL_kECDHE,~SSL_aNULL,0,0,0,0,0,0,0}, {0,SSL_TXT_ECDHE,0, SSL_kECDHE,~SSL_aNULL,0,0,0,0,0,0,0}, {0,SSL_TXT_NULL,0, 0,0,SSL_eNULL, 0,0,0,0,0,0}, -- 2.25.1