Skip to content

Commit a484a49

Browse files
committed
Merge tag 'keys-next-20200602' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull keyring updates from David Howells: - Fix a documentation warning. - Replace a zero-length array with a flexible one - Make the big_key key type use ChaCha20Poly1305 and use the crypto algorithm directly rather than going through the crypto layer. - Implement the update op for the big_key type. * tag 'keys-next-20200602' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: keys: Implement update for the big_key type security/keys: rewrite big_key crypto to use library interface KEYS: Replace zero-length array with flexible-array Documentation: security: core.rst: add missing argument
2 parents 38b3a5a + b6f61c3 commit a484a49

File tree

5 files changed

+60
-212
lines changed

5 files changed

+60
-212
lines changed

Documentation/security/keys/core.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,10 +920,14 @@ The keyctl syscall functions are:
920920

921921
long keyctl(KEYCTL_PKEY_QUERY,
922922
key_serial_t key_id, unsigned long reserved,
923+
const char *params,
923924
struct keyctl_pkey_query *info);
924925
925-
Get information about an asymmetric key. The information is returned in
926-
the keyctl_pkey_query struct::
926+
Get information about an asymmetric key. Specific algorithms and
927+
encodings may be queried by using the ``params`` argument. This is a
928+
string containing a space- or tab-separated string of key-value pairs.
929+
Currently supported keys include ``enc`` and ``hash``. The information
930+
is returned in the keyctl_pkey_query struct::
927931

928932
__u32 supported_ops;
929933
__u32 key_size;

include/keys/big_key-type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ extern void big_key_revoke(struct key *key);
1818
extern void big_key_destroy(struct key *key);
1919
extern void big_key_describe(const struct key *big_key, struct seq_file *m);
2020
extern long big_key_read(const struct key *key, char *buffer, size_t buflen);
21+
extern int big_key_update(struct key *key, struct key_preparsed_payload *prep);
2122

2223
#endif /* _KEYS_BIG_KEY_TYPE_H */

include/keys/user-type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
struct user_key_payload {
2828
struct rcu_head rcu; /* RCU destructor */
2929
unsigned short datalen; /* length of this data */
30-
char data[0] __aligned(__alignof__(u64)); /* actual data */
30+
char data[] __aligned(__alignof__(u64)); /* actual data */
3131
};
3232

3333
extern struct key_type key_type_user;

security/keys/Kconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ config BIG_KEYS
6060
bool "Large payload keys"
6161
depends on KEYS
6262
depends on TMPFS
63-
select CRYPTO
64-
select CRYPTO_AES
65-
select CRYPTO_GCM
63+
depends on CRYPTO_LIB_CHACHA20POLY1305 = y
6664
help
6765
This option provides support for holding large keys within the kernel
6866
(for example Kerberos ticket caches). The data may be stored out to

0 commit comments

Comments
 (0)