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

#if defined(LIBRESSL_VERSION_NUMBER) #2198

Closed
botovq opened this issue May 4, 2021 · 2 comments
Closed

#if defined(LIBRESSL_VERSION_NUMBER) #2198

botovq opened this issue May 4, 2021 · 2 comments
Labels
Component: mosquitto-clients Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@botovq
Copy link

botovq commented May 4, 2021

lib/options.c currently has two #if defined(LIBRESSL_VERSION_NUMBER) code paths.

mosquitto/lib/options.c

Lines 397 to 400 in d5ecd9f

#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
SSL_CTX_up_ref(mosq->ssl_ctx);
#else
CRYPTO_add(&(mosq->ssl_ctx)->references, 1, CRYPTO_LOCK_SSL_CTX);

and

mosquitto/lib/options.c

Lines 505 to 506 in d5ecd9f

#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
SSL_CTX_up_ref(mosq->ssl_ctx);

This is to avoid using SSL_CTX_up_ref() that presumably was not available at the time of writing the code.
This function has been available since LibreSSL 2.7.0 and is thus available in all supported versions (currently 3.2.x and 3.3.x).

It would be nice if these && !defined(LIBRESSL_VERSION_NUMBER) could be removed, as in LibreSSL 3.4.x the SSL_CTX will become opaque, so the build will break.

Concerning the remaining two !defined(LIBRESSL_VERSION_NUMBER) paths in the source, the SSL_CTX_set_ciphersuites() function will become available in LibreSSL 3.4.x, so it would be nice if those could be weakened to
&& (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER > 0x3040000fL).

@ralight
Copy link
Contributor

ralight commented May 4, 2021

Thanks for the hints!

@ralight ralight added this to the 2.0.12 milestone Aug 22, 2021
@ralight ralight added Component: mosquitto-clients Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug labels Aug 22, 2021
@ralight ralight added Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. and removed Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. labels Aug 24, 2021
@ralight
Copy link
Contributor

ralight commented Aug 24, 2021

This will be in 2.0.12 shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: mosquitto-clients Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants