-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for libfscryptctl.so creation. #37
Comments
|
If this tool is 'libfscryptctl' compatible, we may access the APIs directly (ex. cmd_add_key) rather than using the command line. No additional system call is required to execute the command line arguments if we are utilising 'libfscryptctl' in any programme. Additionally, to handle the error code in their programme quickly. |
If that's all you need, you could just rename |
I agree with @ebiggers, it sounds like you want to call the ioctls directly. The ioctls are better documented than this CLI tool, and if you run into issues or bugs, you will be in a better position to search/ask for help. For example, most of the code in struct fscrypt_add_key_arg *arg = calloc(sizeof(*arg) + FSCRYPT_MAX_KEY_SIZE, 1);
// Read key data in
memcpy(arg->raw, key_in, FSCRYPT_MAX_KEY_SIZE);
arg->raw_size = FSCRYPT_MAX_KEY_SIZE;
arg->key_spec.type = FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER;
// Should do error checking here
ioctl(fd, FS_IOC_ADD_ENCRYPTION_KEY, arg);
// Read the identifier from the arg struct
memcpy(id_out, arg->key_spec.u.identifier, FSCRYPT_KEY_IDENTIFIER_SIZE); |
Hi,
This user space tool is now active as a command-line tool. The.so file was required by some embedded devices, however, in order to link their programme.
The text was updated successfully, but these errors were encountered: