diff options
author | David Howells <dhowells@redhat.com> | 2019-05-30 15:23:02 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-06-19 13:42:09 +0100 |
commit | f9761a6a9abec83c7fd7a9cbc96237f7cd344808 (patch) | |
tree | d861c399235c4ebb6934c82aac884b84bbccf4b5 /keyutils.h | |
parent | 0f70f77491bb6976a2bf761224fec1a9cc6cfb87 (diff) | |
download | keyutils-f9761a6a9abec83c7fd7a9cbc96237f7cd344808.tar.gz |
Provide the ability to query subsystem capabilities
Provide the ability to query the capabilities of the keyrings subsystem.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'keyutils.h')
-rw-r--r-- | keyutils.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -107,6 +107,7 @@ typedef uint32_t key_perm_t; #define KEYCTL_PKEY_VERIFY 28 /* Verify a public key signature */ #define KEYCTL_RESTRICT_KEYRING 29 /* Restrict keys allowed to link to a keyring */ #define KEYCTL_MOVE 30 /* Move keys between keyrings */ +#define KEYCTL_CAPABILITIES 31 /* Find capabilities of keyrings subsystem */ /* keyctl structures */ struct keyctl_dh_params { @@ -150,6 +151,19 @@ struct keyctl_pkey_params { #define KEYCTL_MOVE_EXCL 0x00000001 /* Do not displace from the to-keyring */ /* + * Capabilities flags. The capabilities list is an array of 8-bit integers; + * each integer can carry up to 8 flags. + */ +#define KEYCTL_CAPS0_CAPABILITIES 0x01 /* KEYCTL_CAPABILITIES supported */ +#define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02 /* Persistent keyrings enabled */ +#define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04 /* Diffie-Hellman ops enabled */ +#define KEYCTL_CAPS0_PUBLIC_KEY 0x08 /* Public key ops enabled */ +#define KEYCTL_CAPS0_BIG_KEY 0x10 /* big_key-type enabled */ +#define KEYCTL_CAPS0_INVALIDATE 0x20 /* KEYCTL_INVALIDATE supported */ +#define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40 /* KEYCTL_RESTRICT_KEYRING supported */ +#define KEYCTL_CAPS0_MOVE 0x80 /* KEYCTL_MOVE supported */ + +/* * syscall wrappers */ extern key_serial_t add_key(const char *type, @@ -234,6 +248,7 @@ extern long keyctl_move(key_serial_t id, key_serial_t from_ringid, key_serial_t to_ringid, unsigned int flags); +extern long keyctl_capabilities(unsigned char *buffer, size_t buflen); /* * utilities |