-
Notifications
You must be signed in to change notification settings - Fork 33
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
Prepare 0.13.0 release with Rustls 0.23 #389
Conversation
Something seems up with the
|
Ah! 💡 It's |
Unrelated, but on my mind: #390 I'm not sure I understand why it makes sense to invest resources into the parallel cmake build infrastructure. |
Fixing this seems to require the addition of I thought the CI static libs test was meant to catch this. I'm also not sure why the base |
7a5a136
to
de0091b
Compare
I updated the git patch to pick up this change and was able to drop the CI changes adding |
This is related to rustls/rustls#1811 and rustls/rustls#1792 - the previous API swallowed alerts generated during I'm not sure the best way to represent this for the FFI boundary. One idea: the Any other ideas? |
I think an additional out parameter is the correct direction. But it needs to be an owned type with its own lifetime, so the C code can free it when done. If we ask the caller to provide a buffer as you're proposing, we run into problems like figuring out how big a buffer to allocate[1]. Since the Rust side is going to allocate a ChunkVecBuffer anyhow, we might as well use that. So this looks like
[1]: But thinking about it a second time: can we put a small upper bound on the size of the alert bytes? If so, that makes the problem of the output buffer less annoying. We could tell people to allocate a small array on the stack and simply write to that, avoiding complications of malloc'ing and so on. |
d031234
to
72795fb
Compare
Aha, that does making arranging things easier 👍
I ended up introducing a new crate-internal type on our side for this (
Other than the caveat about needing our own
I thought about this a little bit but the |
72795fb
to
e52a982
Compare
e52a982
to
731278a
Compare
I think this is ready for review now. (@ctz maybe you would be interested in giving it a once-over as well?) |
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.
rustls_accepted_alert
as a solution looks pretty nice to me.
731278a
to
f1dcfaa
Compare
f1dcfaa
to
a4d07d7
Compare
a4d07d7
to
17701a5
Compare
289c764
to
5b7b0ba
Compare
@jsha Are there any other changes you'd like to see in this branch? |
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.
Oops, I thought I had approved this. Thanks for the ping. Had one more small piece of feedback; with that addressed, consider this approved by me. Thanks!
Addresses upstream breaking API changes and updates associated Rustls dependencies to use the newest Rustls release. Most notable for rustls-ffi are the changes in the `rustls_acceptor_accept` and `rustls_accepted_into_connection` functions where a new `rustls_accepted_alert` out parameter is added. This type wraps the upstream `AcceptedAlert` type and allows the caller to gather any to-be-written TLS data (most notably, TLS alerts) that was produced while trying to accept the client connection. The caller should handle the to-be-written TLS bytes by calling `rustls_accepted_alert_write_tls` and providing a `rustls_write_callback` to handle writing the queued bytes to the connection before calling `rustls_accepted_alert_free`.
Many of the places where we used `set_boxed_mut_ptr` did not check that the `dest` pointer was not null, but `set_boxed_mut_ptr` says: `dst` must not be `NULL`. This commit introduces checks for each of the call-sites missing one.
5b7b0ba
to
f958a80
Compare
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.
Looks good!
Addresses upstream breaking API changes and updates associated Rustls dependencies to use the newest Rustls release.
Most notable for rustls-ffi are the changes in the
rustls_acceptor_accept
andrustls_accepted_into_connection
functions where a new
rustls_accepted_alert
out parameter is added.This type wraps the upstream
AcceptedAlert
type and allows the caller to gather any to-be-written TLS data (most notably, TLS alerts) that was produced while trying to accept the client connection. The caller should handle the to-be-written alert bytes by callingrustls_accepted_alert_write_tls
with therustls_accepted_alert
and arustls_write_callback
implementation to write the returned bytes to the connection before callingrustls_accepted_alert_free
.