-
Notifications
You must be signed in to change notification settings - Fork 120
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
feat(events): Add cipher suite to TLS Session in the TlsExporterReady event #2070
Conversation
quic/s2n-quic-tls/src/session.rs
Outdated
@@ -88,6 +88,14 @@ impl tls::TlsSession for Session { | |||
.tls_exporter(label, context, output) | |||
.map_err(|_| tls::TlsExportError::failure()) | |||
} | |||
|
|||
fn cipher_suite(&self) -> CipherSuite { | |||
if let Ok(cipher_suite) = self.connection.cipher_suite() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems better to store the expected cipher suite on the session state, rather than parsing it from the connection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to make sure I'm understanding, that would be done inside of on_secret
in callback.rs
by changing fn get_algo_type
to also return the cipher suite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's what i was thinking
@@ -40,6 +43,8 @@ pub trait TlsSession: Send { | |||
context: &[u8], | |||
output: &mut [u8], | |||
) -> Result<(), TlsExportError>; | |||
|
|||
fn cipher_suite(&self) -> CipherSuite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to return Unknown rather than an error
Description of changes:
#1984 added the ability to export symmetric keys negotiated during the QUIC handshake by adding an
on_tls_exporter_ready
event. This change addscipher_suite()
to the TLS session exposed as part of the event for use when using the exported keys.Call-outs:
I use
CipherSuite::Unknown
in place of returning an error, it seemed a little more user friendly and I wasn't sure the error would be usefulTesting:
Updated the exporter integration test to confirm the client and server ciphersuites are the same and neither of them are unknown
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.