[MDEV-26399] Client may use different SSL/TLS cipher than the one requested with --ssl-cipher when using TLSv1.3 Created: 2021-08-18  Updated: 2021-08-23  Resolved: 2021-08-23

Status: Closed
Project: MariaDB Server
Component/s: SSL
Affects Version/s: 10.5.12
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

Ubuntu 20.04, OpenSSL



 Description   

The documentation suggests that when requesting a specific cipher to be used with

mysql ... --ssl-cipher=...

the connection will either use one of the explicitly listed ciphers, or fail.

When the client tries to connect using TLSv1.3 it always adds the following three ciphers to the cipher list in its TLS "Client Hello" packet though:

  • TLS_AES_256_GCM_SHA384
  • TLS_CHACHA20_POLY1305_SHA256
  • TLS_AES_128_GCM_SHA256

and the server picks TLS_AES_256_GCM_SHA384 as the next best option if the originally requested cipher is not supported by it.

So client and server use a totally different cipher than the one explicitly requested without failing, or otherwise complaining about this at all.

As far as I remember this auto-adding of the three extra ciphers may actually be documented, or even required, TLSv1.3 behavior, but I can't find right now where I have read about this.

If this is the case we may only need to change the documentation to say that in case of TLSv1.3 a different cipher may be chosen instead of failing when the requested cipher is not available.

Otherwise, as the actual addition of extra ciphers seems to be done by OpenSSL, not our client code, the client should explicitly check whether the cipher being used matches the one, or one of those, requested with --ssl-cipher, and terminate the connection with an error message if this is not the case even when an encrypted connection could be established.



 Comments   
Comment by Sergei Golubchik [ 2021-08-23 ]

https://mariadb.com/kb/en/using-tlsv13/

... OpenSSL developers decided that TLSv1.3 cipher suites should not be affected by the normal cipher-selecting API. This means that ssl_cipher system variable has no effect on the TLSv1.3 cipher suites

Comment by Sergei Golubchik [ 2021-08-23 ]

https://mariadb.com/kb/en/ssltls-system-variables/#ssl_cipher

Note that the TLSv1.3 ciphers cannot be excluded when using OpenSSL, even by using this system variable

Generated at Thu Feb 08 09:45:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.