Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto_passwd.c: problematic use of OPENSSL_API_COMPAT #2944

Open
dirkfeytons opened this issue Nov 7, 2023 · 0 comments
Open

mosquitto_passwd.c: problematic use of OPENSSL_API_COMPAT #2944

dirkfeytons opened this issue Nov 7, 2023 · 0 comments

Comments

@dirkfeytons
Copy link

According to https://www.openssl.org/docs/man3.1/man7/OPENSSL_API_COMPAT.html the OPENSSL_API_COMPAT macro is expected to be set by the user on the compiler command line or at the top of a source file before any OpenSSL header is included.
The way it's used at

#if OPENSSL_VERSION_NUMBER < 0x10100000L || OPENSSL_API_COMPAT < 0x10100000L
can lead to an undesired build error: since OPENSSL_API_COMPAT is not defined in a standard Mosquitto build, the condition OPENSSL_API_COMPAT < 0x10100000L in the code will evaluate to true and the call to OpenSSL_add_all_digests() is included. However, when OpenSSL is built with no-deprecated then this symbol does not exist and the build fails.

The check should simply be removed from the code; only checking for OPENSSL_VERSION_NUMBER < 0x10100000L is sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant