From patchwork Wed Aug 11 21:57:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1909 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id UDsUOOTUFGGUMQAAIUCqbw (envelope-from ) for ; Thu, 12 Aug 2021 03:59:32 -0400 Received: from proxy1.mail.ord1c.rsapps.net ([172.28.255.1]) by director8.mail.ord1d.rsapps.net with LMTP id 4GD1N+TUFGF2CgAAfY0hYg (envelope-from ) for ; Thu, 12 Aug 2021 03:59:32 -0400 Received: from smtp38.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1c.rsapps.net with LMTPS id 2Pf2H+TUFGG1RQAA2VeTtA (envelope-from ) for ; Thu, 12 Aug 2021 03:59:32 -0400 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.105.38.7] Authentication-Results: smtp38.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; 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; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 39c15c68-fb43-11eb-ab29-5452007bdf16-1-1 Received: from [216.105.38.7] ([216.105.38.7:40398] helo=lists.sourceforge.net) by smtp38.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 03/26-28194-4E4D4116; Thu, 12 Aug 2021 03:59:32 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1mE5bs-00060A-8U; Thu, 12 Aug 2021 07:58:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE5bp-000600-5N for openvpn-devel@lists.sourceforge.net; Thu, 12 Aug 2021 07:58:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nRp8wStpdoqVgcczLWMmyOoaS8QsXMERs8gawcx9YrE=; b=GAbjqZFYmvs+mGW6ZRt/SqJKuW uHsNbWW0KpIfeZBUt9dbWtieCcNaUK7/EybnZRl9si6IKC3vx3usnSV1Kwl5laMaCq/3DDhjoIMCi TtFdz9N4hqaTkADIe/T7Y1V3eNxpgQHLuBNQ+YhMX8BQi8obQoK1xuB0Mn3+jLeBFy7s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nRp8wStpdoqVgcczLWMmyOoaS8QsXMERs8gawcx9YrE=; b=PG2puUjO5/Ry2uCwb5kweWBmUH Ap3Kg3+nR1ksOlOvswi2GBWhVMfQ3EhXKijNh1ol0T1URo77plnLU163mEukJF7mNeZLnCMKhqMhk Zx7G2vKua4BDo9FlJsaSbYjav240PYmBLAfPbO+J1BfrhPvbVTf5sE43fuARDIfVtSCU=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1mE5bl-003qpO-71 for openvpn-devel@lists.sourceforge.net; Thu, 12 Aug 2021 07:58:37 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Thu, 12 Aug 2021 09:57:57 +0200 Message-Id: <20210812075757.31759-1-a@unstable.cc> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: unstable.cc] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1mE5bl-003qpO-71 Subject: [Openvpn-devel] [PATCH] mbedtls: do not define mbedtls_ctr_drbg_update_ret for mbedtls <2.15 and >=2.14.1 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The mbedtls_ctr_drbg_update_ret() function was backported to the 2.14 branch of mbedtls since 2.14.1. For this reason, we must exclude the definition of our compat function for mbedtls >=2.14.1 but <2.15 Cc: Max Fillinger Signed-off-by: Antonio Quartulli --- Successfully compiled tested on mbedTLS: * 2.10.0 * 2.14.1 * 2.20.0 * 2.26.0 src/openvpn/ssl_mbedtls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index 1853335e..a2ed59ac 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -66,8 +66,13 @@ * Compatibility: mbedtls_ctr_drbg_update was deprecated in mbedtls 2.16 and * replaced with mbedtls_ctr_drbg_update_ret, which returns an error code. * For older versions, we call mbedtls_ctr_drbg_update and return 0 (success). + * + * Note: mbedtls_ctr_drbg_update_ret was backported to the mbedtls 2.14 branch + * since 2.14.1. For this reason, the definition of this function has to be + * excluded for any mbedtls going from 2.14.1 (included) to 2.15 (excluded) */ -#if MBEDTLS_VERSION_NUMBER < 0x02100000 +#if MBEDTLS_VERSION_NUMBER < 0x02100000 && \ + !(MBEDTLS_VERSION_NUMBER > 0x020E0000 && MBEDTLS_VERSION_NUMBER < 0x020F0000) static int mbedtls_ctr_drbg_update_ret(mbedtls_ctr_drbg_context *ctx, const unsigned char *additional, size_t add_len)