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

libressl 3.7.x doesn't support SSL_set0_wbio() #838

Open
orbea opened this issue Apr 11, 2023 · 1 comment
Open

libressl 3.7.x doesn't support SSL_set0_wbio() #838

orbea opened this issue Apr 11, 2023 · 1 comment

Comments

@orbea
Copy link

orbea commented Apr 11, 2023

When building keepalived-2.2.7 it fails because SSL_set0_wbio() is not implemented. Are there any plans for this function?

check_ssl.c: In function 'ssl_connect':
check_ssl.c:240:17: error: implicit declaration of function 'SSL_set0_wbio'; did you mean 'SSL_set0_rbio'? [-Werror=implicit-function-declaration]
  240 |                 SSL_set0_wbio(req->ssl, req->bio);
      |                 ^~~~~~~~~~~~~
      |                 SSL_set0_rbio

https://github.com/acassen/keepalived/blob/292b299e8bc4227b2380af7ee17ffceaca9f5a05/keepalived/check/check_ssl.c#L263

The issue is easy to workaround.

--- a/configure.ac
+++ b/configure.ac
@@ -1327,7 +1327,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 AC_CHECK_FUNCS([SSL_CTX_set_verify_depth])
 
 # SSL_set0_rbio(), SSL_set0_wbio() OPENSSL_init_crypto() and TLS_method() introduced OpenSSL v1.1.0
-AC_CHECK_FUNCS([SSL_set0_rbio OPENSSL_init_crypto TLS_method])
+AC_CHECK_FUNCS([SSL_set0_rbio SSL_set0_wbio OPENSSL_init_crypto TLS_method])
 
 # In OpenSSL v1.1.1 the call to SSL_CTX_new() fails if OPENSSL_init_crypto() has been called with
 # OPENSSL_INIT_NO_LOAD_CONFIG. It does not fail in v1.1.0h and v1.1.1b.
--- a/keepalived/check/check_ssl.c
+++ b/keepalived/check/check_ssl.c
@@ -234,7 +234,7 @@ ssl_connect(thread_ref_t thread, int new_req)
 		BIO_get_fd(req->bio, &bio_fd);
 		if (fcntl(bio_fd, F_SETFD, fcntl(bio_fd, F_GETFD) | FD_CLOEXEC) == -1)
 			log_message(LOG_INFO, "Setting CLOEXEC failed on ssl socket - errno %d", errno);
-#ifdef HAVE_SSL_SET0_RBIO
+#if defined HAVE_SSL_SET0_RBIO && defined HAVE_SSL_SET0_WBIO
 		BIO_up_ref(req->bio);
 		SSL_set0_rbio(req->ssl, req->bio);
 		SSL_set0_wbio(req->ssl, req->bio);

OpenSSL documentation: https://www.openssl.org/docs/man3.1/man3/SSL_set_bio.html

orbea added a commit to orbea/gentoo that referenced this issue May 4, 2023
This patch was accepted upstream and fixes the build with LibreSSL which
doesn't yet have the SSL_set0_wbio() function and this is solved by
adding a configure check.

Bug: https://bugs.gentoo.org/903001
Upstream-PR: acassen/keepalived#2124
Upstream-Commit: acassen/keepalived@bbec15d
Upstream-PR: acassen/keepalived#2130
Upstream-Commit: acassen/keepalived@5cb4030
Upstream-Issue: libressl/portable#838
Signed-off-by: orbea <orbea@riseup.net>
@orbea
Copy link
Author

orbea commented May 4, 2023

Upstream hid the issue in commits acassen/keepalived@bbec15d and acassen/keepalived@5cb4030.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue May 5, 2023
This patch was accepted upstream and fixes the build with LibreSSL which
doesn't yet have the SSL_set0_wbio() function and this is solved by
adding a configure check.

Bug: https://bugs.gentoo.org/903001
Upstream-PR: acassen/keepalived#2124
Upstream-Commit: acassen/keepalived@bbec15d
Upstream-PR: acassen/keepalived#2130
Upstream-Commit: acassen/keepalived@5cb4030
Upstream-Issue: libressl/portable#838
Signed-off-by: orbea <orbea@riseup.net>
Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants