randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 570 forks source link

TLS: BoGo tests update #4389

Closed reneme closed 1 month ago

reneme commented 1 month ago

This updates the BoGo test suilte to boringssl's trunk of yesterday. This includes two noteworthy changes:

  1. Addition of test cases that use X25516/ML-KEM-768 for key exchange (its usage is disabled in this pull request and will be enabled later)
  2. More specific tests regarding sanity checks and error handling of the key exchange

The latter required a minor refactoring in TLS::Callbacks where I disentangled public key deserialization and KEM-Encaps respectively KEX-Agree. TLS::Callbacks::tls_deserialize_peer_public_key() now handles the plain serialization while the pre-existing tls_kem_encapsulate() and tls_ephemeral_key_agreement() perform error re-mapping and the actual usage of the keys. Certain users may benefit from the new callback when the want to introduce custom deserialization logic but want to rely on the standard implementation of key exchange. See the updated example.

Also, a few tweaks in TLS alert usage were needed to fulfill the new tests.

randombit commented 1 month ago

CI failures look relevant

reneme commented 1 month ago

CI failures look relevant

Let's try again.

coveralls commented 1 month ago

Coverage Status

coverage: 91.14% (+0.02%) from 91.125% when pulling c23a012588cba021854610313cffe35d2e7c2310 on Rohde-Schwarz:tls/bogo_update into e70e1bfe2e21d3845c3611c88dab1d18a15f86e3 on randombit:master.