-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
expose export_keying_material from rustls #850
Conversation
(test failures expected until rustls is updated) |
Let's make it part of |
this is necessary for export_keying_material to work; can be undone once rustls pushes a new version of the crates.
OK, pushed the following:
All tests pass on my machine. |
Looks pretty good to me. I'm a bit on the fence about the associated error type, which seems overly specific, but I haven't thought of a great alternative yet. @Ralith, what do you think of these patches? (FYI, I think all of these commits can be squashed, since they're largely not independent.) |
I suppose the alternative is to conver that error into... a TransportError, maybe? Happy to squash. Would you like me to do it now, or after @Ralith reviews? Also, should I leave the edits to the Cargo.toml files in a separate commit to make them easier to revert? |
Squashing isn't urgent, I can do it when merging to master, too. I think we can leave the edits to Cargo.toml files, we've done it before for other upstream changes we wanted. |
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.
Apologies for the delay weighing in here. The error question is interesting. It looks like rustls only generates an error if too much data is requested (see https://github.com/ctz/rustls/blob/main/rustls/src/key_schedule.rs#L362). If we can't think of any other possible errors, I'd prefer to just bake in that semantic (either with an error ZST or just by using Option
) and avoid the associated type.
Thanks for the review, @Ralith! I've addressed your comments other than the one about the error. As far as I can tell you're right about the error. Would you like me to remove the associated type and create a zero-sized |
Yup, that sounds right. |
👍 done! |
LGTM! |
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.
CI failure looks spurious.
This PR adds support for the export_keying_material method from rustls. Specifically:
adds a trait,
proto::crypto::ExportKeyingMaterial
, that can be implemented on aproto::crypto::Session
. I did this rather than implement it as part ofSession
because future crypto impls might not provide this functionality. Of course, can move it toSession
if that would be better.implements
ExportKeyingMaterial
forproto::crypto::rustls::TlsSession
, which calls the corresponding method on the rustlsSession
object.implements
export_keying_material
method onquinn::Connection<S> where S: ExportKeyingMaterial
, which is just plumbing.tests
export_keying_material
in bothproto
andquinn
.To test this, you'll need to point to the current main branch of rustls in quinn and quinn-proto. You'll also need to point to a local copy of rustls-native-certs that pulls in the main branch of rustls.
Merging this is blocked on rustls and rustls-native-certs updating.
closes #834