Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL_get_ciphers() lacks TLSv1.3 ciphersuites #1638

Open
wlallemand opened this issue Jun 17, 2024 · 3 comments
Open

SSL_get_ciphers() lacks TLSv1.3 ciphersuites #1638

wlallemand opened this issue Jun 17, 2024 · 3 comments

Comments

@wlallemand
Copy link

wlallemand commented Jun 17, 2024

Hello,

Problem:

I'm porting the HAProxy client_hello callback that is used with OpenSSL to the select_certificate equivalent in AWS-LC, in order to enable more features in HAProxy and activate more reg-tests. Our callback is using the SSL_get_ciphers() function to compare the ciphers from the server side to the ciphers from the clienthello.

The SSL_get_ciphers() functions does not seems to return any TLS 1.3 ciphersuites even if they are used unlike the SSL_get_ciphers() function from OpenSSL.

Attached a simple server example to reproduce:

Building with aws-lc: gcc server.c -DUSE_AWSLC -I/opt/awslc-1.29.0/include/ -o server -L/opt/awslc-1.29.0/lib/ -lssl -lcrypto -Wl,-rpath,/opt/awslc-1.29.0/lib/
Building with OpenSSL: gcc server.c -o server -lssl -lcrypto

server.c.txt

Output with openssl 3.0.13:

./server server.crt server.key

sslecho : Simple Echo Client/Server : Jun 17 2024 : 11:43:50

We are the server on port: 4433
Client TCP connection accepted
TLS_AES_256_GCM_SHA384
TLS_CHACHA20_POLY1305_SHA256
TLS_AES_128_GCM_SHA256
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-RSA-AES256-GCM-SHA384
DHE-RSA-AES256-GCM-SHA384
ECDHE-ECDSA-CHACHA20-POLY1305
ECDHE-RSA-CHACHA20-POLY1305
DHE-RSA-CHACHA20-POLY1305
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-RSA-AES128-GCM-SHA256
DHE-RSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES256-SHA384
ECDHE-RSA-AES256-SHA384
DHE-RSA-AES256-SHA256
ECDHE-ECDSA-AES128-SHA256
ECDHE-RSA-AES128-SHA256
DHE-RSA-AES128-SHA256
ECDHE-ECDSA-AES256-SHA
ECDHE-RSA-AES256-SHA
DHE-RSA-AES256-SHA
ECDHE-ECDSA-AES128-SHA
ECDHE-RSA-AES128-SHA
DHE-RSA-AES128-SHA
RSA-PSK-AES256-GCM-SHA384
DHE-PSK-AES256-GCM-SHA384
RSA-PSK-CHACHA20-POLY1305
DHE-PSK-CHACHA20-POLY1305
ECDHE-PSK-CHACHA20-POLY1305
AES256-GCM-SHA384
PSK-AES256-GCM-SHA384
PSK-CHACHA20-POLY1305
RSA-PSK-AES128-GCM-SHA256
DHE-PSK-AES128-GCM-SHA256
AES128-GCM-SHA256
PSK-AES128-GCM-SHA256
AES256-SHA256
AES128-SHA256
ECDHE-PSK-AES256-CBC-SHA384
ECDHE-PSK-AES256-CBC-SHA
SRP-RSA-AES-256-CBC-SHA
SRP-AES-256-CBC-SHA
RSA-PSK-AES256-CBC-SHA384
DHE-PSK-AES256-CBC-SHA384
RSA-PSK-AES256-CBC-SHA
DHE-PSK-AES256-CBC-SHA
AES256-SHA
PSK-AES256-CBC-SHA384
PSK-AES256-CBC-SHA
ECDHE-PSK-AES128-CBC-SHA256
ECDHE-PSK-AES128-CBC-SHA
SRP-RSA-AES-128-CBC-SHA
SRP-AES-128-CBC-SHA
RSA-PSK-AES128-CBC-SHA256
DHE-PSK-AES128-CBC-SHA256
RSA-PSK-AES128-CBC-SHA
DHE-PSK-AES128-CBC-SHA
AES128-SHA
PSK-AES128-CBC-SHA256
PSK-AES128-CBC-SHA
Client SSL connection accepted

Output with AWS-LC 1.29.0:

./server server.crt server.key

sslecho : Simple Echo Client/Server : Jun 17 2024 : 11:44:39

We are the server on port: 4433

Client TCP connection accepted
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-RSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-RSA-AES256-GCM-SHA384
ECDHE-ECDSA-CHACHA20-POLY1305
ECDHE-RSA-CHACHA20-POLY1305
ECDHE-PSK-CHACHA20-POLY1305
ECDHE-ECDSA-AES128-SHA
ECDHE-RSA-AES128-SHA
ECDHE-RSA-AES128-SHA256
ECDHE-PSK-AES128-CBC-SHA
ECDHE-ECDSA-AES256-SHA
ECDHE-RSA-AES256-SHA
ECDHE-RSA-AES256-SHA384
ECDHE-PSK-AES256-CBC-SHA
AES128-GCM-SHA256
AES256-GCM-SHA384
AES128-SHA
AES128-SHA256
PSK-AES128-CBC-SHA
AES256-SHA
PSK-AES256-CBC-SHA
Client SSL connection accepted

Solution:

SSL_get_ciphers() should maybe return the content of both ssl->ctx->tls13_cipher_list.get() and ssl->ctx->cipher_list->ciphers.get() instead of only the later.

haproxy-mirror pushed a commit to haproxy/haproxy that referenced this issue Jun 17, 2024
…ration

SSL_get_ciphers() in AWS-LC seems to lack the TLSv1.3 ciphersuites,
which break the ECDSA key selection when doing TLSv1.3.

An issue was opened aws/aws-lc#1638

Indeed, in ssl_sock_switchctx_cbk(), the sigalgs is used to determine if
ECDSA is doable or not, then the function compares the list of ciphers in
the clienthello with the list of configured ciphers.

The fix solves the issue by never skipping the TLSv1.3 ciphersuites,
even if they are not in SSL_get_ciphers().
haproxy-mirror pushed a commit to haproxy/haproxy that referenced this issue Jun 17, 2024
…ration

SSL_get_ciphers() in AWS-LC seems to lack the TLSv1.3 ciphersuites,
which break the ECDSA key selection when doing TLSv1.3.

An issue was opened aws/aws-lc#1638

Indeed, in ssl_sock_switchctx_cbk(), the sigalgs is used to determine if
ECDSA is doable or not, then the function compares the list of ciphers in
the clienthello with the list of configured ciphers.

The fix solves the issue by never skipping the TLSv1.3 ciphersuites,
even if they are not in SSL_get_ciphers().
@nebeid
Copy link
Contributor

nebeid commented Jun 20, 2024

Thank you, William @wlallemand, for bringing the issue to our attention and proposing a solution. We’ll take some time to see if we can implement it as requested.

@andrewhop
Copy link
Contributor

Internal tracking CryptoAlg-2559.

@tonychen2001
Copy link

tonychen2001 commented Aug 14, 2024

Noticed the same with SSL_get_cipher_list() which just calls SSL_get_ciphers().

The MySQL Ssl_cipher_list status variable is missing TLS v1.3 cipher suites when using AWS-LC

Noticed this ToDo about merging TLS v1.3 ciphersuites into ssl->ctx->cipher_list which would be similar to OpenSSL's implementation: https://github.com/openssl/openssl/blob/master/ssl/ssl_ciph.c#L1388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants