]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rxrpc: Fix rxkad token xdr encoding
authorMarc Dionne <marc.dionne@auristor.com>
Fri, 4 Sep 2020 17:01:24 +0000 (14:01 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:57 +0000 (11:55 +0200)
commit3a15888ff3dfb62a6839d1dcb08bf90aa33ab1d3
tree3f8f3943a84da26f4ce3b0ab011b543b1d7c866c
parent41d0598c0f437a39c10cbfc1ff12724f15568d28
rxrpc: Fix rxkad token xdr encoding

[ Upstream commit 56305118e05b2db8d0395bba640ac9a3aee92624 ]

The session key should be encoded with just the 8 data bytes and
no length; ENCODE_DATA precedes it with a 4 byte length, which
confuses some existing tools that try to parse this format.

Add an ENCODE_BYTES macro that does not include a length, and use
it for the key.  Also adjust the expected length.

Note that commit 774521f353e1d ("rxrpc: Fix an assertion in
rxrpc_read()") had fixed a BUG by changing the length rather than
fixing the encoding.  The original length was correct.

Fixes: 99455153d067 ("RxRPC: Parse security index 5 keys (Kerberos 5)")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/rxrpc/key.c