History

keys: Add capability-checking keyctl function

Add a keyctl function that requests a set of capability bits to find out what features are supported.

David Howells committed 7 years ago

Commit 45e0f301 parent 47546204 files · +54 −0Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/keyctl.h+14−0
@@ -68,6 +68,7 @@ · 67 unmodified lines
6868 #define KEYCTL_PKEY_VERIFY 28 /* Verify a public key signature */
6969 #define KEYCTL_RESTRICT_KEYRING 29 /* Restrict keys allowed to link to a keyring */
7070 #define KEYCTL_MOVE 30 /* Move keys between keyrings */
71+#define KEYCTL_CAPABILITIES 31 /* Find capabilities of keyrings subsystem */
7172
7273 /* keyctl structures */
7374 struct keyctl_dh_params {
@@ -115,4 +116,17 @@ struct keyctl_pkey_params { · 41 unmodified lines
115116
116117 #define KEYCTL_MOVE_EXCL 0x00000001 /* Do not displace from the to-keyring */
117118
119+/*
120+ * Capabilities flags. The capabilities list is an array of 8-bit integers;
121+ * each integer can carry up to 8 flags.
122+ */
123+#define KEYCTL_CAPS0_CAPABILITIES 0x01 /* KEYCTL_CAPABILITIES supported */
124+#define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02 /* Persistent keyrings enabled */
125+#define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04 /* Diffie-Hellman computation enabled */
126+#define KEYCTL_CAPS0_PUBLIC_KEY 0x08 /* Public key ops enabled */
127+#define KEYCTL_CAPS0_BIG_KEY 0x10 /* big_key-type enabled */
128+#define KEYCTL_CAPS0_INVALIDATE 0x20 /* KEYCTL_INVALIDATE supported */
129+#define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40 /* KEYCTL_RESTRICT_KEYRING supported */
130+#define KEYCTL_CAPS0_MOVE 0x80 /* KEYCTL_MOVE supported */
131+
118132 #endif /* _LINUX_KEYCTL_H */