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.
tls_read,tls_write, and similar functions have three "error" return values.TLS_WANT_POLLINandTLS_WANT_POLLOUTare correctly converted toErrorKind::WouldBlockbyrust-libtls, but the generic -1 return value is not. Thetry_tls!macro attempts to cast the return value tousizeif isn'tWANT_POLLINorWANT_POLLOUT, which will overflow. The correct behavior would be to callTls::last_errorif 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.