[v2] Fix build with LibreSSL

Message ID 20190109111953.21581-1-stefan.strogin@gmail.com
State Accepted
Headers show
Series
  • [v2] Fix build with LibreSSL
Related show

Commit Message

Stefan Strogin Jan. 9, 2019, 11:19 a.m.
When using LibreSSL build fails with:

../src/crypto/tls_openssl.o: in function `tls_connection_client_cert':
../src/crypto/tls_openssl.c:2817: undefined reference to `SSL_use_certificate_chain_file'
collect2: error: ld returned 1 exit status
make: *** [Makefile:1901: wpa_supplicant] Error 1

There is no such function in LibreSSL.

Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
---
 src/crypto/tls_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen Jan. 12, 2019, 5:47 p.m. | #1
On Wed, Jan 09, 2019 at 01:19:53PM +0200, Stefan Strogin wrote:
> When using LibreSSL build fails with:
> 
> ../src/crypto/tls_openssl.o: in function `tls_connection_client_cert':
> ../src/crypto/tls_openssl.c:2817: undefined reference to `SSL_use_certificate_chain_file'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:1901: wpa_supplicant] Error 1
> 
> There is no such function in LibreSSL.

Thanks, applied.

Patch

diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index cb70e2c47..705fa29a3 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -2804,7 +2804,7 @@  static int tls_connection_client_cert(struct tls_connection *conn,
 		return 0;
 	}
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
 	if (SSL_use_certificate_chain_file(conn->ssl, client_cert) == 1) {
 		ERR_clear_error();
 		wpa_printf(MSG_DEBUG, "OpenSSL: SSL_use_certificate_chain_file"