Page MenuHomeFreeBSD

security/tor: Fix build with LibreSSL
Needs ReviewPublic

Authored by zirias on Dec 6 2023, 12:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 5:55 AM
Unknown Object (File)
Jan 11 2024, 10:52 AM
Unknown Object (File)
Jan 5 2024, 5:35 PM
Unknown Object (File)
Jan 4 2024, 1:39 AM
Subscribers
None

Details

Reviewers
yuri
Summary

LibreSSL doesn't support the ENGINE API and defines the
OPENSSL_NO_ENGINE feature flag, tor uses that feature flag, but misses
to include openssl/opensslconf.h which is necessary to pull in the
feature flags at least with LibreSSL, therefore add that include.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54847
Build 51736: arc lint + arc unit

Event Timeline

zirias created this revision.
security/tor/files/patch-src_lib_crypt__ops_crypto__openssl__mgt.c
12 ↗(On Diff #131065)

Doesn't this #endif statement break the original code structure?
The #else above it had some continuation, which is now differently conditioned.

security/tor/files/patch-src_lib_crypt__ops_crypto__openssl__mgt.c
12 ↗(On Diff #131065)

It certainly does, thanks a lot for spotting this massive brainfart. I must have misread the #else as an #endif. I'll do some more testing with the fixed logic first, to make sure I really only disable logging of what LibreSSL currently doesn't provide, then update the review accordingly.

zirias marked an inline comment as done.

Having another look was very helpful, turned out the few ENGINE_* calls LibreSSL *does* provide are just stubs returning NULL. Even code disabling engines based on the OPENSSL_NO_ENGINE feature flag was already there, it just didn't work because opensslconf.h was not included, which is necessary at least with LibreSSL to get the feature flags. This might even be a fix for upstream now ...