]> git.baikalelectronics.ru Git - kernel.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)
committerDavid Howells <dhowells@redhat.com>
Mon, 5 Oct 2020 15:33:28 +0000 (16:33 +0100)
commitd8c1b6b2d768950de084cf48ecf69c1461d1c3f1
treefbba433f6f0b290d1c97ea775abadbe7eec20ad5
parentf08e6f99cebe660efd5cd07efbd8dd70134d87e4
rxrpc: Fix rxkad token xdr encoding

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 eb012c9d5ef93 ("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: 35cef4351aa0 ("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>
net/rxrpc/key.c