Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796161372; b=RGx3yESOz1jjZb5fFt0ZDR65t+DtmNlVta1AuLFwYh86LjSUTwT8uWO+plkTdvtxD7s/ +KjHoTekFcOeC5g+Su1HyfL82pV6FLBPDXkgo2CrEMC34If4pEZNsLLtt3z1Cpa/Wzgfp F36YmEPcs3pmqI95PdABn1xHuPD4xf9En0zSAMPlTn0LC0x7Ei1Zm33ikyKdE079rmq8A jnuePVRVNiX+7NkHQdbE1vMirrxqd3MVUByWyEYuNFLRxSuq0w4PAOe6OkKvQwiUMzu0n +N/g/h0lNlvlfwrOAD7KIozLsAOpzyT7U0pR96umQByCHN8oOgdJMTLC19bJvfUdoWg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796161372; h=Received:DKIM-Signature:From:To:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=74iuYxZQUjDB7HV8vritDKyRoxoWxbe2sF3yP6vJrDg=; b=NQwZXPUrf4Od45RjGLC4uZoYB5bw8NeWW1JFzHm4CBDj05Mrd2ijOvCoFnekromy/vjc 8FvENcFPXp/HaCEMrg105ovfYxwSaZ8CTXc7Pi7yUVau88rIXNVArYV/78S4+biE++geE aGnDOGMvH72QIoCMtB3kUXNOUzbgTOxA9kgSWznrv6E8ZcemvyOkdSQX9KiZklsWK242Q km9nEbDpU05NP7oczqL56pHSsqnTJEtzdHtOCJgMp1S93dNdZlzc11KLnYFtZUfubVwPW cPadBfMh5OWee17HU8XcBzyZu5LSH+TW9JtBvTCqhn9PgLAXSrUlDFmHhGTzXYkp5aw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GyUiizFi; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7F4E606A31A for ; Tue, 1 Dec 2026 21:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GyUiizFi Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49A371F00897 for ; Tue, 1 Dec 2026 21:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796161372; bh=74iuYxZQUjDB7HV8vritDKyRoxoWxbe2sF3yP6vJrDg=; h=From:To:Subject:Date:In-Reply-To:References; b=GyUiizFiqrO4Np3Is/v762P+3tqOx8B4OjVMkxA5m+gvLlV/QjhjBv35VjYY4XYOt U9VPS4jNG8sJQlSVwbIHN1vLIgOR1Z8RMzqhSUwb9AcvU9hLqUkK6kcGqwEl9e0QAe FwH49gVU4e8NEyoMQ+TWSiDFn/VzOuVcSJtKPlrhDWqyY4f1EfEIzsiDV6xjNjzEVc EZ4so9iFBn5Io5I7pwmofOgxE9WVR9PK8J9xJ5k4urvc+DQTJ3HViy3ZC+kOjPd3OV AIjQXjua7AQTsvdIweFePFq5gfed1OMAU/rW/XYT3YznyQ00B47jP8Y/XejCMRhRKe spn8MuzpbHQtQ== From: Chuck Lever To: Subject: [PATCH v1 6/9] tlshd: Fix the direction of the certificate validity filters Date: Tue, 1 Dec 2026 16:42:45 -0500 Message-ID: <20261201214249.296675-7-cel@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261201214249.296675-1-cel@kernel.org> References: <20261201214249.296675-1-cel@kernel.org> X-Mailing-List: kernel-tls-handshake@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit tls-session-tags(7) documents that an x509.tbs.validity.notBefore filter matches when the certificate's activation time is equal to or later than the threshold, and that an x509.tbs.validity.notAfter filter matches when the expiration time is equal to or earlier than the threshold. Both match functions compare in the opposite direction. A notBefore filter written to admit only certificates issued after a CA key rotation instead admits only those issued before it, and a notAfter filter meant to admit short-lived certificates admits only long-lived ones. Reverse both comparisons to match the documented behavior. Fixes: f11519ab4a45 ("tlshd: Match ingress certificates with defined TLS session tags") Signed-off-by: Chuck Lever --- src/tlshd/tags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tlshd/tags.c b/src/tlshd/tags.c index 0491ca62b0d7..cd0004fce4f8 100644 --- a/src/tlshd/tags.c +++ b/src/tlshd/tags.c @@ -1559,7 +1559,7 @@ tlshd_tags_filter_type_match_x509_tbs_validity_notbefore(struct tlshd_tags_filte goto deinit; } - res = (filter->fi_time >= activation_time); + res = (activation_time >= filter->fi_time); tlshd_log_debug("Filter '%s' %s validity.notBefore '%s'", filter->fi_name, @@ -1595,7 +1595,7 @@ tlshd_tags_filter_type_match_x509_tbs_validity_notafter(struct tlshd_tags_filter goto deinit; } - res = (filter->fi_time <= expiration_time); + res = (expiration_time <= filter->fi_time); tlshd_log_debug("Filter '%s' %s validity.notAfter '%s'", filter->fi_name, -- 2.56.0