blob: 01ea576d377c78e4beedc88dac5024ecac6b00e7 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include <linux/types.h>
Tao Baod7db5942015-01-28 10:07:51 -080022#define KEY_SPEC_THREAD_KEYRING - 1
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#define KEY_SPEC_PROCESS_KEYRING - 2
Tao Baod7db5942015-01-28 10:07:51 -080024#define KEY_SPEC_SESSION_KEYRING - 3
25#define KEY_SPEC_USER_KEYRING - 4
26#define KEY_SPEC_USER_SESSION_KEYRING - 5
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define KEY_SPEC_GROUP_KEYRING - 6
Tao Baod7db5942015-01-28 10:07:51 -080028#define KEY_SPEC_REQKEY_AUTH_KEY - 7
29#define KEY_SPEC_REQUESTOR_KEYRING - 8
30#define KEY_REQKEY_DEFL_NO_CHANGE - 1
Christopher Ferris106b3a82016-08-24 12:15:38 -070031#define KEY_REQKEY_DEFL_DEFAULT 0
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define KEY_REQKEY_DEFL_THREAD_KEYRING 1
33#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
34#define KEY_REQKEY_DEFL_SESSION_KEYRING 3
Christopher Ferris106b3a82016-08-24 12:15:38 -070035#define KEY_REQKEY_DEFL_USER_KEYRING 4
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
37#define KEY_REQKEY_DEFL_GROUP_KEYRING 6
38#define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7
Christopher Ferris106b3a82016-08-24 12:15:38 -070039#define KEYCTL_GET_KEYRING_ID 0
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define KEYCTL_JOIN_SESSION_KEYRING 1
41#define KEYCTL_UPDATE 2
42#define KEYCTL_REVOKE 3
Christopher Ferris106b3a82016-08-24 12:15:38 -070043#define KEYCTL_CHOWN 4
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define KEYCTL_SETPERM 5
45#define KEYCTL_DESCRIBE 6
46#define KEYCTL_CLEAR 7
Christopher Ferris106b3a82016-08-24 12:15:38 -070047#define KEYCTL_LINK 8
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define KEYCTL_UNLINK 9
49#define KEYCTL_SEARCH 10
50#define KEYCTL_READ 11
Christopher Ferris106b3a82016-08-24 12:15:38 -070051#define KEYCTL_INSTANTIATE 12
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define KEYCTL_NEGATE 13
53#define KEYCTL_SET_REQKEY_KEYRING 14
54#define KEYCTL_SET_TIMEOUT 15
Christopher Ferris106b3a82016-08-24 12:15:38 -070055#define KEYCTL_ASSUME_AUTHORITY 16
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define KEYCTL_GET_SECURITY 17
57#define KEYCTL_SESSION_TO_PARENT 18
58#define KEYCTL_REJECT 19
Christopher Ferris106b3a82016-08-24 12:15:38 -070059#define KEYCTL_INSTANTIATE_IOV 20
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define KEYCTL_INVALIDATE 21
Christopher Ferris38062f92014-07-09 15:33:25 -070061#define KEYCTL_GET_PERSISTENT 22
Christopher Ferris106b3a82016-08-24 12:15:38 -070062#define KEYCTL_DH_COMPUTE 23
Christopher Ferris86a48372019-01-10 14:14:59 -080063#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
Christopher Ferris525ce912017-07-26 13:12:53 -070068#define KEYCTL_RESTRICT_KEYRING 29
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070069#define KEYCTL_MOVE 30
70#define KEYCTL_CAPABILITIES 31
Christopher Ferris8177cdf2020-08-03 11:53:55 -070071#define KEYCTL_WATCH_KEY 32
Christopher Ferris106b3a82016-08-24 12:15:38 -070072struct keyctl_dh_params {
Christopher Ferris86a48372019-01-10 14:14:59 -080073 union {
74#ifndef __cplusplus
75 __s32 __linux_private;
76#endif
77 __s32 priv;
78 };
Christopher Ferris106b3a82016-08-24 12:15:38 -070079 __s32 prime;
80 __s32 base;
Christopher Ferris106b3a82016-08-24 12:15:38 -070081};
Christopher Ferris525ce912017-07-26 13:12:53 -070082struct keyctl_kdf_params {
83 char __user * hashname;
84 char __user * otherinfo;
85 __u32 otherinfolen;
86 __u32 __spare[8];
87};
Christopher Ferris86a48372019-01-10 14:14:59 -080088#define KEYCTL_SUPPORTS_ENCRYPT 0x01
89#define KEYCTL_SUPPORTS_DECRYPT 0x02
90#define KEYCTL_SUPPORTS_SIGN 0x04
91#define KEYCTL_SUPPORTS_VERIFY 0x08
92struct keyctl_pkey_query {
93 __u32 supported_ops;
94 __u32 key_size;
95 __u16 max_data_size;
96 __u16 max_sig_size;
97 __u16 max_enc_size;
98 __u16 max_dec_size;
99 __u32 __spare[10];
100};
101struct keyctl_pkey_params {
102 __s32 key_id;
103 __u32 in_len;
104 union {
105 __u32 out_len;
106 __u32 in2_len;
107 };
108 __u32 __spare[7];
109};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700110#define KEYCTL_MOVE_EXCL 0x00000001
111#define KEYCTL_CAPS0_CAPABILITIES 0x01
112#define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02
113#define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04
114#define KEYCTL_CAPS0_PUBLIC_KEY 0x08
115#define KEYCTL_CAPS0_BIG_KEY 0x10
116#define KEYCTL_CAPS0_INVALIDATE 0x20
117#define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40
118#define KEYCTL_CAPS0_MOVE 0x80
119#define KEYCTL_CAPS1_NS_KEYRING_NAME 0x01
120#define KEYCTL_CAPS1_NS_KEY_TAG 0x02
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700121#define KEYCTL_CAPS1_NOTIFICATIONS 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#endif