On Mon, May 29, 2023 at 01:59:31PM -0400, Sven F. wrote: > could you guys push something like > > -#ifdef USE_OPENSSL_1_1_API > +#if defined(USE_OPENSSL_1_1_API) && !defined(LIBRESSL_VERSION_NUMBER) > > so OPENSSL_malloc_init() is not use with other ssl libs ?
You probably found this patch in the OpenBSD ports tree. It is not supposed to be upstreamed like this. Spraying around more #ifdefs won't improve the situation in the long term. It is a quick hack that fixes the build on OpenBSD but it is a bad approach for upstream code because upstream would now hardcode not just one, but two specific SSL libraries. While other SSL libraries which provide compatible interfaces exist. There is already a better fix in the queue which detects these interfaces in a vendor-neutral fashion. Serf will then use OPENSSL_malloc_init() only if this function exists. Serf shouldn't have to care whether this function really comes from OpenSSL 1.1 or from some other implementation or version. Standard configure scripts have worked this way for years. As an analogy, nobody cares whether malloc() comes from glibc or musl or another C library, for good reasons. OpenSSL is a de-facto standard API and it should thus be treated in the same responsible way as other standard libraries. And in any case, it is too late to merge more changes into this release.