From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796161371; b=lsvURPZ46pdSCsqTI/f5QZ2pyzMgzE6OeSWhQH68vNBtFFphUtpfOrCayt++o4FRAr05 wwF3yZj+SHpGit41CKOyo0CH1IpL0kpQi51+fRoqYz6ILwRKc0HuFWiWvtUsNvxLKjAiL Nr8JIaKe7X3yLtAJSOXNDG6h+R308NlI5SgorqDBFFFeUnl7g4I43bxml8vQQSW42UG/3 bOTeSBPgJ2Kz2INRKx4/eNACub/2cdGx2N3LFLbaTj5yRlM1xbhjbGpkoKSCTZShBfKTf uFgR7MkwMBINJk9Z11FsP3YhLysvovbZ9tunvQti+T5TW38juSkaidnuJvtBqR6qPNQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796161371; h=Received:DKIM-Signature:From:To:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=Lsa8eudVIEXbJnYqaWDFswKNWdwGjSw8yQHPNXUmwRA=; b=oEmR3Dj6OoosmI6x+9AltwLAXi8cIcd/1Z08GOqkIJLwxqX9HM8RmQuxKY8YGTpZ7Hom uGmQIc4EfDOBirBm2+FoIek8uL2pIgzzbjPQlntUQcIwgHp/2+5up/n3Ni7CmQsxx5D24 ErH+HTAxV5WKqCGxsq8K32gdwkol3KMEMoE8TAcM9MTXbYXt7o0s2GuVK+j3zowv6+WsG WrA3G0a66KgsGv8kT35CMSmmRKhyvbREGfwNleurNZFK5X+P1V87MgpMzAv2j9Zwx+nR4 43jk/IB6T5QgMU9zGdDEd0hkiyGCpGiiWsxKeNklBShE0efVl93C2cDefoZF2a4B7Uw== 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=O8TooSIj; 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 CC060606A32A for ; Tue, 1 Dec 2026 21:42:51 +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=O8TooSIj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EC231F00899 for ; Tue, 1 Dec 2026 21:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796161371; bh=Lsa8eudVIEXbJnYqaWDFswKNWdwGjSw8yQHPNXUmwRA=; h=From:To:Subject:Date:In-Reply-To:References; b=O8TooSIj3THjGYGkMjwnLkQDxtp02gU/i5bq4aEPnjUCD0o6BESD38ku/STwxSjHm m4kzAcWCJxCzzAsGy2tcK8eNqqq1i/qI20jCUuqkPsN8SEoI8Zp4JCRfKIGbCSJtGi 2ZYv+XGpi+Mvvb/lmVKiFCzowPFrwWu5WG9zEXkqsXrTbPGM82fX2Vk+aFnVFDtcOu fOCfKStb8YluPq/4I4bkoaiKEy/zIQ1otMQ09T70J4vWOse+lKEzNNJfIqO8aCHqhL ettIz2trgptDPsbI9+aKHaHliVRxfqsi4tUvIK+H7Vd8+VCDYIpaB03mU/35oCCDRX 7AxyCiZhuUwbg== From: Chuck Lever To: Subject: [PATCH v1 4/9] tlshd: Accept only "psk" keys in the QUIC server PSK callback Date: Tue, 1 Dec 2026 16:42:43 -0500 Message-ID: <20261201214249.296675-5-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 When no "psk" key matches the identity a QUIC client offers, tlshd_quic_server_psk_cb() searches for a "user" key with that description and uses its payload as the PSK. Keys of type "user" are not provisioned as PSKs, and some of them carry public data. nfstlskey stores each certificate as a "user" key named ":cert", and systemd puts an "invocation_id" key in the session keyring of every service it starts. A client that offers one of those descriptions as its identity, with the public payload as the key, completes the handshake, and tlshd reports the key's serial number to the kernel as the authenticated peer. Search only for keys of type TLS_DEFAULT_PSK_TYPE, as tlshd_server_psk_cb() already does on the TCP path. Fixes: 43a15fed2f33 ("tlshd: add support for quic handshake") Signed-off-by: Chuck Lever --- src/tlshd/server.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/tlshd/server.c b/src/tlshd/server.c index 341b047cc894..ab6d7b3b93c2 100644 --- a/src/tlshd/server.c +++ b/src/tlshd/server.c @@ -727,17 +727,12 @@ static int tlshd_quic_server_psk_cb(gnutls_session_t session, const char *userna key_serial_t psk; long ret; - ret = tlshd_server_psk_search("psk", username); - if (ret >= 0) - goto found; - - ret = tlshd_server_psk_search("user", username); + ret = tlshd_server_psk_search(TLS_DEFAULT_PSK_TYPE, username); if (ret < 0) { tlshd_log_error("key search error %d %s", errno, username); return -1; } -found: psk = (key_serial_t)ret; if (!tlshd_keyring_get_psk_key(psk, key)) { tlshd_log_error("key load error %d", errno); -- 2.56.0