From patchwork Wed Feb 12 22:55:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 992 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2O4fD58dRV6MKwAAIUCqbw for ; Thu, 13 Feb 2020 04:57:51 -0500 Received: from proxy16.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id YPL4Dp8dRV6HMwAApN4f7A ; Thu, 13 Feb 2020 04:57:51 -0500 Received: from smtp17.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy16.mail.ord1d.rsapps.net with LMTP id +KTrDZ8dRV42bQAAetu3IA ; Thu, 13 Feb 2020 04:57:51 -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.105.38.7] Authentication-Results: smtp17.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; 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: 4b66b238-4e47-11ea-b507-bc305beffb0c-1-1 Received: from [216.105.38.7] ([216.105.38.7:51418] helo=lists.sourceforge.net) by smtp17.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C9/07-30638-E9D154E5; Thu, 13 Feb 2020 04:57:51 -0500 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 1j2BEk-0008Gw-3H; Thu, 13 Feb 2020 09:56:46 +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 1j2BEi-0008Gj-BA for openvpn-devel@lists.sourceforge.net; Thu, 13 Feb 2020 09:56:44 +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=W2K3BzRxFlBiIrqAO5qjTVmBxj2NEnOboDb6Wcj/8eA=; b=jNXo3YD5h8GBEUrxzRoqY+YfoU ipAWHE5BAYbz2FnElJ6muuga4oBN2BeQq623zUdplkLyymgIkC2NgGN9aWCp18aRQlOzl76hIq8mz wkFXYn2lPgmN5g9TvPRvjfMSDHyw9k8RxMX3vhI4CYAPtognoI3021Wk7DiNUBiSkdK4=; 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=W2K3BzRxFlBiIrqAO5qjTVmBxj2NEnOboDb6Wcj/8eA=; b=WFo9XhPEIu+FUXNmsssvCOenfA H08NGtM8oypDfjaRUxcRsWtTh+DEIRd1OyvvwUX2t4CgH0JtNfTTk7d0avF/JdRH0Uj2znFIxvyy3 XslcidI/443Ep+AGR4J7OpnoecpgLAEHFGnKjNWOdInd2n2bC7kp7AJ/AMvdvFCQwMCE=; Received: from mail-wm1-f67.google.com ([209.85.128.67]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1j2BEh-002ynp-53 for openvpn-devel@lists.sourceforge.net; Thu, 13 Feb 2020 09:56:44 +0000 Received: by mail-wm1-f67.google.com with SMTP id t14so5869652wmi.5 for ; Thu, 13 Feb 2020 01:56:42 -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; bh=W2K3BzRxFlBiIrqAO5qjTVmBxj2NEnOboDb6Wcj/8eA=; b=GXN/ZMTOsipWLxGhVU9E7TxHb9i844997SPHvEBidLScpp2ZumDIIanLL/arzJme6S X0AbDlMosyyHMN9W+u2/TRlgpOTKq6PdH3aiPpLfNvtybAyxdLp+WjNmTgGatxrWNho1 8+epjGkR6P3vJst0wAf9lC3vttJXrzxVnQC/SHWmPdkd823CJuKgwhVcettuU/4Rz8fA FZ6NNHOPzg/Bo/DPDLxAbyV5ksdQ5DiUdPf4guSBl6Q6xLi3LYee6d0FLsF3g2VrFYf5 qAYoYHhy2CQL77TyaXIESGAMENtRuWgAbm/3m11jE0/P4DqdMS59q6H3vPygbi4KfcIn mMFA== 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=W2K3BzRxFlBiIrqAO5qjTVmBxj2NEnOboDb6Wcj/8eA=; b=oDyX9qFe9bGwsoN/m9rWSpLUKk8CdxFGlJmvanMt0qYGN3eEBj1e5+j5fN32CoxgDq f1j3XVH+FRcaeiVxbiJnKMKhQHbHtKnly7RQqOsJIQu6kt0XrAxx7sPxAw7hHfty9QDx Pw/hJWy0slcrHSU4oU03gW8njT9QApg3cl2OJeBt9bayhufDQccjg0xBe5AUctk+dIEl 3kw7Qk6rSnCYadE5XBoy/OGmBwvccWPquLbpKCw8N9BCl2PSfAfQ5xSns8fMukjfncln rDCLpnzkM2EYlWM1EqnQhw8ppJNrvm+byl/2kZGCRtVnrDA9QCii28rkDlzfEz7ZPTCM xuDg== X-Gm-Message-State: APjAAAXZ60iCjB752OGa3Bp3IG1CM0d4Sq2nt6nD/c5NAis5dGgrskRI vQDciqf6b2eWgHREloHcvovm9LBjxQs= X-Google-Smtp-Source: APXvYqxb3yXc30iX93Oxj86O9em9cbn4kLLo/d8q297TKTd9jR3AIoZCA1wCVfOsC914zt8fIp7VCA== X-Received: by 2002:a1c:4c8:: with SMTP id 191mr4821151wme.148.1581587795912; Thu, 13 Feb 2020 01:56:35 -0800 (PST) Received: from LAPTOP-4L3N7KFS.panoulu.local ([2a00:1d50:3:0:f18e:e168:f7f1:520e]) by smtp.gmail.com with ESMTPSA id p12sm2024154wrx.10.2020.02.13.01.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 01:56:35 -0800 (PST) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Thu, 13 Feb 2020 11:55:39 +0200 Message-Id: <20200213095539.11157-1-lstipakov@gmail.com> X-Mailer: git-send-email 2.17.1 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 (lstipakov[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.67 listed in list.dnswl.org] 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: openvpn.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.67 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1j2BEh-002ynp-53 Subject: [Openvpn-devel] [PATCH] cryptoapi.c: fix run-time check failure in msvc debugger 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: Lev Stipakov MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Lev Stipakov When using certificate without RSA_PKCS1_PSS_PADDING padding, "saltlen" is passed unitialized to priv_enc_CNG(), which causes > Run-Time Check Failure #3 - The variable 'saltlen' is being used without being initialized. in VS debugger. Initialize saltlen (and other variable for the sake of consistence) to zero to avoid above failure. Signed-off-by: Lev Stipakov Acked-by: Selva Nair --- src/openvpn/cryptoapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openvpn/cryptoapi.c b/src/openvpn/cryptoapi.c index 1bf74fcd..30eba7b2 100644 --- a/src/openvpn/cryptoapi.c +++ b/src/openvpn/cryptoapi.c @@ -882,9 +882,9 @@ pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, EVP_MD *md = NULL; const wchar_t *alg = NULL; - int padding; - int hashlen; - int saltlen; + int padding = 0; + int hashlen = 0; + int saltlen = 0; pkey = EVP_PKEY_CTX_get0_pkey(ctx); if (pkey)