sfackler / rust-openssl

OpenSSL bindings for Rust
1.38k stars 740 forks source link

Exposing low level header defines of OpenSSL in the sys crate #1410

Open Kimundi opened 3 years ago

Kimundi commented 3 years ago

Hi, I'm trying to port some C code that work with OpenSSL defines like this, which seem to not be exposed by openssl-sys.

As I'm unfamiliar with OpenSSL and rust-openssl in general, especially their internal structure, and also have never worked with creating FFI bindings directly, I'm wondering:

What I've figured out so far is that openssl-src has a weak-crypto feature flag that I'll probably need, and that I succesfully propagated up to openssl-sys. (I'm using the vendored feature for now)

sfackler commented 3 years ago

OpenSSL's API surface area is roughly infinite, so missing bindings are just because no-one's implemented them yet. PRs welcomed.

Kimundi commented 3 years ago

Alright! I had assumed the OpenSSL-sys bindings where automatically generated by bindgen or something similar - is it all just manual transcription of header files?

sfackler commented 3 years ago

It is yeah since we need to support a pretty wide range of versions and feature flags.