Skip to content

Commit

Permalink
rxrpc: Allow security classes to give more info on server keys
Browse files Browse the repository at this point in the history
Allow a security class to give more information on an rxrpc_s-type key when
it is viewed in /proc/keys.  This will allow the upcoming RxGK security
class to show the enctype name here.

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
dhowells committed Nov 23, 2020
1 parent d2ae4e9 commit d5953f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/rxrpc/ar-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ struct rxrpc_security {
/* Destroy the payload of a server key */
void (*destroy_server_key)(struct key *);

/* Describe a server key */
void (*describe_server_key)(const struct key *, struct seq_file *);

/* initialise a connection's security */
int (*init_connection_security)(struct rxrpc_connection *,
struct rxrpc_key_token *);
Expand Down
4 changes: 4 additions & 0 deletions net/rxrpc/server_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ static void rxrpc_destroy_s(struct key *key)

static void rxrpc_describe_s(const struct key *key, struct seq_file *m)
{
const struct rxrpc_security *sec = key->payload.data[1];

seq_puts(m, key->description);
if (sec && sec->describe_server_key)
sec->describe_server_key(key, m);
}

/*
Expand Down

0 comments on commit d5953f6

Please sign in to comment.