Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _LINUX_KEYCTL_H |
| 8 | #define _LINUX_KEYCTL_H |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 9 | #include <linux/types.h> |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 10 | #define KEY_SPEC_THREAD_KEYRING - 1 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 11 | #define KEY_SPEC_PROCESS_KEYRING - 2 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 12 | #define KEY_SPEC_SESSION_KEYRING - 3 |
| 13 | #define KEY_SPEC_USER_KEYRING - 4 |
| 14 | #define KEY_SPEC_USER_SESSION_KEYRING - 5 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 15 | #define KEY_SPEC_GROUP_KEYRING - 6 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 16 | #define KEY_SPEC_REQKEY_AUTH_KEY - 7 |
| 17 | #define KEY_SPEC_REQUESTOR_KEYRING - 8 |
| 18 | #define KEY_REQKEY_DEFL_NO_CHANGE - 1 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 19 | #define KEY_REQKEY_DEFL_DEFAULT 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 20 | #define KEY_REQKEY_DEFL_THREAD_KEYRING 1 |
| 21 | #define KEY_REQKEY_DEFL_PROCESS_KEYRING 2 |
| 22 | #define KEY_REQKEY_DEFL_SESSION_KEYRING 3 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 23 | #define KEY_REQKEY_DEFL_USER_KEYRING 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5 |
| 25 | #define KEY_REQKEY_DEFL_GROUP_KEYRING 6 |
| 26 | #define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 27 | #define KEYCTL_GET_KEYRING_ID 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | #define KEYCTL_JOIN_SESSION_KEYRING 1 |
| 29 | #define KEYCTL_UPDATE 2 |
| 30 | #define KEYCTL_REVOKE 3 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 31 | #define KEYCTL_CHOWN 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | #define KEYCTL_SETPERM 5 |
| 33 | #define KEYCTL_DESCRIBE 6 |
| 34 | #define KEYCTL_CLEAR 7 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 35 | #define KEYCTL_LINK 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define KEYCTL_UNLINK 9 |
| 37 | #define KEYCTL_SEARCH 10 |
| 38 | #define KEYCTL_READ 11 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 39 | #define KEYCTL_INSTANTIATE 12 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | #define KEYCTL_NEGATE 13 |
| 41 | #define KEYCTL_SET_REQKEY_KEYRING 14 |
| 42 | #define KEYCTL_SET_TIMEOUT 15 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 43 | #define KEYCTL_ASSUME_AUTHORITY 16 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | #define KEYCTL_GET_SECURITY 17 |
| 45 | #define KEYCTL_SESSION_TO_PARENT 18 |
| 46 | #define KEYCTL_REJECT 19 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 47 | #define KEYCTL_INSTANTIATE_IOV 20 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | #define KEYCTL_INVALIDATE 21 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 49 | #define KEYCTL_GET_PERSISTENT 22 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 50 | #define KEYCTL_DH_COMPUTE 23 |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 51 | #define KEYCTL_PKEY_QUERY 24 |
| 52 | #define KEYCTL_PKEY_ENCRYPT 25 |
| 53 | #define KEYCTL_PKEY_DECRYPT 26 |
| 54 | #define KEYCTL_PKEY_SIGN 27 |
| 55 | #define KEYCTL_PKEY_VERIFY 28 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 56 | #define KEYCTL_RESTRICT_KEYRING 29 |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 57 | #define KEYCTL_MOVE 30 |
| 58 | #define KEYCTL_CAPABILITIES 31 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 59 | #define KEYCTL_WATCH_KEY 32 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 60 | struct keyctl_dh_params { |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 61 | union { |
| 62 | #ifndef __cplusplus |
| 63 | __s32 __linux_private; |
| 64 | #endif |
| 65 | __s32 priv; |
| 66 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 67 | __s32 prime; |
| 68 | __s32 base; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 69 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 70 | struct keyctl_kdf_params { |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 71 | char * hashname; |
| 72 | char * otherinfo; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 73 | __u32 otherinfolen; |
| 74 | __u32 __spare[8]; |
| 75 | }; |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 76 | #define KEYCTL_SUPPORTS_ENCRYPT 0x01 |
| 77 | #define KEYCTL_SUPPORTS_DECRYPT 0x02 |
| 78 | #define KEYCTL_SUPPORTS_SIGN 0x04 |
| 79 | #define KEYCTL_SUPPORTS_VERIFY 0x08 |
| 80 | struct keyctl_pkey_query { |
| 81 | __u32 supported_ops; |
| 82 | __u32 key_size; |
| 83 | __u16 max_data_size; |
| 84 | __u16 max_sig_size; |
| 85 | __u16 max_enc_size; |
| 86 | __u16 max_dec_size; |
| 87 | __u32 __spare[10]; |
| 88 | }; |
| 89 | struct keyctl_pkey_params { |
| 90 | __s32 key_id; |
| 91 | __u32 in_len; |
| 92 | union { |
| 93 | __u32 out_len; |
| 94 | __u32 in2_len; |
| 95 | }; |
| 96 | __u32 __spare[7]; |
| 97 | }; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 98 | #define KEYCTL_MOVE_EXCL 0x00000001 |
| 99 | #define KEYCTL_CAPS0_CAPABILITIES 0x01 |
| 100 | #define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02 |
| 101 | #define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04 |
| 102 | #define KEYCTL_CAPS0_PUBLIC_KEY 0x08 |
| 103 | #define KEYCTL_CAPS0_BIG_KEY 0x10 |
| 104 | #define KEYCTL_CAPS0_INVALIDATE 0x20 |
| 105 | #define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40 |
| 106 | #define KEYCTL_CAPS0_MOVE 0x80 |
| 107 | #define KEYCTL_CAPS1_NS_KEYRING_NAME 0x01 |
| 108 | #define KEYCTL_CAPS1_NS_KEY_TAG 0x02 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 109 | #define KEYCTL_CAPS1_NOTIFICATIONS 0x04 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | #endif |