From patchwork Wed Aug 24 06:57:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2723 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id eMrgE8NYBmOoQgAAIUCqbw (envelope-from ) for ; Wed, 24 Aug 2022 12:58:43 -0400 Received: from proxy12.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id GHOJE8NYBmM4NwAA91zNiA (envelope-from ) for ; Wed, 24 Aug 2022 12:58:43 -0400 Received: from smtp16.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.ord1d.rsapps.net with LMTPS id kLtQE8NYBmOFWwAA7PHxkg (envelope-from ) for ; Wed, 24 Aug 2022 12:58:43 -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: smtp16.gate.ord1d.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=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 0175d6ea-23ce-11ed-ae71-525400ca3ad5-1-1 Received: from [216.105.38.7] ([216.105.38.7:34148] helo=lists.sourceforge.net) by smtp16.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 48/7E-15507-1C856036; Wed, 24 Aug 2022 12:58:41 -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.95) (envelope-from ) id 1oQthJ-0008NO-HE; Wed, 24 Aug 2022 16:57:45 +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.95) (envelope-from ) id 1oQth2-0008Mf-1U for openvpn-devel@lists.sourceforge.net; Wed, 24 Aug 2022 16:57:28 +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:To:From:Sender:Reply-To:Cc: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=6soIyX/mdhoH/aJ9QvwffzH28WcPovZHdg3hvbZ8cAQ=; b=UDj+sR3UIDHC9JYOcK66J1OMAX ySQiqpqtCUMz8GtfB3gqbf9UU66K+UcNUy0gYuX3T89aK6hzTzBzEZ8epGu6EHGiaSMIFbhWju2sf XhGQouLmDRRFhHAtT6gFyas2JtuHeBnH8MQsvlhopce7la/BU6A7b8YP1tbizmfXEheg=; 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:To:From: Sender:Reply-To:Cc: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=6soIyX/mdhoH/aJ9QvwffzH28WcPovZHdg3hvbZ8cAQ=; b=Y i9MjRbbM/ykevGIzgo/qFKErblTzvMaI0f3TuJBxn4mt8alPakdB988TO5OErCUv04oLS69iyZzKR 71HjQutdPAF/R/oZRpRRVOcN1dNx9aUdk3Y6h2oJJT9urW97HcrCwPEwqzXeMo2ME++b5MCzLgsUq vPxvn3sycVs9Oft0=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oQtgz-0003mI-Ps for openvpn-devel@lists.sourceforge.net; Wed, 24 Aug 2022 16:57:27 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1oQtgs-0005rb-BF for openvpn-devel@lists.sourceforge.net; Wed, 24 Aug 2022 18:57:18 +0200 Received: (nullmailer pid 102048 invoked by uid 10006); Wed, 24 Aug 2022 16:57:18 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 24 Aug 2022 18:57:18 +0200 Message-Id: <20220824165718.102002-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 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: Error: test_provider.c(74): error C2099: initializer is not a constant Fix this issue by making the const char* to const char[]. This is probably of one the weird array decay corner cases I could not find another/better way around this issue. Godbolt link to try: Content analysis details: (0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1oQtgz-0003mI-Ps Subject: [Openvpn-devel] [PATCH] Fix delcarion of pubkeys in test_provider.c 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 Error: test_provider.c(74): error C2099: initializer is not a constant Fix this issue by making the const char* to const char[]. This is probably of one the weird array decay corner cases I could not find another/better way around this issue. Godbolt link to try: https://godbolt.org/z/s3aPb9q8q This error only occurs when building unit tests with windows which our normal build system does not do but my out of tree cmake build script tries and fails Signed-off-by: Arne Schwabe Acked-By: Frank Lichtenheld --- tests/unit_tests/openvpn/test_provider.c | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/unit_tests/openvpn/test_provider.c b/tests/unit_tests/openvpn/test_provider.c index 3f9a26e57..9451a6e7e 100644 --- a/tests/unit_tests/openvpn/test_provider.c +++ b/tests/unit_tests/openvpn/test_provider.c @@ -52,24 +52,24 @@ static int mgmt_callback_called; static OSSL_PROVIDER *prov[2]; /* public keys for testing -- RSA and EC */ -static const char *const pubkey1 = "-----BEGIN PUBLIC KEY-----\n" - "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7GWP6RLCGlvmVioIqYI6\n" - "LUR4owA7sJ/nJxBAk+/xzD6gqgSigBsTqeb+gdZwkKjY1N4w2DUA0r5i8Eja/BWN\n" - "xMZtC5nxK4MACtMqIwvlzfk130NhFXKtlZj2cyFBXqDdRyeg1ZrUQagcHVcgcReP\n" - "9yiePgfO7NUOQk8edEeOR53SFCgnLBQQ9dGWtZN0hO/5BN6NSm/fd6vq0VjTRP5a\n" - "BAH/BnqX9/3jV0jh8N9AE59mI1rjVVQ9VDnuAPkS8dLfdC661/CNxt0YWByTIgt1\n" - "+qjW4LUvLbnU/rlPhuJ1SBZg+z/JtDBCKfs7syu5WYFqRvNFg7/91Rr/NwxvW/1h\n" - "8QIDAQAB\n" - "-----END PUBLIC KEY-----\n"; - -static const char *const pubkey2 = "-----BEGIN PUBLIC KEY-----\n" - "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEO85iXW+HgnUkwlj1DohNVw0GsnGIh1gZ\n" - "u95ff1JiUaJIkYNIkZA+hwIPFVH5aJcSCv3SPIeDS2VUAESNKHZJBQ==\n" - "-----END PUBLIC KEY-----\n"; - -static const char *const pubkey3 = "-----BEGIN PUBLIC KEY-----\n" - "MCowBQYDK2VwAyEA+q5xjF5hGyyqYZidJdz/0saEQabL3N4wIZJBxNGbgJE=\n" - "-----END PUBLIC KEY-----"; +static const char pubkey1[] = "-----BEGIN PUBLIC KEY-----\n" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7GWP6RLCGlvmVioIqYI6\n" + "LUR4owA7sJ/nJxBAk+/xzD6gqgSigBsTqeb+gdZwkKjY1N4w2DUA0r5i8Eja/BWN\n" + "xMZtC5nxK4MACtMqIwvlzfk130NhFXKtlZj2cyFBXqDdRyeg1ZrUQagcHVcgcReP\n" + "9yiePgfO7NUOQk8edEeOR53SFCgnLBQQ9dGWtZN0hO/5BN6NSm/fd6vq0VjTRP5a\n" + "BAH/BnqX9/3jV0jh8N9AE59mI1rjVVQ9VDnuAPkS8dLfdC661/CNxt0YWByTIgt1\n" + "+qjW4LUvLbnU/rlPhuJ1SBZg+z/JtDBCKfs7syu5WYFqRvNFg7/91Rr/NwxvW/1h\n" + "8QIDAQAB\n" + "-----END PUBLIC KEY-----\n"; + +static const char pubkey2[] = "-----BEGIN PUBLIC KEY-----\n" + "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEO85iXW+HgnUkwlj1DohNVw0GsnGIh1gZ\n" + "u95ff1JiUaJIkYNIkZA+hwIPFVH5aJcSCv3SPIeDS2VUAESNKHZJBQ==\n" + "-----END PUBLIC KEY-----\n"; + +static const char pubkey3[] = "-----BEGIN PUBLIC KEY-----\n" + "MCowBQYDK2VwAyEA+q5xjF5hGyyqYZidJdz/0saEQabL3N4wIZJBxNGbgJE=\n" + "-----END PUBLIC KEY-----"; static const char *pubkeys[] = {pubkey1, pubkey2, pubkey3};