events: emit on_key_exchange_group event #2566
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Release Summary:
on_key_exchange_group
event to indicate the key exchange group negotiated during the TLS handshake. The event also indicates if a key encapsulation mechanism was part of the group by settingcontains_kem
to true.Resolved issues:
resolves #2523
Description of changes:
This change uses the new s2n-tls API added in aws/s2n-tls#5209 to emit a new event
on_key_exchange_group
to indicate the key exchange group negotiated during the TLS handshake. The event also indicates if a key encapsulation mechanism was part of the group by settingcontains_kem
to true.Call-outs:
rustls does not have a built in way to indicate if the named group contains a KEM, so I had to parse the string for
kem
. I can follow up with an issue or PR to rustls to add this functionalityI updated
#[cfg(s2n_quic_enable_pq_tls)] static DEFAULT_POLICY: &s2n_tls::security::Policy
as the existingTESTING_PQ
policy is deprecated and no longer builds.rustls uses capitalization for named groups that differs from the IANA specification (X25519 for example), so I'm ignoring capilization in the
PartialEq
impl:Testing:
Updated existing tests
Observed example code emitting the event:
0.034798792s s2n_quic:client:conn: key_exchange_group: chosen_group_name="X25519MLKEM768" contains_kem=true id=0
9.003157875s s2n_quic:server:conn: key_exchange_group: chosen_group_name="X25519MLKEM768" contains_kem=true id=0
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.