Skip to content

Commit 9f3de9b

Browse files
Clarify comments and API behaviour for equal-preference for TLS 1.3 (#2873)
The algorithm used to compute the negotiated cipher suite in TLS 1.3 is different than the one used for the older versions. Clarify what this means for equal-preference groups.
1 parent 0336dd7 commit 9f3de9b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/openssl/ssl.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,8 +1769,8 @@ OPENSSL_EXPORT size_t SSL_get_all_standard_cipher_names(const char **out,
17691769
// The |DEFAULT| directive, when appearing at the front of the string, expands
17701770
// to the default ordering of available ciphers.
17711771
//
1772-
// If configuring a server, one may also configure equal-preference groups to
1773-
// partially respect the client's preferences when
1772+
// For TLS < 1.3, if configuring a server, one may also configure
1773+
// equal-preference groups to partially respect the client's preferences when
17741774
// |SSL_OP_CIPHER_SERVER_PREFERENCE| is enabled. Ciphers in an equal-preference
17751775
// group have equal priority and use the client order. This may be used to
17761776
// enforce that AEADs are preferred but select AES-GCM vs. ChaCha20-Poly1305
@@ -1781,10 +1781,6 @@ OPENSSL_EXPORT size_t SSL_get_all_standard_cipher_names(const char **out,
17811781
//
17821782
// Once an equal-preference group is used, future directives must be
17831783
// opcode-less. Inside an equal-preference group, spaces are not allowed.
1784-
//
1785-
// Note: TLS 1.3 ciphersuites are only configurable via
1786-
// |SSL_CTX_set_ciphersuites| or |SSL_set_ciphersuites|. Other setter functions have
1787-
// no impact on TLS 1.3 ciphersuites.
17881784

17891785
// SSL_DEFAULT_CIPHER_LIST is the default cipher suite configuration. It is
17901786
// substituted when a cipher string starts with 'DEFAULT'.
@@ -1843,6 +1839,8 @@ OPENSSL_EXPORT int SSL_set_ciphersuites(SSL *ssl, const char *str);
18431839
// |ssl->config->tls13_cipher_list| and otherwise falling back to
18441840
// |ssl->ctx->tls13_cipher_list|.
18451841
//
1842+
// Equal-preference groups cannot be configured for TLS 1.3 through these APIs.
1843+
//
18461844
// It returns one on success and zero on failure.
18471845
//
18481846
// Prefer to use |SSL_set_strict_cipher_list|. This function tolerates garbage

ssl/internal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,9 @@ BSSL_NAMESPACE_BEGIN
668668
// picks the cipher and groups cannot be expressed on the wire. However, for
669669
// servers, the equal-preference groups allow the client's preferences to be
670670
// partially respected. (This only has an effect with
671-
// SSL_OP_CIPHER_SERVER_PREFERENCE).
671+
// SSL_OP_CIPHER_SERVER_PREFERENCE). Note that the method used to compute the
672+
// negotiated cipher suite in TLS 1.3 does not use the equal-preference
673+
// data structure described below.
672674
//
673675
// The equal-preference groups are expressed by grouping SSL_CIPHERs together.
674676
// All elements of a group have the same priority: no ordering is expressed

0 commit comments

Comments
 (0)