From patchwork Sat Sep 17 04:08:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2766 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id cGKKGx7VJWNWBQAAIUCqbw (envelope-from ) for ; Sat, 17 Sep 2022 10:09:34 -0400 Received: from proxy10.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id 2Gl/Gx7VJWMOQgAAovjBpQ (envelope-from ) for ; Sat, 17 Sep 2022 10:09:34 -0400 Received: from smtp10.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.iad3b.rsapps.net with LMTPS id EADHFB7VJWPZKQAA/F5p9A (envelope-from ) for ; Sat, 17 Sep 2022 10:09:34 -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: smtp10.gate.iad3b.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=unstable.cc; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 5acf2602-3692-11ed-9abf-52540055034d-1-1 Received: from [216.105.38.7] ([216.105.38.7:39070] helo=lists.sourceforge.net) by smtp10.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AD/B9-31335-E15D5236; Sat, 17 Sep 2022 10:09:34 -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 1oZYUt-0005xG-Qp; Sat, 17 Sep 2022 14:08:43 +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 1oZYUs-0005x3-TM for openvpn-devel@lists.sourceforge.net; Sat, 17 Sep 2022 14:08:42 +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:Cc:To:From:Sender:Reply-To: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=YJ6bZ57m2rMIJ7Bu+7jWJyC576uJQKn64Qr4K86kCBk=; b=XXTNeQWpRJSbL5KlUKErHOWkJy Qk0TE42S1Cki23CT5+GvsQUaEBNkN6d4lRt7/PSvnoIKLjIaM1sA13B46ZIXQ4GNe7UmJWqlRoxdP ggsyEp8e6ijSoUVzhYg+DeMWbrZABD6ni8bdQCQ+unjWJUINZXXDPBVaZLvUREHwsyJs=; 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:Cc:To:From :Sender:Reply-To: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=YJ6bZ57m2rMIJ7Bu+7jWJyC576uJQKn64Qr4K86kCBk=; b=e McHlh9T24uD3O9zcqoqxYDJ0cYWePSzPNZvYb0I5ggIdtmICxOCFQZbK5DGpyAMz3JhgAwCS13Qqo t476KkOsw+Jlx4VqEdFvcls+z6pn65eiscNuQZUELybicz+VGBzVCsBPhOnIqtnUpo4w3TTT+zGER gMIjbDNbUledCvsQ=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oZYUp-00BH0P-6Q for openvpn-devel@lists.sourceforge.net; Sat, 17 Sep 2022 14:08:42 +0000 Received: from smtpauth1.co-bxl (smtpauth1.co-bxl [10.2.0.15]) by wilbur.contactoffice.com (Postfix) with ESMTP id 0F07A99C; Sat, 17 Sep 2022 16:08:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1663423713; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:Cc:Date:Message-Id:MIME-Version:Content-Transfer-Encoding; l=716; bh=YJ6bZ57m2rMIJ7Bu+7jWJyC576uJQKn64Qr4K86kCBk=; b=ffMKLiR4AxYoVn5I/C56UFWeRn0PI20x3jiOgFhco89BmdB8X8HRl9L3JxRTnJ6J YQHg7SMBGnzoYrHU1e22vjPj8HJ/ZeSzAmgu9UAzvf4dAD56xsApwN5tRW+s1B7PlSb HIPVpFeG1yQPGsLE2OBi2ICY/+91wl9D+hqbq8Lx7IXhZjpgu86/d4rIN2cIqAPSv99 RMORUVJFsYy7cu22upegBtYULfUg2VP7TrxpKp7q/5ed6meRqRF8SQmnpU5RtMjVUng r8RH7Jrpd6pm2Jmsu6F9tGyOLdVOZYrjGUdu+jF/q8PQUnKLQKWBce0irHUKzZ331F/ dMkAm7k/ZA== Received: by smtp.mailfence.com with ESMTPSA ; Sat, 17 Sep 2022 16:08:30 +0200 (CEST) From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 17 Sep 2022 16:08:18 +0200 Message-Id: <20220917140818.6155-1-a@unstable.cc> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED, BAYES_00 device=10.2.0.20 X-ContactOffice-Account: com:375058688 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: Michael Karvan Signed-off-by: Michael Karvan --- src/plugins/auth-pam/auth-pam.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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: unstable.cc] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.3.242.68 listed in list.dnswl.org] 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1oZYUp-00BH0P-6Q Subject: [Openvpn-devel] [PATCH] Add common_name to the conv method. This allows the common_name to be accessible in PAM. 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: Michael Karvan Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Michael Karvan Signed-off-by: Michael Karvan --- src/plugins/auth-pam/auth-pam.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c index 70339445..9f37c8c0 100644 --- a/src/plugins/auth-pam/auth-pam.c +++ b/src/plugins/auth-pam/auth-pam.c @@ -746,8 +746,15 @@ my_conv(int n, const struct pam_message **msg_array, } break; - case PAM_ERROR_MSG: case PAM_TEXT_INFO: + aresp[i].resp = strdup(up->common_name); + if (aresp[i].resp == NULL) + { + ret = PAM_CONV_ERR; + } + break; + + case PAM_ERROR_MSG: break; default: