From patchwork Fri Aug 30 14:18:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 3794 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:24f1:b0:5b1:8b5e:23cb with SMTP id o17csp460122man; Fri, 30 Aug 2024 07:19:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXZV6fjj16YA6PdYCqhu22DeXjNGfx4Xy5vvvDAFdP5f5zuGdUqQ8Bb/hn+B2QY6Y3jejkRI/lAX4Q=@openvpn.net X-Google-Smtp-Source: AGHT+IH9FAaaOZMkZ64MK3S32QbUpgNjlBKUz0qr6Jb1HoC8Yaq1dHtlEuCiMKdnn1R+0Hbulthz X-Received: by 2002:a17:902:f787:b0:202:38d8:161 with SMTP id d9443c01a7336-2050c4b7a17mr73878355ad.57.1725027549583; Fri, 30 Aug 2024 07:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725027549; cv=none; d=google.com; s=arc-20160816; b=Pcn8TihDK63ibqJI9WE2WDpWaftASXE30/ROACX/B8TgNguNlII7fxFMG3n5y2b87C vVm8cjPrspLjvg9/IIw5kZwlcYlAOuia+UVU1t2KTjshnWOdSVskasvbZDTDm28vBNXo 9UcdeBFpSzCkEKNeBFQnn7DF1IXGgecVIk1La2VRoy0i9cKDe6QKrWHTy7+L4wuTFUGc CybAYgaBjj1WXZFletaNUCBfxMJ+sIGO0JBek6VwNqRnWa2B/ySjfcmDXwXGYXTP7bd/ UR8vOY8MMwi1LRLdzagZKH1GDj1vxO+8h/1WWoxkDj87rHbAWHEMDcZVv5LJng0prvhC lUZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=GnFKbqhD2Bs9dmQ5oXSXXtx2gaYnF/L2bUrKSmj/alo=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=vTroQ/pHKuwyU6dWtYR5Fv10uW0ZtEuZIEyFE7VlSrxrfrkt8i6pVgOtwW79Se42uW qxuINWoHIT6AVzRUw/iS8m5vRnDjRGvzeEEK7/u9t2rzgrzX7Ddver7dOvRdCcq/tzt5 ErPf4oIolyTqLgYm1RU7OCqUEVZWwidYhTYDpeypv4z+e03QOL8RI9n5nh/5CBAD1Scw CvKgbTXsvtM7dk56nSbr6Y4Lt11rPZhhTr50TwCkcafZTYp+tWVaJa4uHU77kFgfK+5W 9T2YQ27g0jwoJDLBobm+kKZQLdicb+tFfjTTLDKwGO62KZZMDKB/6UxEsYgt1T5xZ6lO peVg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Jl6Xb9W+; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="MU/kf40j"; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=lKTkOtsI; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id d9443c01a7336-20515549ec2si20670935ad.403.2024.08.30.07.19.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Aug 2024 07:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Jl6Xb9W+; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="MU/kf40j"; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=lKTkOtsI; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1sk2Sf-0003zP-Lu; Fri, 30 Aug 2024 14:18:49 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sk2Se-0003zJ-Hn for openvpn-devel@lists.sourceforge.net; Fri, 30 Aug 2024 14:18:47 +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: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8gDPSEgIH8RfyLzgvygqu/B8lY2kYEPeCGUmYA/gngY=; b=Jl6Xb9W++6T9pbMPNolL2L/k7b D3KBIQhg+svA3adWRbNIFYQtudrVdpglY1SN+xSbExF6YLG5XM7nv7BrxqPcjnDYSEHcjOLClbsSS uPsI28jlRjFgedbeOcpkbXsY9xM24AKI4FhNsI2o9kJLsWsdbahu4nVQI4xsVsidnqvs=; 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: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8gDPSEgIH8RfyLzgvygqu/B8lY2kYEPeCGUmYA/gngY=; b=MU/kf40jgSx9PfWvnlgmwNNOxK vRTQntnxdnUVVHXdSDXHf3C1vPSmq6WavR/6So+QGT3j4KrAluogfrEaT5P0j4sMxz81L/xUuLajT E5pWUHadWLAmc+iIr4xNxTH1HmlJIccJDFN2+tBxB/QCaEKStyPNowk9ReVE9eb7SaL8=; Received: from mail-qv1-f45.google.com ([209.85.219.45]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1sk2Sd-0006Jf-AH for openvpn-devel@lists.sourceforge.net; Fri, 30 Aug 2024 14:18:47 +0000 Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-6c352bcb569so1705936d6.0 for ; Fri, 30 Aug 2024 07:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725027516; x=1725632316; darn=lists.sourceforge.net; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8gDPSEgIH8RfyLzgvygqu/B8lY2kYEPeCGUmYA/gngY=; b=lKTkOtsISs8saAvvwHYhmQXyfmnmIDlHjpNCGop8T68iEXSCVTjOLuLgH7jCBNSia1 G2Rvo2uepzHzvyMjy1bWlNZavsbtYegBuwH82TFdCGkpdgSRLQ2JPOCGRplKm2gwNy7e gh4rmCYHeM++iOU/QDOBmbY1HhKdd94r5sD1KTVLr4tUCbbmPJ3SMeAwPhXQcW5cSKPk avKfrB0Ecd4zroepOd1kKztEJAl6/hzR1NK5HyLKAhd3am4xlYpoE7xxXzFtngbNqoeM 696ePj7zHfSvxRsmU/XZ585e+ngKYcwVrBIuhj7Rg22aV2OVaxOmF7xCU9PLxFmO3OfM oK3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725027516; x=1725632316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8gDPSEgIH8RfyLzgvygqu/B8lY2kYEPeCGUmYA/gngY=; b=qRjU7J9ADzL4pqEEklePgO9ASQqn+9s3MsiDDzQcuANCjaQ4e6CCPnIqAVCmAEXSNE 7C0IvvN9YfJupqUJ52WENa5xC2P3gJ/XBxHlBdfoWIfArlkgpI0RM3yUZgg1qf/RdGHK mU5nvcStbkmxzq7Hs2UoeTa4zJnyO9MT3v1D8n1hEySRZgwdw7+rJSmIQWXrsHDZjb0P a/Df8/MeAyqWuUpxJymEJyit0gFUpy9cPwhyv6JRADmQhpomklKnAyji82uHEj7moEQv DJdMZc9UseaehmQEzC0XJtEmROVIxbrEhavuf3k1rQHtntjR5ac2dR5rb4LmwTGh7PeB 8ONA== X-Gm-Message-State: AOJu0YyPkkOa+v9Z5mByEq6irNL2fZD+G+k56OgIDTCTei9InbM1OIVs 59GXc2dv7YDJBOiR99u2B5voX5G6oTu0g7qe950mHUz/k3CaX/72IwQAJfrj3uw= X-Received: by 2002:a05:6214:5b01:b0:6c1:6e5b:cbc4 with SMTP id 6a1803df08f44-6c33e6173b4mr78204506d6.24.1725027516143; Fri, 30 Aug 2024 07:18:36 -0700 (PDT) Received: from neptune.home ([70.48.195.99]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c340daf160sm14860546d6.137.2024.08.30.07.18.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 07:18:35 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Fri, 30 Aug 2024 10:18:24 -0400 Message-Id: <20240830141824.108599-1-selva.nair@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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 Change-Id: I41f6c1f7acb58f30fc4db0e32505018f64fcad28 Signed-off-by: Selva Nair Acked-by: Arne Schwabe Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] 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_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.219.45 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.219.45 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.45 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1sk2Sd-0006Jf-AH Subject: [Openvpn-devel] [PATCH v1] Add test for static-challenge concatenation option 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 X-GMAIL-THRID: =?utf-8?q?1808822487754241136?= X-GMAIL-MSGID: =?utf-8?q?1808822487754241136?= From: Selva Nair Change-Id: I41f6c1f7acb58f30fc4db0e32505018f64fcad28 Signed-off-by: Selva Nair Acked-by: Arne Schwabe Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/I41f6c1f7acb58f30fc4db0e32505018f64fcad28 This mail reflects revision 1 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Arne Schwabe Frank Lichtenheld diff --git a/tests/unit_tests/openvpn/test_user_pass.c b/tests/unit_tests/openvpn/test_user_pass.c index b43e655..35fe60d 100644 --- a/tests/unit_tests/openvpn/test_user_pass.c +++ b/tests/unit_tests/openvpn/test_user_pass.c @@ -311,7 +311,25 @@ reset_user_pass(&up); - flags |= GET_USER_PASS_INLINE_CREDS; + flags |= GET_USER_PASS_STATIC_CHALLENGE_CONCAT; + + expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Username:"); + will_return(query_user_exec_builtin, "c1user"); + expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:"); + will_return(query_user_exec_builtin, "c1password"); + will_return(query_user_exec_builtin, true); + expect_string(query_user_exec_builtin, query_user[i].prompt, "CHALLENGE: Please enter token PIN"); + will_return(query_user_exec_builtin, "0123456"); + will_return(query_user_exec_builtin, true); + assert_true(get_user_pass_cr(&up, NULL, "UT", flags, challenge)); + assert_true(up.defined); + assert_string_equal(up.username, "c1user"); + /* password and response concatenated */ + assert_string_equal(up.password, "c1password0123456"); + + reset_user_pass(&up); + + flags = GET_USER_PASS_STATIC_CHALLENGE|GET_USER_PASS_INLINE_CREDS; /*FIXME: query_user_exec() called even though nothing queued */ will_return(query_user_exec_builtin, true);