You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
tls_read
,tls_write
, and similar functions have three "error" return values.TLS_WANT_POLLIN
andTLS_WANT_POLLOUT
are correctly converted toErrorKind::WouldBlock
byrust-libtls
, but the generic -1 return value is not. Thetry_tls!
macro attempts to cast the return value tousize
if isn'tWANT_POLLIN
orWANT_POLLOUT
, which will overflow. The correct behavior would be to callTls::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.
The text was updated successfully, but these errors were encountered: