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

[Bug]: wolfSSL QUIC handshake failure #7390

Closed
icing opened this issue Apr 3, 2024 · 4 comments · Fixed by #7465
Closed

[Bug]: wolfSSL QUIC handshake failure #7390

icing opened this issue Apr 3, 2024 · 4 comments · Fixed by #7465
Assignees
Labels

Comments

@icing
Copy link
Contributor

icing commented Apr 3, 2024

Contact Details

[email protected]

Version

all

Description

As reported in ngtcp2/ngtcp2#1193. Fixing the returned ciper in

evp_cipher = wolfSSL_EVP_aes_128_ctr();

from wolfSSL_EVP_aes_128_ctr to wolfSSL_EVP_aes_128_ccm fixes the assertion failure, but handshake still fails for some reason.

Reproduction steps

No response

Relevant log output

No response

@nbars
Copy link

nbars commented Apr 4, 2024

Hey,

Does this mean that instead of using the CCM mode, the CTR mode was always used?

@julek-wolfssl julek-wolfssl linked a pull request Apr 24, 2024 that will close this issue
@julek-wolfssl
Copy link
Member

Hi @icing

I cleaned up the EVP layer usage in quic in a PR here: #7465. Thanks for the report.

Juliusz

@icing
Copy link
Contributor Author

icing commented Apr 26, 2024

QUIC handshake is now failing in tests at ngtcp2 and curl CI. Easiest to reproduce probably in ngtcp2.

Build https://github.com/ngtcp2/ngtcp2 as in the instructions with wolfssl and another tls lib (openssl-quictls or gnutls or boring). Run pytest:

> pytest -v -k test_01
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[quictls-quictls] PASSED                                                                                                     [  6%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[quictls-boringssl] PASSED                                                                                                   [ 12%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[quictls-picotls] PASSED                                                                                                     [ 18%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[quictls-wolfssl] FAILED                                                                                                     [ 25%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[boringssl-quictls] PASSED                                                                                                   [ 31%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[boringssl-boringssl] PASSED                                                                                                 [ 37%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[boringssl-picotls] PASSED                                                                                                   [ 43%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[boringssl-wolfssl] FAILED                                                                                                   [ 50%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[picotls-quictls] PASSED                                                                                                     [ 56%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[picotls-boringssl] PASSED                                                                                                   [ 62%]
examples/tests/test_01_handshake.py::TestHandshake::test_01_01_get[picotls-picotls] PASSED                                                                                                     [ 68%]
...

You see that wolfssl can only connect if it is used in client and server. The problem seems to be cipher selection as in the logs you'll see ` pkt packet has incorrect reserved bits...pkt could not decrypt packet payload"

@julek-wolfssl
Copy link
Member

#7477 will fix that. My previous commit was wrongly assuming what wolfSSL_quic_get_hp is returning. It would be nice for ngtcp2_crypto_hp_mask to include an explanation why CTR is necessary instead of ECB for AES.

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

Successfully merging a pull request may close this issue.

3 participants