From patchwork Thu Mar 28 08:56:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3675 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:5a41:b0:55c:c090:46f0 with SMTP id w1csp1023792may; Thu, 28 Mar 2024 01:56:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWyjfz7O2F1Oxwgd9wdTCUrn5oNNvgAvtSvWyULHhUexo1ieav6FdMjpTPhkl+Chtpz0SVqA++68BB9tmqWGWmNJ7uyx+Y= X-Google-Smtp-Source: AGHT+IHAItdUxq6Ap8LRuWXD+1txtmCJpNFx+JynQtYo7t06v413zMth+L91J5+zFnWdrRiFHmeU X-Received: by 2002:a05:6a21:7881:b0:1a3:66d8:d978 with SMTP id bf1-20020a056a21788100b001a366d8d978mr2431531pzc.3.1711616219482; Thu, 28 Mar 2024 01:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711616219; cv=none; d=google.com; s=arc-20160816; b=D4jii+rXHM/ySssMz+boqq/zfbRrub5ZwwG1beHdq9wQtjv4JCsOMqxJ6SXOUGpGWF gCYK5VgWOdDVx1Inhe72pzOceImzw9qMajW07eUmV2v8mHbmrjk6o948odpKm0s7jDvl 209ctyAjZAgKvwSYSnQgQyZ/dKEWFIh0iKw8N/L8E7mDJmIsfMzsXB5ZztMfEs2NMcll /Z+SHhEqQ5E3e6e++OOj2tKeAVYywJStD4OTKMKzFpdlTvYw5fki199bV/ZF3PXxYYEB eJr2uc6qOctmWQ9dXXigEEYtXuKJ0lloTgqoc9Q04m0cqlr2NTHert2C6Je4kdUVY96W oNgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=snExuMQARnMpOfKO5K90OQJGMDu/UPLzomo4AwK3AnM=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=GTeiwc6F96yubBInGYtnJDTfBMVQXCF5mPcb24L1cJO4QkJEEraFFRJltLJAFZYYpD wl05+h2Ze2nv6HBRAjZiDz/R2i9vN0C/QxSWfRnVWa/xRTI70PA8zIHK5Vgsd3QcV0EC CoF53DxVFfiPtrTgbEspv828n9QPj7AXfNYpIIMzzUbS2Z4MpN2AgAasq27EZhRDEFT/ 8VhdX1ZLzh338k3xW5n6gzp01rYcZ4RPRf+fTbZg65ii0Sim6We8q+Le59TdIGzviGSB EIC045IQAW2ZtztcEfj+uKwHngllcneRwLgIYGBIMKp40BsH2L7qRS+v4a7Vk92Lb9Oj U9Mg==; 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=fFfrqlDM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=MNsBQXYA; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=BPWAnmGL; 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=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id s25-20020aa78d59000000b006e6ac8fd9dcsi1041200pfe.288.2024.03.28.01.56.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2024 01:56:59 -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=fFfrqlDM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=MNsBQXYA; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=BPWAnmGL; 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=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rplYs-0004qB-O7; Thu, 28 Mar 2024 08:56:39 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rplYr-0004pn-La for openvpn-devel@lists.sourceforge.net; Thu, 28 Mar 2024 08:56:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yxjoikMUPtD7xS/H2Giq9T0gd3VMhVHUtBVV1BarZ8Q=; b=fFfrqlDMz2257H9wqt/m+l8HHs qRa4kSo6OwFr42eQoECwmo9Tm7oMaPTZ01y+jGlmhImhEfjgF27VJVsIv1R/Xoo7TdyEcewuiubzO TXfuQA3zl2Lcsf7XziL0Wuo2PE1O/SepXhtjSNTv7auA43ZOrkB3nvWHeWKCGFxvQp0M=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=yxjoikMUPtD7xS/H2Giq9T0gd3VMhVHUtBVV1BarZ8Q=; b=M NsBQXYA5LylDmII3cKEL7B74oznFltwEUreyLYBpfshlW6se8ncxLrm0JBFGojUiczraq3soMqDN4 ZY7ISMTpYRRStfDtT21KSNwh7nbebb0RiuTtJwZe6c4P3zj/2Q2OmiM/WerWdwCyncAtSnwf1OfLc GOxJdjZ5TaLST9IE=; Received: from mail-wm1-f52.google.com ([209.85.128.52]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1rplYp-0000Le-Uz for openvpn-devel@lists.sourceforge.net; Thu, 28 Mar 2024 08:56:38 +0000 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4149749cc36so5191805e9.0 for ; Thu, 28 Mar 2024 01:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1711616190; x=1712220990; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=yxjoikMUPtD7xS/H2Giq9T0gd3VMhVHUtBVV1BarZ8Q=; b=BPWAnmGLSIRv43/6dFZk/+IMUnkGra1h5cQDosUYti3JBaimvPDYgWmhQh0GLPbRYW 4kLeDdQ65VmVCJsQoq2dC2ucuU7w5bccij8SNCkBMPOfydkldAETPl+ihaXEI6tKddng r+OjQHX7J2LbHO6kyuHGnCFEs0V68w00st6GnHQVIwqFlqt3piUuXxziuL+LkW8ox/Mx 6JRsJ6lt/Cv0567/5WxISKvi6wOZNDaGPT1dljLTYcpIZfkqraGqMzBRJH4PMeZbAVLj +wNx0J/XL80OX9N6MKix729D46QzijJYA6LMSoOPzzwQ/dEstWbAXlpjTTp9YKZMrMDE eA6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711616190; x=1712220990; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yxjoikMUPtD7xS/H2Giq9T0gd3VMhVHUtBVV1BarZ8Q=; b=wZR6qVArATY2OUI1C8u+V5nT4FZ2KnQw2mXhemYobX0wXu6KR+Tc2xV9vU6Op7Fhfq tl4ru4PBFfqs9msieOKdBSBNgpAcZW1RvrbNdHZkpv2rfVnIF+6Y9ZHwCwZSmklCzx/5 wmDfhtJ+TQvFnC1qnE2f4Spf1i1oss7yB4eDjR8RwYZiK2ZR81Eeg1VsE73NxsX3spDn MvRXzgSE3sMBkXboldUPaENdhgVT1h3aHN3mDHxsu5rfpJzSVAB4HJy4LvlIhegAWgFS PY2wE+xRc5HLriU7IDhrCDa/adVzeWN7PF9q4bzqh0fVUT7cr98+OwC8hQengbfFTYIi ubfQ== X-Gm-Message-State: AOJu0Yw80+8ZPmUR/jv7UyVMXRO5kOdG63KChv0Li4T1q+aPWvV0bOn4 2k5pnf/WiSx//1ZPx+gndw8FlHRkiPbzsU6TbMS/g5WKsHOxEZTYKRjfd2SdM1n1XVoTa0l/pSn P X-Received: by 2002:a05:600c:4e4c:b0:413:e6d5:4e8b with SMTP id e12-20020a05600c4e4c00b00413e6d54e8bmr1713814wmq.26.1711616189384; Thu, 28 Mar 2024 01:56:29 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id h9-20020a05600c314900b004147b824b08sm1616395wmo.7.2024.03.28.01.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 01:56:29 -0700 (PDT) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 28 Mar 2024 08:56:28 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4 X-Gerrit-Change-Number: 550 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 754e6a60613b5e94b2c78cc0454e4dd8b7d8937a References: Message-ID: <1c308cef2c0a2ecefac6a7d4ee097fd31d35bb86-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 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: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit 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.128.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.52 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.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -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.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.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1rplYp-0000Le-Uz Subject: [Openvpn-devel] [S] Change in openvpn[master]: 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: , Reply-To: lstipakov@gmail.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1794759689021519176?= X-GMAIL-MSGID: =?utf-8?q?1794759689021519176?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/550?usp=email to review the following change. Change subject: misc.c: remove unused code ...................................................................... misc.c: remove unused code 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 Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4 --- M src/openvpn/misc.c M src/openvpn/misc.h M src/openvpn/ssl.c 3 files changed, 5 insertions(+), 17 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/50/550/1 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