aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/rxkad.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-09-16 08:19:12 +0100
committerDavid Howells <dhowells@redhat.com>2020-11-23 18:09:29 +0000
commit41057ebde0025b0179b852dd785c9f3f0f08adad (patch)
tree38c65bf6981af9039860c4e1d4cbf930a041550e /net/rxrpc/rxkad.c
parentrxrpc: List the held token types in the key description in /proc/keys (diff)
downloadlinux-dev-41057ebde0025b0179b852dd785c9f3f0f08adad.tar.xz
linux-dev-41057ebde0025b0179b852dd785c9f3f0f08adad.zip
rxrpc: Support keys with multiple authentication tokens
rxrpc-type keys can have multiple tokens attached for different security classes. Currently, rxrpc always picks the first one, whether or not the security class it indicates is supported. Add preliminary support for choosing which security class will be used (this will need to be directed from a higher layer) and go through the tokens to find one that's supported. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to '')
-rw-r--r--net/rxrpc/rxkad.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index f114dc2af5cf..404d1323c239 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -49,15 +49,14 @@ static DEFINE_MUTEX(rxkad_ci_mutex);
/*
* initialise connection security
*/
-static int rxkad_init_connection_security(struct rxrpc_connection *conn)
+static int rxkad_init_connection_security(struct rxrpc_connection *conn,
+ struct rxrpc_key_token *token)
{
struct crypto_sync_skcipher *ci;
- struct rxrpc_key_token *token;
int ret;
_enter("{%d},{%x}", conn->debug_id, key_serial(conn->params.key));
- token = conn->params.key->payload.data[0];
conn->security_ix = token->security_index;
ci = crypto_alloc_sync_skcipher("pcbc(fcrypt)", 0, 0);