From patchwork Fri Mar 29 10:37:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3676 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:5a41:b0:55c:c090:46f0 with SMTP id w1csp1674791may; Fri, 29 Mar 2024 03:38:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWfWxQhQMGoZjEph50b5OLrOlc6+Zaxq6SjIzRDzL04axTLNO21FbjP3WPdLsVbG4qn9QqwpzL1Zw/pJvbVY2Us6xQ7zvo= X-Google-Smtp-Source: AGHT+IEi5/9FL6zz7Z8yz0G36ZP6jR1HMf1vF3hf7KMC0aA6LEXN1TM0nGoDjU5hKBmaA/35XKUc X-Received: by 2002:a17:903:11c6:b0:1dd:da28:e5ca with SMTP id q6-20020a17090311c600b001ddda28e5camr2067935plh.0.1711708702796; Fri, 29 Mar 2024 03:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711708702; cv=none; d=google.com; s=arc-20160816; b=pqcVbbRq13Q9AhRbiGLaop6vIDHZEv2uvGKJzjsg7jP9Z8cfIJkMSSbvy8mfGqL5WF +U0B9PyrYcxdGR+7OcKbXGZiRDfnzXm5JoWUoy9dyalALMpPBpv1pWIzDu3OP+CPsUGP hlT2nXzne5iuv1owY073W0krxFY0LEorvwjDcVHrF9uYOBBCDN9cWsL6cp8wptZPxfSI aTazY5lbGW4h9Gu6CD0ryDXx0khuIqU20gP9ewLMCRO6Ayk0Wyl+847JFL7D58+SZH7J c1ZkT+aVzidgosfUId9WA8X4uALRfWL6xRpBINraIz0Z71tnLOeaAYoOypgvS5vOjiJQ KlNg== 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; bh=Ogtwe7XRWMD1+/zj9A7pE4We9uYDSEhXPPLZxzXRfwE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=e+TFDf2vgfOP1aIcOCSO9cqVQxTG4fwjHsi1XEjQxMvCe3H2EAk09nKPLDA0alWc3V dRNbb8YsN118GyU5zgJv+dQHPV8nQPFE4N1Gk54zFms6yx1TDqv2mja/gG6GWZvdOnOj by3r4qTW5Zd59bbcUStY777J3+rqBIWWpAME2tK9udjYOiOvlhhXD5fVq3P7YAab6UjF M07g1Fieggz2rIAeHFqWYJkAiAYZBBPOn7uLYLBNlo9S+wmsSx5V/OU01w03LogLo1be szV1d5O+m7lnK8urqM+xkWWiD2o2ibl1JjF50GDiLKzqMPEcW06gMmaP/5G7RMlRoeon 4ERA==; 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=KkeqepJC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=mcBMBqOz; 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=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id c9-20020a170902d48900b001e037850f90si3496260plg.533.2024.03.29.03.38.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2024 03:38:22 -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=KkeqepJC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=mcBMBqOz; 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=NONE dis=NONE) header.from=muc.de 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 1rq9cS-00036K-Dz; Fri, 29 Mar 2024 10:37:56 +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 1rq9cQ-00035y-IK for openvpn-devel@lists.sourceforge.net; Fri, 29 Mar 2024 10:37:54 +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=uVTYl0+kTQTbuRh084Gh7+yLN4Q5yQ9r4lzISju9laU=; b=KkeqepJCvxCtDYJyd9d5niEP2B RWqlQtgg12aDR7+DrnqOxs0yo8eeGGBgJlrgq464s0pQSWBFFASV+RTE8kycgRanZyJDNqyLr9uCd xF6n1iKpd99JeNTCJdWpClD7DoFNPsENEKLN4clyG1OLyn8Q08EZyeWuVGiVyw3nXigw=; 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=uVTYl0+kTQTbuRh084Gh7+yLN4Q5yQ9r4lzISju9laU=; b=mcBMBqOziS1jLxNyKV/1IKEApf yG+Z0KCR5B8zpnSN+wJd7YaJzcreeDIkbByFnDTp45yJC6rycKH7yt7uJlXI/Ir/9tOLue4WK+V/k fwPuQbyd8grCPTEkw0Xn+LfQpYKeu0tgINqP2CfqsbEmrIDS4yZyHg4hKVxAxWsqa4sA=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rq9cO-0007Wk-FM for openvpn-devel@lists.sourceforge.net; Fri, 29 Mar 2024 10:37:54 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 42TAbecK028264 for ; Fri, 29 Mar 2024 11:37:40 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 42TAbed1028263 for openvpn-devel@lists.sourceforge.net; Fri, 29 Mar 2024 11:37:40 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 29 Mar 2024 11:37:39 +0100 Message-ID: <20240329103739.28254-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.43.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.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: Lev Stipakov Commit 3a4fb1 "Ensure --auth-nocache is handled during renegotiation" Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1rq9cO-0007Wk-FM Subject: [Openvpn-devel] [PATCH v1] misc.c: remove unused code 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?1794856664676004894?= X-GMAIL-MSGID: =?utf-8?q?1794856664676004894?= From: Lev Stipakov Commit 3a4fb1 "Ensure --auth-nocache is handled during renegotiation" has changed the behavior of set_auth_token(), but left unused parameter struct user_pass *up Remove this parameter and amend comments accordingly. Also remove unused function definition from misc.h. Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4 --- 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/+/550 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c index 3ff0857..598fbae 100644 --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@ -491,19 +491,15 @@ } void -set_auth_token(struct user_pass *up, struct user_pass *tk, const char *token) +set_auth_token(struct user_pass *tk, const char *token) { - if (strlen(token)) { strncpynt(tk->password, token, USER_PASS_LEN); tk->token_defined = true; /* - * --auth-token has no username, so it needs the username - * either already set or copied from up, or later set by - * --auth-token-user - * If already set, tk is fully defined. + * If username already set, tk is fully defined. */ if (strlen(tk->username)) { diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h index cb3bf68..963f3e6 100644 --- a/src/openvpn/misc.h +++ b/src/openvpn/misc.h @@ -152,26 +152,18 @@ return get_user_pass_cr(up, auth_file, prefix, flags, NULL); } -void fail_user_pass(const char *prefix, - const unsigned int flags, - const char *reason); - void purge_user_pass(struct user_pass *up, const bool force); /** - * Sets the auth-token to token. If a username is available from - * either up or already present in tk that will be used as default - * username for the token. The method will also purge up if + * Sets the auth-token to token. The method will also purge up if * the auth-nocache option is active. * - * @param up (non Auth-token) Username/password * @param tk auth-token userpass to set * @param token token to use as password for the auth-token * * @note all parameters to this function must not be null. */ -void set_auth_token(struct user_pass *up, struct user_pass *tk, - const char *token); +void set_auth_token(struct user_pass *tk, const char *token); /** * Sets the auth-token username by base64 decoding the passed diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 7895a37..7c49451 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -340,7 +340,7 @@ void ssl_set_auth_token(const char *token) { - set_auth_token(&auth_user_pass, &auth_token, token); + set_auth_token(&auth_token, token); } void