1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef _LINUX_KEYCTL_H
14 #define _LINUX_KEYCTL_H
15
16 #include <linux/types.h>
17
18
19 #define KEY_SPEC_THREAD_KEYRING -1
20 #define KEY_SPEC_PROCESS_KEYRING -2
21 #define KEY_SPEC_SESSION_KEYRING -3
22 #define KEY_SPEC_USER_KEYRING -4
23 #define KEY_SPEC_USER_SESSION_KEYRING -5
24 #define KEY_SPEC_GROUP_KEYRING -6
25 #define KEY_SPEC_REQKEY_AUTH_KEY -7
26 #define KEY_SPEC_REQUESTOR_KEYRING -8
27
28
29 #define KEY_REQKEY_DEFL_NO_CHANGE -1
30 #define KEY_REQKEY_DEFL_DEFAULT 0
31 #define KEY_REQKEY_DEFL_THREAD_KEYRING 1
32 #define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
33 #define KEY_REQKEY_DEFL_SESSION_KEYRING 3
34 #define KEY_REQKEY_DEFL_USER_KEYRING 4
35 #define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
36 #define KEY_REQKEY_DEFL_GROUP_KEYRING 6
37 #define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7
38
39
40 #define KEYCTL_GET_KEYRING_ID 0
41 #define KEYCTL_JOIN_SESSION_KEYRING 1
42 #define KEYCTL_UPDATE 2
43 #define KEYCTL_REVOKE 3
44 #define KEYCTL_CHOWN 4
45 #define KEYCTL_SETPERM 5
46 #define KEYCTL_DESCRIBE 6
47 #define KEYCTL_CLEAR 7
48 #define KEYCTL_LINK 8
49 #define KEYCTL_UNLINK 9
50 #define KEYCTL_SEARCH 10
51 #define KEYCTL_READ 11
52 #define KEYCTL_INSTANTIATE 12
53 #define KEYCTL_NEGATE 13
54 #define KEYCTL_SET_REQKEY_KEYRING 14
55 #define KEYCTL_SET_TIMEOUT 15
56 #define KEYCTL_ASSUME_AUTHORITY 16
57 #define KEYCTL_GET_SECURITY 17
58 #define KEYCTL_SESSION_TO_PARENT 18
59 #define KEYCTL_REJECT 19
60 #define KEYCTL_INSTANTIATE_IOV 20
61 #define KEYCTL_INVALIDATE 21
62 #define KEYCTL_GET_PERSISTENT 22
63 #define KEYCTL_DH_COMPUTE 23
64 #define KEYCTL_PKEY_QUERY 24
65 #define KEYCTL_PKEY_ENCRYPT 25
66 #define KEYCTL_PKEY_DECRYPT 26
67 #define KEYCTL_PKEY_SIGN 27
68 #define KEYCTL_PKEY_VERIFY 28
69 #define KEYCTL_RESTRICT_KEYRING 29
70 #define KEYCTL_MOVE 30
71 #define KEYCTL_CAPABILITIES 31
72
73
74 struct keyctl_dh_params {
75 union {
76 #ifndef __cplusplus
77 __s32 private;
78 #endif
79 __s32 priv;
80 };
81 __s32 prime;
82 __s32 base;
83 };
84
85 struct keyctl_kdf_params {
86 char __user *hashname;
87 char __user *otherinfo;
88 __u32 otherinfolen;
89 __u32 __spare[8];
90 };
91
92 #define KEYCTL_SUPPORTS_ENCRYPT 0x01
93 #define KEYCTL_SUPPORTS_DECRYPT 0x02
94 #define KEYCTL_SUPPORTS_SIGN 0x04
95 #define KEYCTL_SUPPORTS_VERIFY 0x08
96
97 struct keyctl_pkey_query {
98 __u32 supported_ops;
99 __u32 key_size;
100 __u16 max_data_size;
101 __u16 max_sig_size;
102 __u16 max_enc_size;
103 __u16 max_dec_size;
104 __u32 __spare[10];
105 };
106
107 struct keyctl_pkey_params {
108 __s32 key_id;
109 __u32 in_len;
110 union {
111 __u32 out_len;
112 __u32 in2_len;
113 };
114 __u32 __spare[7];
115 };
116
117 #define KEYCTL_MOVE_EXCL 0x00000001
118
119
120
121
122
123 #define KEYCTL_CAPS0_CAPABILITIES 0x01
124 #define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02
125 #define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04
126 #define KEYCTL_CAPS0_PUBLIC_KEY 0x08
127 #define KEYCTL_CAPS0_BIG_KEY 0x10
128 #define KEYCTL_CAPS0_INVALIDATE 0x20
129 #define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40
130 #define KEYCTL_CAPS0_MOVE 0x80
131 #define KEYCTL_CAPS1_NS_KEYRING_NAME 0x01
132 #define KEYCTL_CAPS1_NS_KEY_TAG 0x02
133
134 #endif