From patchwork Wed Oct 18 02:32:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 827411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NSP0qukt"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yGx1c1vH2z9t2l for ; Wed, 18 Oct 2017 13:33:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5D7EC882CD; Wed, 18 Oct 2017 02:33:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LAgBQ6ntpEaQ; Wed, 18 Oct 2017 02:33:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6353E87E74; Wed, 18 Oct 2017 02:33:04 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A19B01C037C for ; Wed, 18 Oct 2017 02:32:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9B22387DAC for ; Wed, 18 Oct 2017 02:32:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xNUMIkWu3Jmk for ; Wed, 18 Oct 2017 02:32:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id EB72E81D92 for ; Wed, 18 Oct 2017 02:32:49 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id v41so7839940qtv.12 for ; Tue, 17 Oct 2017 19:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bdWDZ8yKwoQNdmAqbc64DMmi+MvhXguO3tamOHs6+UA=; b=NSP0quktKvJofjsLPavrB8nNd2syYfUWaqhFi9Av0Ao4JRR8CGthns/rFSqSveZQO/ 1aMrrA1qfEHSo3uJvKlnVrTxo8GUqmyKu5LuInC+dOM0pjSSAZ9zXOz/mp4XVRG6aVIF mlQX9pGL1Q4qQQXNIZwFpbCgPH0H3bocTTEgJRrUzbXOhWac2yjRhvrS8JhmdZ2dzCBT 0SCzvRBgNsrcuunyQw3j7OUPbINAZbjwcVqkLCy65UoI6lxmXFWvCdYjPTBGxYN1U9c5 H1LjZqMvQplJLMvkuS3Vv8G8w7OiHHWo1+Vmm0Nq8ZUlVg8lu0KNPyEd2eRfjdIwX5NY Dlzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bdWDZ8yKwoQNdmAqbc64DMmi+MvhXguO3tamOHs6+UA=; b=qacAvcpTQv5g3UxbDzK0csgaaJXLaUNFjWKvc5VxOohdgkhAHP3GwxF9wqPceeD4rj TepisZif7ACOb3OrocD/Q4UNv3SS+Q0kefoFOD6fxRwIfVmmKtuFU4EHdyp6izEuAeJD k12IhFFPjojuhYN+R01ZF6FI8JjmjqAxmgaB7uBFtNB8jBNJy4OcW54fmQC4tgxBGbOY jELVWiiULs4Kx+D/m8MHxx1VG60jm4JaObue0cSkqF/Z08rsvVgoA6Xx3od6B6B3tVfj NFg63Pvx7phCcAzWLyojqudRXC6BDPu6VADNrlv6bDbRgcxH3w6udWC6pzRr/o9MKFfB 7i6Q== X-Gm-Message-State: AMCzsaXwneyon7DA3TEv106uKg4ItaL4OKbjEHqaCSSEvbiZcwTTO9vR IJO9QUhPXRbhf45Zn/M6GgrvIaM6 X-Google-Smtp-Source: ABhQp+Q3sJG/gligXKPDz8PImH5iTQiy0RzCdqVpb9CleF8tX5jvFXpvOaXPj66gshpBmz0Qdw4VPg== X-Received: by 10.37.11.78 with SMTP id 75mr4189957ybl.138.1508293968839; Tue, 17 Oct 2017 19:32:48 -0700 (PDT) Received: from aduskett.duskett (2600-6c4a-767f-ff91-be5f-f4ff-feef-f9a2.dhcp6.chtrptr.net. [2600:6c4a:767f:ff91:be5f:f4ff:feef:f9a2]) by smtp.gmail.com with ESMTPSA id j14sm867355ywg.108.2017.10.17.19.32.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2017 19:32:48 -0700 (PDT) From: Adam Duskett X-Google-Original-From: Adam Duskett To: buildroot@buildroot.org Date: Tue, 17 Oct 2017 22:32:33 -0400 Message-Id: <20171018023240.22724-7-Adamduskett@outlook.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171018023240.22724-1-Adamduskett@outlook.com> References: <20171018023240.22724-1-Adamduskett@outlook.com> Cc: Adam Duskett Subject: [Buildroot] [PATCH 06/13] opusfile: add libressl support patch X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a program checks for openssl 1.1 or higher, it will pass that check because libressl sets it's version number to 2.x. Add simple checks to see if LIBRESSL_VERSION_NUMBER is defined. Signed-off-by: Adam Duskett --- package/opusfile/0001-fix-libressl-support.patch | 119 +++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 package/opusfile/0001-fix-libressl-support.patch diff --git a/package/opusfile/0001-fix-libressl-support.patch b/package/opusfile/0001-fix-libressl-support.patch new file mode 100644 index 0000000000..7965d78bfe --- /dev/null +++ b/package/opusfile/0001-fix-libressl-support.patch @@ -0,0 +1,119 @@ +From 349ddeff80bc2188b75ef3a3a9bf65203bcb9d7e Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Tue, 17 Oct 2017 21:14:59 -0400 +Subject: [PATCH] fix-libressl-support + +When a program checks for openssl 1.1 or higher, it will pass that +check because libressl sets it's version number to 2.x. + +Add simple checks to see if libressl_version_number is defined. + +Signed-off-by: Adam Duskett +--- + src/http.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/http.c b/src/http.c +index acd0e8c..f6896c2 100644 +--- a/src/http.c ++++ b/src/http.c +@@ -1530,7 +1530,7 @@ static long op_bio_retry_ctrl(BIO *_b,int _cmd,long _num,void *_ptr){ + return ret; + } + +-# if OPENSSL_VERSION_NUMBER<0x10100000L ++# if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + # define BIO_set_data(_b,_ptr) ((_b)->ptr=(_ptr)) + # define BIO_set_init(_b,_init) ((_b)->init=(_init)) + # define ASN1_STRING_get0_data ASN1_STRING_data +@@ -1538,7 +1538,7 @@ static long op_bio_retry_ctrl(BIO *_b,int _cmd,long _num,void *_ptr){ + + static int op_bio_retry_new(BIO *_b){ + BIO_set_init(_b,1); +-# if OPENSSL_VERSION_NUMBER<0x10100000L ++# if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + _b->num=0; + # endif + BIO_set_data(_b,NULL); +@@ -1549,7 +1549,7 @@ static int op_bio_retry_free(BIO *_b){ + return _b!=NULL; + } + +-# if OPENSSL_VERSION_NUMBER<0x10100000L ++# if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + /*This is not const because OpenSSL doesn't allow it, even though it won't + write to it.*/ + static BIO_METHOD op_bio_retry_method={ +@@ -1570,7 +1570,7 @@ static BIO_METHOD op_bio_retry_method={ + proxying https URL requests.*/ + static int op_http_conn_establish_tunnel(OpusHTTPStream *_stream, + OpusHTTPConn *_conn,op_sock _fd,SSL *_ssl_conn,BIO *_ssl_bio){ +-# if OPENSSL_VERSION_NUMBER>=0x10100000L ++# if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + BIO_METHOD *bio_retry_method; + # endif + BIO *retry_bio; +@@ -1583,7 +1583,7 @@ static int op_http_conn_establish_tunnel(OpusHTTPStream *_stream, + ret=op_http_conn_write_fully(_conn, + _stream->proxy_connect.buf,_stream->proxy_connect.nbuf); + if(OP_UNLIKELY(ret<0))return ret; +-# if OPENSSL_VERSION_NUMBER>=0x10100000L ++# if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + bio_retry_method=BIO_meth_new(BIO_TYPE_NULL,"retry"); + if(bio_retry_method==NULL)return OP_EFAULT; + BIO_meth_set_write(bio_retry_method,op_bio_retry_write); +@@ -1606,7 +1606,7 @@ static int op_http_conn_establish_tunnel(OpusHTTPStream *_stream, + /*This shouldn't succeed, since we can't read yet.*/ + OP_ALWAYS_TRUE(SSL_connect(_ssl_conn)<0); + SSL_set_bio(_ssl_conn,_ssl_bio,_ssl_bio); +-# if OPENSSL_VERSION_NUMBER>=0x10100000L ++# if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + BIO_meth_free(bio_retry_method); + # endif + /*Only now do we disable write coalescing, to allow the CONNECT +@@ -1635,7 +1635,7 @@ static struct addrinfo *op_inet_pton(const char *_host){ + return NULL; + } + +-# if OPENSSL_VERSION_NUMBER<0x10002000L ++# if OPENSSL_VERSION_NUMBER<0x10002000L || defined(LIBRESSL_VERSION_NUMBER) + /*Match a host name against a host with a possible wildcard pattern according + to the rules of RFC 6125 Section 6.4.3. + Return: 0 if the pattern doesn't match, and a non-zero value if it does.*/ +@@ -1893,7 +1893,7 @@ static int op_http_conn_start_tls(OpusHTTPStream *_stream,OpusHTTPConn *_conn, + SSL_set_tlsext_host_name(_ssl_conn,_stream->url.host); + # endif + skip_certificate_check=_stream->skip_certificate_check; +-# if OPENSSL_VERSION_NUMBER>=0x10002000L ++# if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER) + /*As of version 1.0.2, OpenSSL can finally do hostname checks automatically. + Of course, they make it much more complicated than it needs to be.*/ + if(!skip_certificate_check){ +@@ -1956,13 +1956,13 @@ static int op_http_conn_start_tls(OpusHTTPStream *_stream,OpusHTTPConn *_conn, + if(OP_UNLIKELY(ret<=0))return OP_FALSE; + ssl_session=_stream->ssl_session; + if(ssl_session==NULL +-# if OPENSSL_VERSION_NUMBER<0x10002000L ++# if OPENSSL_VERSION_NUMBER<0x10002000L || defined(LIBRESSL_VERSION_NUMBER) + ||!skip_certificate_check + # endif + ){ + ret=op_do_ssl_step(_ssl_conn,_fd,SSL_do_handshake); + if(OP_UNLIKELY(ret<=0))return OP_FALSE; +-# if OPENSSL_VERSION_NUMBER<0x10002000L ++# if OPENSSL_VERSION_NUMBER<0x10002000L || defined(LIBRESSL_VERSION_NUMBER) + /*OpenSSL before version 1.0.2 does not do automatic hostname verification, + despite the fact that we just passed it the hostname above in the call + to SSL_set_tlsext_host_name(). +@@ -2314,7 +2314,7 @@ static int op_http_stream_open(OpusHTTPStream *_stream,const char *_url, + /*Initialize the SSL library if necessary.*/ + if(OP_URL_IS_SSL(&_stream->url)&&_stream->ssl_ctx==NULL){ + SSL_CTX *ssl_ctx; +-# if OPENSSL_VERSION_NUMBER<0x10100000L ++# if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + # if !defined(OPENSSL_NO_LOCKING) + /*The documentation says SSL_library_init() is not reentrant. + We don't want to add our own depenencies on a threading library, and it +-- +2.13.6 +