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

TLS: BoGo tests update #4389

Merged
merged 4 commits into from
Oct 17, 2024
Merged

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Oct 17, 2024

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.

@reneme reneme added the enhancement Enhancement or new feature label Oct 17, 2024
@reneme reneme added this to the Botan 3.6.0 milestone Oct 17, 2024
@reneme reneme requested a review from randombit October 17, 2024 11:24
@reneme reneme self-assigned this Oct 17, 2024
The default implementation simply deserializes the passed public
key depending on the group identifier. By disentangling deserialization
and KEM-Encaps respectively KEX-Agreement we simplify the handling of
the Decoding_Error exception mapping it to TLS' illegal_parameter.

Also, I can see how this might be useful for downstream users that want
to use custom key pairs but don't want to re-implement the actual key
agreement mechanism.
Note that the block of 'LooseErrorTests' was previously handled by a
patch in the BoGo test code. For consistency, I marked them as "loose
errors" (aka. ignore reported TLS alert).
@randombit
Copy link
Owner

CI failures look relevant

@reneme
Copy link
Collaborator Author

reneme commented Oct 17, 2024

CI failures look relevant

Let's try again.

@@ -6,7 +6,7 @@


BORING_REPO = "https://github.com/randombit/boringssl.git"
BORING_BRANCH = "rene/runner-20240524"
BORING_BRANCH = "rene/runner-20241016"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config is duplicated thrice in the repository: I had said we should centralize this.

Suggestion:

Lets add a file in src/configs/repo_config.env that can contain such configurations. Side note: Personally, I'd probably add it as a root-level file (eg. .repo_config.env), but I remember that you wanted to keep the repo root as tidy as possible.

This file could then be consumed by .github/workflows/ci.yml and .../nightly.yml as well as here and (for now) just contain:

# the fork of boringssl that should be used for BoGo tests
BORINGSSL_REPO=https://github.com/randombit/boringssl.git

# the branch in our fork of boringssl that should be used for BoGo tests
BORINGSSL_BRANCH=rene/runner-20241016

We might have more such configuration that is worth to centralize like that. In any case: I'd do this adaption in an independent PR (likely after 3.6.0).

What are your thoughts on this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add a file in src/configs/repo_config.env that can contain such configurations.

Sure sounds good.

Side note: Personally, I'd probably add it as a root-level file (eg. .repo_config.env), but I remember that you wanted to keep the repo root as tidy as possible.

Indeed so. Thank you for accomodating my autistic needs on this topic.

@coveralls
Copy link

Coverage Status

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

@reneme reneme merged commit 2849ec7 into randombit:master Oct 17, 2024
38 checks passed
@reneme reneme deleted the tls/bogo_update branch October 17, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants