|
|
@@ -16,9 +16,9 @@ Signed-off-by: Eneas U de Queiroz <[email protected]>
|
|
|
|
|
|
--- a/ssl/ssl_ciph.c
|
|
|
+++ b/ssl/ssl_ciph.c
|
|
|
-@@ -1488,11 +1488,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
|
|
|
+@@ -1471,11 +1471,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
|
|
|
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
|
|
|
- &tail);
|
|
|
+ &tail);
|
|
|
|
|
|
+ /*
|
|
|
+ * If OPENSSL_PREFER_CHACHA_OVER_GCM is defined, ChaCha20_Poly1305
|
|
|
@@ -33,20 +33,20 @@ Signed-off-by: Eneas U de Queiroz <[email protected]>
|
|
|
+
|
|
|
+#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
|
|
|
+ ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
|
|
|
-+ &head, &tail);
|
|
|
++ &head, &tail);
|
|
|
+ ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
|
|
|
-+ &head, &tail);
|
|
|
++ &head, &tail);
|
|
|
+#else
|
|
|
/* Within each strength group, we prefer GCM over CHACHA... */
|
|
|
ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
|
|
|
- &head, &tail);
|
|
|
+ &head, &tail);
|
|
|
ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
|
|
|
- &head, &tail);
|
|
|
+ &head, &tail);
|
|
|
+#endif
|
|
|
|
|
|
/*
|
|
|
* ...and generally, our preferred cipher is AES.
|
|
|
-@@ -1547,7 +1565,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
|
|
|
+@@ -1530,7 +1548,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
|
|
|
* Within each group, ciphers remain sorted by strength and previous
|
|
|
* preference, i.e.,
|
|
|
* 1) ECDHE > DHE
|
|
|
@@ -55,7 +55,7 @@ Signed-off-by: Eneas U de Queiroz <[email protected]>
|
|
|
* 3) AES > rest
|
|
|
* 4) TLS 1.2 > legacy
|
|
|
*
|
|
|
-@@ -2246,7 +2264,13 @@ const char *OSSL_default_cipher_list(voi
|
|
|
+@@ -2232,7 +2250,13 @@ const char *OSSL_default_cipher_list(voi
|
|
|
*/
|
|
|
const char *OSSL_default_ciphersuites(void)
|
|
|
{
|
|
|
@@ -71,22 +71,22 @@ Signed-off-by: Eneas U de Queiroz <[email protected]>
|
|
|
}
|
|
|
--- a/include/openssl/ssl.h.in
|
|
|
+++ b/include/openssl/ssl.h.in
|
|
|
-@@ -199,9 +199,15 @@ extern "C" {
|
|
|
+@@ -201,9 +201,15 @@ extern "C" {
|
|
|
* DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites()
|
|
|
* Update both macro and function simultaneously
|
|
|
*/
|
|
|
--# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
|
|
-- "TLS_CHACHA20_POLY1305_SHA256:" \
|
|
|
-- "TLS_AES_128_GCM_SHA256"
|
|
|
-+# ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
|
|
|
-+# define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
|
|
|
-+ "TLS_AES_256_GCM_SHA384:" \
|
|
|
-+ "TLS_AES_128_GCM_SHA256"
|
|
|
-+# else
|
|
|
-+# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
|
|
-+ "TLS_CHACHA20_POLY1305_SHA256:" \
|
|
|
-+ "TLS_AES_128_GCM_SHA256"
|
|
|
-+# endif
|
|
|
- # endif
|
|
|
+-#define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
|
|
+- "TLS_CHACHA20_POLY1305_SHA256:" \
|
|
|
+- "TLS_AES_128_GCM_SHA256"
|
|
|
++#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
|
|
|
++ #define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
|
|
|
++ "TLS_AES_256_GCM_SHA384:" \
|
|
|
++ "TLS_AES_128_GCM_SHA256"
|
|
|
++#else
|
|
|
++ #define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
|
|
++ "TLS_CHACHA20_POLY1305_SHA256:" \
|
|
|
++ "TLS_AES_128_GCM_SHA256"
|
|
|
++#endif
|
|
|
+ #endif
|
|
|
/*
|
|
|
* As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
|