SUNRPC: Parametrize the key length passed to context_v2_alloc_cipher()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 15 Jan 2023 17:22:24 +0000 (12:22 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 20 Feb 2023 14:20:42 +0000 (09:20 -0500)
commit8b3a09f3454240cb2c2ab3da02b86f354aab0bd6
tree88217a5facdb55417e166b7b09caf97e78a3003f
parentec4aaab39afcec749ff7ed78e560213ff9e1c23c
SUNRPC: Parametrize the key length passed to context_v2_alloc_cipher()

Although the Kerberos specs have always listed separate subkey
lengths, the Linux kernel's SunRPC GSS Kerberos enctype profiles
assume the base key and the derived keys have identical lengths.

The aes256-cts-hmac-sha384-192 enctype specifies the length of its
checksum and integrity subkeys as 192 bits, but the length of its
encryption subkey (Ke) as 256 bits.

To support that enctype, parametrize context_v2_alloc_cipher() so
that each of its call sites can pass in its desired key length. For
now it will be the same length as before (gk5e->keylength), but a
subsequent patch will change this.

Tested-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/auth_gss/gss_krb5_mech.c