From patchwork Wed Jul 6 17:51:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 2577 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id MAOrOqxYxmIlJQAAIUCqbw (envelope-from ) for ; Wed, 06 Jul 2022 23:53:16 -0400 Received: from proxy1.mail.iad3b.rsapps.net ([172.31.255.6]) by director11.mail.ord1d.rsapps.net with LMTP id 0JCWOqxYxmL1TQAAvGGmqA (envelope-from ) for ; Wed, 06 Jul 2022 23:53:16 -0400 Received: from smtp37.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.iad3b.rsapps.net with LMTPS id 2CyLM6xYxmI4eQAALM5PBw (envelope-from ) for ; Wed, 06 Jul 2022 23:53:16 -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: smtp37.gate.iad3b.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; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 54804a1a-fda8-11ec-877b-5254002ca64a-1-1 Received: from [216.105.38.7] ([216.105.38.7:59438] helo=lists.sourceforge.net) by smtp37.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 1E/2B-24230-CA856C26; Wed, 06 Jul 2022 23:53:16 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1o9IYl-0002S4-OH; Thu, 07 Jul 2022 03:52:11 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o9IYk-0002Ry-If for openvpn-devel@lists.sourceforge.net; Thu, 07 Jul 2022 03:52:10 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pMiygig8DA/z5LObbEbUMJtH5YfKN4NQooJUkT1EmH8=; b=CUdluyUhM1yHSbchlSwu55qX2p mfor9F/uMytuIEA8MkmIPN/tBlvs+6wYAJ80VIChZ/yacDytk1Ex9I+qQXOEL1OiYL61of7HbyVBQ tPlr8Z2Q2DmnU4Gity0AcMXz4NSYgqSYbtacMClCPtVE2WWNlNp46IcU6llo877yhAvc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=pMiygig8DA/z5LObbEbUMJtH5YfKN4NQooJUkT1EmH8=; b=U roKqMMBNoy3Q0TBBuOdLhpuAJE9tFD5MjL8DwslHuscUpEJvyrFkKPOScUmIH1pm8ln/I5AVyv7mD Gr5ShLjyxjj8ZWbZFd2g7H7zDySHgW/7T5xCEhwOvTmGfXkbb0gbVTgcdrlTUE07xzWAnc9HQ1iLi yEDQotTNJq65BgS0=; Received: from mail-io1-f49.google.com ([209.85.166.49]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.94.2) id 1o9IYi-009SSa-G1 for openvpn-devel@lists.sourceforge.net; Thu, 07 Jul 2022 03:52:10 +0000 Received: by mail-io1-f49.google.com with SMTP id m13so15816743ioj.0 for ; Wed, 06 Jul 2022 20:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pMiygig8DA/z5LObbEbUMJtH5YfKN4NQooJUkT1EmH8=; b=f6M5H6Y6HVCwNc4IBUmsW3vWRwmm7zJc6l3mb/AbMDvWOZdEhE5dQd/Io1N5jKcOe3 lY5xpQpK6FlqptM96Cs11sg+Gqxt159MMuX/8E/pRFG421UkgRg/nf47jiSbJdwwDLo2 CJKhHnScYgxaJ2n+ye9ohIKs/PkTR1jVx+i0l+UK5TLKo1KHZCTRSnPbrDsMEJcYXsT5 rNDsyTEXO6+5/tXqdNmFGVw4BvFAxjYj0CJqzD0LAS0K1Bg+yJqmKHYSi6i4tlaL5zPH JNBsLI4m24vGs5d/c7deKzaV/T3VJbX6GXcY3ZDE/J5efQtKOxk55Zv1kLMPxzpmYzeb T8Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pMiygig8DA/z5LObbEbUMJtH5YfKN4NQooJUkT1EmH8=; b=WS5Uat55lSubxky9Hx82dX+b3yI0Dw88vJzphC6Gbyt7hj0wF60GnQW8HsfIazBjae 6qpzvHAmziPebYKDgWhVLs4WzH6MTWvJeh82zBDZxbjDyXq8ru/gnapqqAYfti6OIHey xV8d8EnW7rqsk1ZqDAhjdsbDQZQWND/qCthM70+jnsatTAf2P0vwCfiI/lvkZFV3VPhT L/ajQ/Tl0Df3XWvkZj3aihTgOzlf7VTpM4K6Uzth0OljYGiyngYOlmrH1LBIVanarNKt 3e/qeCBz2Qq+4Sr7vg6ueOd05NYN57r6YhA6qnwPtpD/2LSRu37JSu548bHwa8K7cHkC Si5w== X-Gm-Message-State: AJIora+Q3XH+e85nHxNKbGtKsEzk7Zt5dl+3vmsF2/gVvp6WajuUKi2A fFpB739f/eWu6/8jeREIjtler2GQWnM= X-Google-Smtp-Source: AGRyM1uoLoWNaQKLPJFtOnFWnkn9Uf0Q2fR2qz4gRanZo4IsYnpyFiygmUtUPQjJIEV2stK4h5KQrg== X-Received: by 2002:a05:6602:2cce:b0:675:544e:da0b with SMTP id j14-20020a0566022cce00b00675544eda0bmr21875602iow.123.1657165922750; Wed, 06 Jul 2022 20:52:02 -0700 (PDT) Received: from uranus.home.sansel.ca (bras-vprn-tnhlon4053w-lp130-02-70-51-223-109.dsl.bell.ca. [70.51.223.109]) by smtp.gmail.com with ESMTPSA id i17-20020a056638381100b0033e72ec9d93sm8624428jav.145.2022.07.06.20.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 20:52:02 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Wed, 6 Jul 2022 23:51:51 -0400 Message-Id: <20220707035151.25469-1-selva.nair@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Selva Nair The function signature for xkey_load_generic_key had function pointers defined as function types that seems to work in gcc but not in msvc. Fix it by changing the function signatures to what was intended. Also revert part of commit 627d1a3d28638... as that work- around should be no longer required. Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.49 listed in wl.mailspike.net] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1o9IYi-009SSa-G1 Subject: [Openvpn-devel] [PATCH] Fix crash in xkey-provider in msvc builds 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair The function signature for xkey_load_generic_key had function pointers defined as function types that seems to work in gcc but not in msvc. Fix it by changing the function signatures to what was intended. Also revert part of commit 627d1a3d28638... as that work- around should be no longer required. Reported by: Lev Stipakov https://github.com/lstipakov Signed-off-by: Selva Nair Signed-off-by: Selva Nair <selva.nair@gmail.com>
--- src/openvpn/xkey_common.h | 2 +- src/openvpn/xkey_helper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openvpn/xkey_common.h b/src/openvpn/xkey_common.h index e0e5ed5b..6d6a1e2c 100644 --- a/src/openvpn/xkey_common.h +++ b/src/openvpn/xkey_common.h @@ -152,7 +152,7 @@ xkey_digest(const unsigned char *src, size_t srclen, unsigned char *buf, */ EVP_PKEY * xkey_load_generic_key(OSSL_LIB_CTX *libctx, void *handle, EVP_PKEY *pubkey, - XKEY_EXTERNAL_SIGN_fn sign_op, XKEY_PRIVKEY_FREE_fn free_op); + XKEY_EXTERNAL_SIGN_fn *sign_op, XKEY_PRIVKEY_FREE_fn *free_op); extern OSSL_LIB_CTX *tls_libctx; /* Global */ diff --git a/src/openvpn/xkey_helper.c b/src/openvpn/xkey_helper.c index 14f074ae..73235fd6 100644 --- a/src/openvpn/xkey_helper.c +++ b/src/openvpn/xkey_helper.c @@ -115,7 +115,7 @@ xkey_load_management_key(OSSL_LIB_CTX *libctx, EVP_PKEY *pubkey) */ EVP_PKEY * xkey_load_generic_key(OSSL_LIB_CTX *libctx, void *handle, EVP_PKEY *pubkey, - XKEY_EXTERNAL_SIGN_fn sign_op, XKEY_PRIVKEY_FREE_fn free_op) + XKEY_EXTERNAL_SIGN_fn *sign_op, XKEY_PRIVKEY_FREE_fn *free_op) { EVP_PKEY *pkey = NULL; const char *origin = "external"; @@ -125,8 +125,8 @@ xkey_load_generic_key(OSSL_LIB_CTX *libctx, void *handle, EVP_PKEY *pubkey, {"xkey-origin", OSSL_PARAM_UTF8_STRING, (char *) origin, 0, 0}, {"pubkey", OSSL_PARAM_OCTET_STRING, &pubkey, sizeof(pubkey), 0}, {"handle", OSSL_PARAM_OCTET_PTR, &handle, sizeof(handle), 0}, - {"sign_op", OSSL_PARAM_OCTET_PTR, (void **) &sign_op, sizeof(void *), 0}, - {"free_op", OSSL_PARAM_OCTET_PTR, (void **) &free_op, sizeof(void *), 0}, + {"sign_op", OSSL_PARAM_OCTET_PTR, (void **) &sign_op, sizeof(sign_op), 0}, + {"free_op", OSSL_PARAM_OCTET_PTR, (void **) &free_op, sizeof(free_op), 0}, {NULL, 0, NULL, 0, 0} }; msg(M_INFO, "%s: handle = %p sign_op = %p free_op = %p ", __FUNCTION__,