]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
LibreSSL: Fix build with LibreSSL versions older than 2.9.1
authorJouni Malinen <j@w1.fi>
Sat, 22 Aug 2020 08:32:01 +0000 (11:32 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 22 Aug 2020 08:32:01 +0000 (11:32 +0300)
SSL_add0_chain_cert() was not available in LibreSSL before version
2.9.1.

Fixes: 4b834df5e08a ("OpenSSL: Support PEM encoded chain from client_cert blob")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/crypto/tls_openssl.c

index 0f9664ec5bccddba4ae91b1be03f0019c197ef45..e73dd7f5b4755ad6643dc17ad97dd2d6429c19fe 100644 (file)
@@ -3252,6 +3252,10 @@ static int tls_connection_client_cert(struct tls_connection *conn,
                           "OK");
                return 0;
        } else if (client_cert_blob) {
+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20901000L
+               tls_show_errors(MSG_DEBUG, __func__,
+                               "SSL_use_certificate_ASN1 failed");
+#else
                BIO *bio;
                X509 *x509;
 
@@ -3277,6 +3281,7 @@ static int tls_connection_client_cert(struct tls_connection *conn,
                }
                BIO_free(bio);
                return 0;
+#endif
        }
 
        if (client_cert == NULL)