From patchwork Sat Jan 20 06:11:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 205 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director1.mail.ord1d.rsapps.net ([172.30.191.6]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id g6x0NpB4Y1qZbgAAgoeIoA for ; Sat, 20 Jan 2018 12:12:48 -0500 Received: from proxy2.mail.ord1d.rsapps.net ([172.30.191.6]) by director1.mail.ord1d.rsapps.net (Dovecot) with LMTP id mXUPBJB4Y1qgawAANGzteQ ; Sat, 20 Jan 2018 12:12:48 -0500 Received: from smtp12.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.ord1d.rsapps.net (Dovecot) with LMTP id 9v0eIJB4Y1oPMQAAfawv4w ; Sat, 20 Jan 2018 12:12: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: smtp12.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=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Classification-ID: 236fe8a6-fe05-11e7-bd76-52540070b731-1-1 Received: from [216.34.181.88] ([216.34.181.88:51234] helo=lists.sourceforge.net) by smtp12.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 0D/65-22541-098736A5; Sat, 20 Jan 2018 12:12:48 -0500 Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1ecwgF-0002xx-Da; Sat, 20 Jan 2018 17:11:47 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1ecwgD-0002xr-Nf for openvpn-devel@lists.sourceforge.net; Sat, 20 Jan 2018 17:11:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LtPFXB4go7FnpQreIvNYrMrBF+3xdWYmkaOiQCE5Hic=; b=iEBAa49OXpPxv/S/NAzrl6Dc6q mvxw35X8ksR6fmXcsMhRFHTtMWcYV/qIwCNyZJzFRc++CdX7BonC/eh5a5caNeMy3fby/Tyui8dV6 FN3WstfXcXoDT/Meu0SQfM49jUqdmXtflDi8/8KOJagbC+ZBNFKEste7PpbCklR/f4C4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LtPFXB4go7FnpQreIvNYrMrBF+3xdWYmkaOiQCE5Hic=; b=Nt8GcQsBEDD4d+VE2BH9B0GtoZ sK6BiTfp3lJ3bQZNpAoAIkfA1eIszxRURSuTefV5woGFWqtUngHgRq5rXeLR8WkEbbHCxHv/cRvUy quYJ/qCSz8cGAm9t0m85whavm2KBLrasJibHGqH21Mhs7ss8c2O+ohsYNTZ0LlUFXE24=; Received: from mail-io0-f195.google.com ([209.85.223.195]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1ecwgC-0007fj-On for openvpn-devel@lists.sourceforge.net; Sat, 20 Jan 2018 17:11:45 +0000 Received: by mail-io0-f195.google.com with SMTP id m11so5336100iob.2 for ; Sat, 20 Jan 2018 09:11:44 -0800 (PST) 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=LtPFXB4go7FnpQreIvNYrMrBF+3xdWYmkaOiQCE5Hic=; b=p9zsJs4/T6CzvEC5Vh41Q1oqSphVcDguWyjFEEIz5vip1Koo+4R7KC0JwUURa3eiJq XfMNGs5PKcio7SyKDkeOcLU+o9mDaqCs0z3towUOtSiP1DMn9rUb3Yn8+EvxUYAq65qA AZr9KzU11m38JWzrG9ylyRnCH5c9HdkUIJpwiWAYx5kS+r9WZSrmqfI/74ctMOUDAdyo sEiwZINowYCWd4Wj6UuIcSaFvX2yIejCogOuUFCMcM/stBV5bQuE+msQHcdK1Xhouzkk AsuJZKl9Y6ncUU16QThLuVYX2PxWGAVgp6zAwyz1a1wO75wR/F9DJVGmQ7mZ1mpG1NXU /EMQ== 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=LtPFXB4go7FnpQreIvNYrMrBF+3xdWYmkaOiQCE5Hic=; b=j7RMSSh798LhEFUPc4Z6Q/Lmem4HIvXEs3KcERQOZMbD/mD5+lYjYa1zkjtbbODgcS QEzWNPgbBUVUHO9GB8XiH6psCQOhmHJfF7ULYCI8kVONXYX9sxZA9+jImGiWEm4wYw09 j6E6IvJ+CjaU9+ST/fxKyVLqzR1Y8BnFV6ZxXvMwIpEXjYFHGC0+bbqmIktGtcQF7lXb Vh6ePDr2Xt6tzMZgpYTnaR8p0z1jb9MvDOAasJGTtgOl6ckw+0TXxj6E+SRfjTK2Lpbd 40sqQ5C4aZouDv63W6jJ+79X4n8iMqlNKcDyx7rpS+tEfDXWPte/yfViCEQEzMaX9ftW Ni5g== X-Gm-Message-State: AKwxytcLkdHKLTWU4BbFtM0/ptaFFqHxYt0mZ/VR+1jdCbt4ttUTVXO0 /5uZnA2SdqktdyyGr2nrPKUrEogx X-Google-Smtp-Source: AH8x225/SJoyBgjIEPkrgpLu72yLJHUjx2xdofXy45hVW8TduS0dfnkmufyJkOBTOkK7SMGmpRB5yw== X-Received: by 10.107.40.143 with SMTP id o137mr469726ioo.72.1516468299222; Sat, 20 Jan 2018 09:11:39 -0800 (PST) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id b12sm6347035ioe.38.2018.01.20.09.11.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Jan 2018 09:11:38 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Sat, 20 Jan 2018 12:11:34 -0500 Message-Id: <1516468294-32635-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <5fa43bce-203f-1470-d66c-c7739dc8aa6a@karger.me5fa43bce-203f-1470-d66c-c7739dc8aa6a@karger.me> References: <5fa43bce-203f-1470-d66c-c7739dc8aa6a@karger.me5fa43bce-203f-1470-d66c-c7739dc8aa6a@karger.me> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.223.195 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: 1ecwgC-0007fj-On Subject: [Openvpn-devel] [PATCH 2.4] Add SSL_CTX_get_max_proto_version() not in openssl 1.0 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 From: Selva Nair - No change in functionality. This is used in a subsequent patch for extending TLS1.2 support with cryptoapicert Signed-off-by: Selva Nair --- This is for 2.4 Same as the patch merged into master except for the ifdefs needed for 0.9.8 src/openvpn/openssl_compat.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index 9f1e92a..4b338d2 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -670,6 +670,33 @@ SSL_CTX_get_min_proto_version(SSL_CTX *ctx) } #endif /* SSL_CTX_get_min_proto_version */ +#ifndef SSL_CTX_get_max_proto_version +/** Return the max SSL protocol version currently enabled in the context. + * If no valid version >= TLS1.0 is found, return 0. */ +static inline int +SSL_CTX_get_max_proto_version(SSL_CTX *ctx) +{ + long sslopt = SSL_CTX_get_options(ctx); +#ifdef SSL_OP_NO_TLSv1_2 + if (!(sslopt & SSL_OP_NO_TLSv1_2)) + { + return TLS1_2_VERSION; + } +#endif +#ifdef SSL_OP_NO_TLSv1_1 + if (!(sslopt & SSL_OP_NO_TLSv1_1)) + { + return TLS1_1_VERSION; + } +#endif + if (!(sslopt & SSL_OP_NO_TLSv1)) + { + return TLS1_VERSION; + } + return 0; +} +#endif /* SSL_CTX_get_max_proto_version */ + #ifndef SSL_CTX_set_min_proto_version /** Mimics SSL_CTX_set_min_proto_version for OpenSSL < 1.1 */ static inline int