From patchwork Thu Mar 26 06:23:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1052 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id KLwdK1rlfF5BOgAAIUCqbw for ; Thu, 26 Mar 2020 13:24:42 -0400 Received: from proxy6.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id +KH5KlrlfF46WgAAalYnBA ; Thu, 26 Mar 2020 13:24:42 -0400 Received: from smtp29.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.ord1d.rsapps.net with LMTP id yBSAKlrlfF6QXgAAQyIf0w ; Thu, 26 Mar 2020 13:24:42 -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: smtp29.gate.ord1d.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; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: acfc798c-6f86-11ea-8e05-525400f257a9-1-1 Received: from [216.105.38.7] ([216.105.38.7:37856] helo=lists.sourceforge.net) by smtp29.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 8C/0B-30216-955EC7E5; Thu, 26 Mar 2020 13:24:41 -0400 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 1jHWEQ-0004e9-7l; Thu, 26 Mar 2020 17:23:50 +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 1jHWEO-0004e1-LL for openvpn-devel@lists.sourceforge.net; Thu, 26 Mar 2020 17:23:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=Ceyk6OzJ853KzZ0kDaqxHi6A8/P5Klg3D/J/xPoAuhY=; b=iqav5OJJb4e1ojdCnokEsG7RSY 2AqYfE4ULAdeiH5QMwiWIz3seaARNGNcVLOEvUxehOD3t3OnzQGF4qHxijqQFsWyqbM+u74VIO7ZK nWFSGCOLNrSwcTei6AtYhcf1tyExydmqZpzX1GVu0VnUTl+89EzjuBU8l7jQnDbWH5hk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding: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=Ceyk6OzJ853KzZ0kDaqxHi6A8/P5Klg3D/J/xPoAuhY=; b=VRSg7E8TQR4NMvgiYL7FPP67LF W7CnTLaQESOnES40IF+5rf4InGZxvIGUReIQ+Cd5iA18xHaux0D7YxBP5QsfAJGwNKdoCtQBKf8t8 CXEf6HClR3WcK8GyCV8qDiyJYcFpPDftSqFirKLx0kgc3Bk1g0qij/U0+NOMZiLcIxnw=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jHWEI-000nit-0C for openvpn-devel@lists.sourceforge.net; Thu, 26 Mar 2020 17:23:48 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1jHWE8-000DaT-UQ for openvpn-devel@lists.sourceforge.net; Thu, 26 Mar 2020 18:23:32 +0100 Received: (nullmailer pid 2404 invoked by uid 10006); Thu, 26 Mar 2020 17:23:32 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 26 Mar 2020 18:23:31 +0100 Message-Id: <20200326172332.2356-2-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326172332.2356-1-arne@rfc2549.org> References: <20200326172332.2356-1-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1jHWEI-000nit-0C Subject: [Openvpn-devel] [PATCH 2/3] [Auth-token] Fix session id in env missing first byte 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox sizeof for a constant string return the size including the null byte. For copying the session id this meant that we do not copy the first byte. This made the session id reported to the external authenticator one byte shorter than it was indented to be. Acked-by: Gert Doering --- src/openvpn/auth_token.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c index 6275299d..585679dc 100644 --- a/src/openvpn/auth_token.c +++ b/src/openvpn/auth_token.c @@ -121,7 +121,7 @@ add_session_token_env(struct tls_session *session, struct tls_multi *multi, */ char session_id[AUTH_TOKEN_SESSION_ID_LEN*2] = {0}; - memcpy(session_id, session_id_source + sizeof(SESSION_ID_PREFIX), + memcpy(session_id, session_id_source + strlen(SESSION_ID_PREFIX), AUTH_TOKEN_SESSION_ID_LEN*8/6); setenv_str(session->opt->es, "session_id", session_id);