Add SSL_CIPHER_is_DHE. Change-Id: I158d1fa1a6b70a278054862326562988c97911b5 Reviewed-on: https://boringssl-review.googlesource.com/8140 Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 3770c6e..2b07557 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h
@@ -1095,6 +1095,9 @@ /* SSL_CIPHER_is_ECDSA returns one if |cipher| uses ECDSA. */ OPENSSL_EXPORT int SSL_CIPHER_is_ECDSA(const SSL_CIPHER *cipher); +/* SSL_CIPHER_is_DHE returns one if |cipher| uses DHE. */ +OPENSSL_EXPORT int SSL_CIPHER_is_DHE(const SSL_CIPHER *cipher); + /* SSL_CIPHER_is_ECDHE returns one if |cipher| uses ECDHE. */ OPENSSL_EXPORT int SSL_CIPHER_is_ECDHE(const SSL_CIPHER *cipher);
diff --git a/ssl/ssl_cipher.c b/ssl/ssl_cipher.c index 74645ed..e78374b 100644 --- a/ssl/ssl_cipher.c +++ b/ssl/ssl_cipher.c
@@ -1691,6 +1691,10 @@ return (cipher->algorithm_auth & SSL_aECDSA) != 0; } +int SSL_CIPHER_is_DHE(const SSL_CIPHER *cipher) { + return (cipher->algorithm_mkey & SSL_kDHE) != 0; +} + int SSL_CIPHER_is_ECDHE(const SSL_CIPHER *cipher) { return (cipher->algorithm_mkey & SSL_kECDHE) != 0; }