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

io::Read and io::Write implementations don't handle errors correctly #5

Open
olivia-fl opened this issue Nov 30, 2020 · 0 comments
Open

Comments

@olivia-fl
Copy link

tls_read, tls_write, and similar functions have three "error" return values. TLS_WANT_POLLIN and TLS_WANT_POLLOUT are correctly converted to ErrorKind::WouldBlock by rust-libtls, but the generic -1 return value is not. The try_tls! macro attempts to cast the return value to usize if isn't WANT_POLLIN or WANT_POLLOUT, which will overflow. The correct behavior would be to call Tls::last_error if the return value is -1.

I'm currently working on a PR to update this library to tokio 0.3 and fix some issues with the async implementation, but once I'm done with that I can write a PR to fix this.

@olivia-fl olivia-fl changed the title io::Read and io::Write implementations don't handle errors correctly io::Read and io::Write implementations don't handle errors correctly Nov 30, 2020
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

No branches or pull requests

1 participant