6 // These functions assume they are being called from init
7 // They will not operate properly outside of init
8 int e4crypt_install_keyring();
9 int e4crypt_install_key(const char* dir
);
10 int e4crypt_create_device_key(const char* dir
,
11 int ensure_dir_exists(const char* dir
));
14 bool e4crypt_non_default_key(const char* dir
);
15 int e4crypt_set_directory_policy(const char* dir
);
16 int e4crypt_main(int argc
, char* argv
[]);
17 int e4crypt_change_password(const char* path
, int crypt_type
,
18 const char* password
);
19 int e4crypt_get_password_type(const char* path
);
20 int e4crypt_crypto_complete(const char* dir
);
21 int e4crypt_check_passwd(const char* dir
, const char* password
);
22 const char* e4crypt_get_password(const char* dir
);
23 int e4crypt_restart(const char* dir
);
25 // Key functions. ext4enc:TODO Move to own file
27 // ext4enc:TODO - get these keyring standard definitions from proper system file
28 // keyring serial number type
29 typedef int32_t key_serial_t
;
31 // special process keyring shortcut IDs
32 #define KEY_SPEC_THREAD_KEYRING -1 // key ID for thread-specific keyring
33 #define KEY_SPEC_PROCESS_KEYRING -2 // key ID for process-specific keyring
34 #define KEY_SPEC_SESSION_KEYRING -3 // key ID for session-specific keyring
35 #define KEY_SPEC_USER_KEYRING -4 // key ID for UID-specific keyring
36 #define KEY_SPEC_USER_SESSION_KEYRING -5 // key ID for UID-session keyring
37 #define KEY_SPEC_GROUP_KEYRING -6 // key ID for GID-specific keyring
39 key_serial_t
add_key(const char *type
,
40 const char *description
,
45 long keyctl_setperm(key_serial_t id
, int permissions
);
47 // Set policy on directory
48 int do_policy_set(const char *directory
, const char *policy
);