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

Add uninit read methods and switch to _ex when possible #2117

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

sfackler
Copy link
Owner

@sfackler sfackler commented Dec 4, 2023

Downstream crates like tokio-openssl and hyper-openssl currently create possibly-uninitialized slices to feed to SslStream::read which is not formally sound. Since std's ReadBuf type isn't yet stable, this PR adds methods that take &mut [MaybeUninit<u8>] slices instead, and provide guarantees about the state after the call in documentation.

I also switched over to the _ex variants of the core OpenSSL IO functions where possible since it avoids issues around ambiguous handling of empty buffers and int-sized length parameters.

@sfackler sfackler requested a review from alex December 4, 2023 01:16
@sfackler sfackler merged commit 61c4acd into master Dec 5, 2023
53 checks passed
@sfackler sfackler deleted the maybe-uninit branch December 5, 2023 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants