mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
KEYS: Provide key type operations for asymmetric key ops [ver #2]
Provide five new operations in the key_type struct that can be used to provide access to asymmetric key operations. These will be implemented for the asymmetric key type in a later patch and may refer to a key retained in RAM by the kernel or a key retained in crypto hardware. int (*asym_query)(const struct kernel_pkey_params *params, struct kernel_pkey_query *info); int (*asym_eds_op)(struct kernel_pkey_params *params, const void *in, void *out); int (*asym_verify_signature)(struct kernel_pkey_params *params, const void *in, const void *in2); Since encrypt, decrypt and sign are identical in their interfaces, they're rolled together in the asym_eds_op() operation and there's an operation ID in the params argument to distinguish them. Verify is different in that we supply the data and the signature instead and get an error value (or 0) as the only result on the expectation that this may well be how a hardware crypto device may work. Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Denis Kenzior <denkenz@gmail.com> Tested-by: Denis Kenzior <denkenz@gmail.com> Signed-off-by: James Morris <james.morris@microsoft.com>
This commit is contained in:
parent
e5f6d9afa3
commit
70025f84e5
4 changed files with 168 additions and 0 deletions
|
@ -82,4 +82,9 @@ struct keyctl_kdf_params {
|
|||
__u32 __spare[8];
|
||||
};
|
||||
|
||||
#define KEYCTL_SUPPORTS_ENCRYPT 0x01
|
||||
#define KEYCTL_SUPPORTS_DECRYPT 0x02
|
||||
#define KEYCTL_SUPPORTS_SIGN 0x04
|
||||
#define KEYCTL_SUPPORTS_VERIFY 0x08
|
||||
|
||||
#endif /* _LINUX_KEYCTL_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue