3 ms·
> You're never sure at a glance what's an input or an output parameter, what needs to be freed and how you're supposed to free it. Terrifying; would a more fun
by andy_ppp 9y ago
> You're never sure at a glance what's an input or an output parameter, what needs to be freed and how you're supposed to free it.
Terrifying; would a more functional style of programming help here?
- dom0 9y agoProper API design and documentation would be quite sufficient, breaking and expensive.
- simias 9y agoUsing "const" consistently would be a good start. Better and more thorough docs would be nice as well. If you're willing to break everything a more consistent API in general, especially when it comes to error handling, would make it less easy to shoot yourself in the foot. It's the overall inconsistency of the OpenSSL API that's the main issue IMO. If the coder or code reviewer don't know all the function signatures and return values by heart it's very easy to write code that looks absolutely fine, might seem to run fine but is thoroughly broken. TFA is a good example of that. That's why nowadays I much prefer using the Rust bindings over the raw C library. The error handling and ownership rules are checked by the compiler, it's like putting blanks in your footgun. It's liberating really.
- ianai 9y agoMaybe a wrapper API for OpenVPN/SSL that attempts to Do It Rightunder the hood would be worthwhile?