From a6981a3383c9905a732aab87778326817859cec1 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Tue, 19 Jul 2022 09:20:50 -0600 Subject: [PATCH] More alignment with OpenSSL on TLS 1.3 cipher suite constants. Our TLS 1.3 stack predates OpenSSL's. We chose TLS1_TXT_* to align with the existing names. OpenSSL made a new convention, TLS1_3_RFC_*. Match them. Similar to 53425 Change-Id: I8737d98c9c1d5c201c4726739ddcbe96123d9370 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53445 Commit-Queue: Bob Beck Reviewed-by: David Benjamin --- include/openssl/tls1.h | 11 ++++++++--- ssl/ssl_cipher.cc | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h index d55d905aa..724d58025 100644 --- a/include/openssl/tls1.h +++ b/include/openssl/tls1.h @@ -630,10 +630,15 @@ extern "C" { "ECDHE-PSK-CHACHA20-POLY1305" // TLS 1.3 ciphersuites from RFC 8446. -#define TLS1_TXT_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" -#define TLS1_TXT_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" -#define TLS1_TXT_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" +#define TLS1_3_RFC_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" +#define TLS1_3_RFC_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" +#define TLS1_3_RFC_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" +// The following constants are legacy aliases of |TLS1_3_CK_*|. +// TODO(bbe): Migrate callers to the new name and remove these. +#define TLS1_TXT_AES_128_GCM_SHA256 TLS1_3_RFC_AES_128_GCM_SHA256 +#define TLS1_TXT_AES_256_GCM_SHA384 TLS1_3_RFC_AES_256_GCM_SHA384 +#define TLS1_TXT_CHACHA20_POLY1305_SHA256 TLS1_3_RFC_CHACHA20_POLY1305_SHA256 #define TLS_CT_RSA_SIGN 1 #define TLS_CT_DSS_SIGN 2 diff --git a/ssl/ssl_cipher.cc b/ssl/ssl_cipher.cc index 79f33ee8c..7c4c034ac 100644 --- a/ssl/ssl_cipher.cc +++ b/ssl/ssl_cipher.cc @@ -264,7 +264,7 @@ static constexpr SSL_CIPHER kCiphers[] = { // Cipher 1301 { - TLS1_TXT_AES_128_GCM_SHA256, + TLS1_3_RFC_AES_128_GCM_SHA256, "TLS_AES_128_GCM_SHA256", TLS1_3_CK_AES_128_GCM_SHA256, SSL_kGENERIC, @@ -276,7 +276,7 @@ static constexpr SSL_CIPHER kCiphers[] = { // Cipher 1302 { - TLS1_TXT_AES_256_GCM_SHA384, + TLS1_3_RFC_AES_256_GCM_SHA384, "TLS_AES_256_GCM_SHA384", TLS1_3_CK_AES_256_GCM_SHA384, SSL_kGENERIC, @@ -288,7 +288,7 @@ static constexpr SSL_CIPHER kCiphers[] = { // Cipher 1303 { - TLS1_TXT_CHACHA20_POLY1305_SHA256, + TLS1_3_RFC_CHACHA20_POLY1305_SHA256, "TLS_CHACHA20_POLY1305_SHA256", TLS1_3_CK_CHACHA20_POLY1305_SHA256, SSL_kGENERIC,