From patchwork Wed Dec 13 23:21:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffan Karger X-Patchwork-Id: 152 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director5.mail.ord1d.rsapps.net ([172.30.191.6]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id haEcA/hQMlo9GAAAgoeIoA for ; Thu, 14 Dec 2017 05:22:48 -0500 Received: from proxy6.mail.ord1d.rsapps.net ([172.30.191.6]) by director5.mail.ord1d.rsapps.net (Dovecot) with LMTP id 0M9OAPhQMlqvbwAAsdCWiw ; Thu, 14 Dec 2017 05:22:48 -0500 Received: from smtp21.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.ord1d.rsapps.net (Dovecot) with LMTP id 6lGZDvhQMloRMgAAQyIf0w ; Thu, 14 Dec 2017 05:22:48 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.34.181.88] Authentication-Results: smtp21.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.34.181.88"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=karger-me.20150623.gappssmtp.com; dmarc=none (p=nil; dis=none) header.from=karger.me X-Classification-ID: bb39c0e0-e0b8-11e7-ab0b-525400a98691-1-1 Received: from [216.34.181.88] ([216.34.181.88:57699] helo=lists.sourceforge.net) by smtp21.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 2D/9D-01780-7F0523A5; Thu, 14 Dec 2017 05:22:47 -0500 Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1ePQeL-0000rZ-On; Thu, 14 Dec 2017 10:21:57 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1ePQeJ-0000rR-Pw for openvpn-devel@lists.sourceforge.net; Thu, 14 Dec 2017 10:21:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hy3Z+90ldAZtsE1BEiAqvQUwLQ6qKeNT1nodrR1euIE=; b=SVDlHfGtzu+FS/w9KIDnosqb1A gOiDOCGWhFaWj05s+grRpTeiDkeXUcUZh03VK84ijH6QB2p8JPNzKwHkLU6EHpRFCPmyhS5iS3Ynj usqH6nsx5kgLTZaWpJeZOnxTaYfo5liX+WiN3E3/ok+HAnpe/5IbUHh1z3K4FHOzj6zY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hy3Z+90ldAZtsE1BEiAqvQUwLQ6qKeNT1nodrR1euIE=; b=iKmzU5ehF1+4V5/55H13e9ogtZ U3KNTCBR+QuQVnU+KiPs4MiznUVm7EJhj79o2r1fNwEllcXZEo9f+0Rmb15HoprN+qS/+hD47hcdu 1iQdkcRFAAfA6Zf16Cq8k+XrM1l/254N/32HhinKIXS54X7AN0QBo/o8yZiPgpConKDA=; Received: from mail-wm0-f67.google.com ([74.125.82.67]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1ePQeG-0002ot-HB for openvpn-devel@lists.sourceforge.net; Thu, 14 Dec 2017 10:21:55 +0000 Received: by mail-wm0-f67.google.com with SMTP id g130so25663802wme.0 for ; Thu, 14 Dec 2017 02:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karger-me.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=hy3Z+90ldAZtsE1BEiAqvQUwLQ6qKeNT1nodrR1euIE=; b=xEWbskuo0x6gvyLdwya+DYJ4vh+keMhcLvzAMgZjOLz6J0wVy7Y7Dn99fOHKZNundt dc2NBf7SxfjdY5+S00UdVDSDid5tZZvv7aIpv0LVLJkmPJFAvlI75mDHp89gMw1w4907 deCCCaReY2VJ8shUB6iibHvRm3AQ5GlngEqjrotuaVN/mBxK4LJLcHYrVcvD1zQ6y4Ra N+uTyMeDPlwu0wJvluHH98XkGnn9JeAX0ujkK938RnMBDJK0ZS2bCn7i/0FtIpXRNrxi FmyhxEscoOKStcSuc2k0i9+gkRGSxXVPUFUo+ieHYCmtSwq9Npz024cVYPBI2gvEPk7L 4xMg== 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; bh=hy3Z+90ldAZtsE1BEiAqvQUwLQ6qKeNT1nodrR1euIE=; b=IvZMvQ+UvMjHwLwaV/zXBwG5eVnQhvyyCMj4tbTw1yk+K5axLjRT696LjIQSNmoCe6 /d6U9m5GT78a6VlBrCI6QRSqRqYTNZlt1nSIr8NvBhxbC2dRSLSdsBUlbOecl6XyFeK6 AmEM+vEueZxAwFAh5W6MtskHBwOwfPowIsrput6mfkx0Sf0BjItjbjRatjJoODV+5ehU ADRpsSGdb3hekClvFpdX5768mzehzxmEhFcHfCmr+iMepw8Xulhyz9GrpIokv/T3bh1i yj/E7qjGTe0Gh/FUFS0fFkIqD1i0S4gbmQTqRZvNZfHXzH52CbKHHap8Jjdz3jwxBMrG MCig== X-Gm-Message-State: AKGB3mJIofOJ2jSzctdlLrtMjOf2L4F+lvtpwlpk80kGCsazVeaI5kZk tTmbjXI1ViywksJjPEKnkf71Xcvo2oY= X-Google-Smtp-Source: ACJfBosV5VUMNOQnqngjjVRXjkjOF76y309Q4LeIRCdVk+MzdyVhAX84bn481b5PY/drG7zc2ksO+Q== X-Received: by 10.80.165.226 with SMTP id b31mr11705487edc.172.1513246906299; Thu, 14 Dec 2017 02:21:46 -0800 (PST) Received: from syzzer-tweakbak.fritz.box ([2001:985:e54:1:881e:647d:3c8e:6ee4]) by smtp.gmail.com with ESMTPSA id r1sm2959490edb.71.2017.12.14.02.21.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Dec 2017 02:21:44 -0800 (PST) From: Steffan Karger To: openvpn-devel@lists.sourceforge.net Date: Thu, 14 Dec 2017 11:21:37 +0100 Message-Id: <1513246897-28171-1-git-send-email-steffan@karger.me> X-Mailer: git-send-email 2.7.4 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.82.67 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1ePQeG-0002ot-HB Subject: [Openvpn-devel] [PATCH] ssl_openssl: fix compiler warning by removing getbio() wrapper X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox An API change in openssl 1.1 made the BIO_METHOD * returned by BIO_f_ssl() and BIO_s_mem() const, as well as the BIO_METHOD * argment of BIO_new() const. This meant that our getbio() function would either have an API inconsistent with 1.0 or 1.1. The wrapper was basically an ASSERT, so fix this by replacing the wrapper with an ASSERT. Signed-off-by: Steffan Karger Acked-by: Arne Schwabe --- src/openvpn/ssl_openssl.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index 34c31b9..711bba1 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -1416,23 +1416,6 @@ bio_debug_oc(const char *mode, BIO *bio) #endif /* ifdef BIO_DEBUG */ /* - * OpenVPN's interface to SSL/TLS authentication, - * encryption, and decryption is exclusively - * through "memory BIOs". - */ -static BIO * -getbio(BIO_METHOD *type, const char *desc) -{ - BIO *ret; - ret = BIO_new(type); - if (!ret) - { - crypto_msg(M_FATAL, "Error creating %s BIO", desc); - } - return ret; -} - -/* * Write to an OpenSSL BIO in non-blocking mode. */ static int @@ -1573,9 +1556,9 @@ key_state_ssl_init(struct key_state_ssl *ks_ssl, const struct tls_root_ctx *ssl_ * from verify callback*/ SSL_set_ex_data(ks_ssl->ssl, mydata_index, session); - ks_ssl->ssl_bio = getbio(BIO_f_ssl(), "ssl_bio"); - ks_ssl->ct_in = getbio(BIO_s_mem(), "ct_in"); - ks_ssl->ct_out = getbio(BIO_s_mem(), "ct_out"); + ASSERT((ks_ssl->ssl_bio = BIO_new(BIO_f_ssl()))); + ASSERT((ks_ssl->ct_in = BIO_new(BIO_s_mem()))); + ASSERT((ks_ssl->ct_out = BIO_new(BIO_s_mem()))); #ifdef BIO_DEBUG bio_debug_oc("open ssl_bio", ks_ssl->ssl_bio);