reyk / rust-libtls

Rust bindings for LibreSSL's libtls library.
Other
15 stars 4 forks source link

Failing to call `configure` results in a segfault #2

Open Benjamin-L opened 4 years ago

Benjamin-L commented 4 years ago

The current safe API allows the library user to cause a segfault by trying to use Tls::connect without calling Tls::configure first. I'm not sure what the best design to avoid this is, but it caused me a lot of trouble when I didn't realize that Tls::reset also removes the config. Ideally the safe api exposed in the rust bindings would prevent this type of use at compile time.

reyk commented 4 years ago

You’re right, thanks for the report. I want to stay close to the libtls API but such unsafe behavior should be avoided with an internal state.