1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _LINUX_KEYCTL_H
20 #define _LINUX_KEYCTL_H
21 #include <linux/types.h>
22 #define KEY_SPEC_THREAD_KEYRING - 1
23 #define KEY_SPEC_PROCESS_KEYRING - 2
24 #define KEY_SPEC_SESSION_KEYRING - 3
25 #define KEY_SPEC_USER_KEYRING - 4
26 #define KEY_SPEC_USER_SESSION_KEYRING - 5
27 #define KEY_SPEC_GROUP_KEYRING - 6
28 #define KEY_SPEC_REQKEY_AUTH_KEY - 7
29 #define KEY_SPEC_REQUESTOR_KEYRING - 8
30 #define KEY_REQKEY_DEFL_NO_CHANGE - 1
31 #define KEY_REQKEY_DEFL_DEFAULT 0
32 #define KEY_REQKEY_DEFL_THREAD_KEYRING 1
33 #define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
34 #define KEY_REQKEY_DEFL_SESSION_KEYRING 3
35 #define KEY_REQKEY_DEFL_USER_KEYRING 4
36 #define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
37 #define KEY_REQKEY_DEFL_GROUP_KEYRING 6
38 #define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7
39 #define KEYCTL_GET_KEYRING_ID 0
40 #define KEYCTL_JOIN_SESSION_KEYRING 1
41 #define KEYCTL_UPDATE 2
42 #define KEYCTL_REVOKE 3
43 #define KEYCTL_CHOWN 4
44 #define KEYCTL_SETPERM 5
45 #define KEYCTL_DESCRIBE 6
46 #define KEYCTL_CLEAR 7
47 #define KEYCTL_LINK 8
48 #define KEYCTL_UNLINK 9
49 #define KEYCTL_SEARCH 10
50 #define KEYCTL_READ 11
51 #define KEYCTL_INSTANTIATE 12
52 #define KEYCTL_NEGATE 13
53 #define KEYCTL_SET_REQKEY_KEYRING 14
54 #define KEYCTL_SET_TIMEOUT 15
55 #define KEYCTL_ASSUME_AUTHORITY 16
56 #define KEYCTL_GET_SECURITY 17
57 #define KEYCTL_SESSION_TO_PARENT 18
58 #define KEYCTL_REJECT 19
59 #define KEYCTL_INSTANTIATE_IOV 20
60 #define KEYCTL_INVALIDATE 21
61 #define KEYCTL_GET_PERSISTENT 22
62 #define KEYCTL_DH_COMPUTE 23
63 #define KEYCTL_PKEY_QUERY 24
64 #define KEYCTL_PKEY_ENCRYPT 25
65 #define KEYCTL_PKEY_DECRYPT 26
66 #define KEYCTL_PKEY_SIGN 27
67 #define KEYCTL_PKEY_VERIFY 28
68 #define KEYCTL_RESTRICT_KEYRING 29
69 #define KEYCTL_MOVE 30
70 #define KEYCTL_CAPABILITIES 31
71 struct keyctl_dh_params {
72   union {
73 #ifndef __cplusplus
74     __s32 __linux_private;
75 #endif
76     __s32 priv;
77   };
78   __s32 prime;
79   __s32 base;
80 };
81 struct keyctl_kdf_params {
82   char __user * hashname;
83   char __user * otherinfo;
84   __u32 otherinfolen;
85   __u32 __spare[8];
86 };
87 #define KEYCTL_SUPPORTS_ENCRYPT 0x01
88 #define KEYCTL_SUPPORTS_DECRYPT 0x02
89 #define KEYCTL_SUPPORTS_SIGN 0x04
90 #define KEYCTL_SUPPORTS_VERIFY 0x08
91 struct keyctl_pkey_query {
92   __u32 supported_ops;
93   __u32 key_size;
94   __u16 max_data_size;
95   __u16 max_sig_size;
96   __u16 max_enc_size;
97   __u16 max_dec_size;
98   __u32 __spare[10];
99 };
100 struct keyctl_pkey_params {
101   __s32 key_id;
102   __u32 in_len;
103   union {
104     __u32 out_len;
105     __u32 in2_len;
106   };
107   __u32 __spare[7];
108 };
109 #define KEYCTL_MOVE_EXCL 0x00000001
110 #define KEYCTL_CAPS0_CAPABILITIES 0x01
111 #define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02
112 #define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04
113 #define KEYCTL_CAPS0_PUBLIC_KEY 0x08
114 #define KEYCTL_CAPS0_BIG_KEY 0x10
115 #define KEYCTL_CAPS0_INVALIDATE 0x20
116 #define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40
117 #define KEYCTL_CAPS0_MOVE 0x80
118 #define KEYCTL_CAPS1_NS_KEYRING_NAME 0x01
119 #define KEYCTL_CAPS1_NS_KEY_TAG 0x02
120 #endif
121