diff options
author | David Howells <dhowells@redhat.com> | 2018-10-09 12:47:07 -0400 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2018-10-26 04:30:46 -0400 |
commit | 5a30771832aab228e0863e414f9182f86797429e (patch) | |
tree | a1b1ebd8134f0c0d853d3102f1212f2601a53789 /include/keys | |
parent | 00d60fd3b93219ea854220f0fd264b86398cbc53 (diff) |
KEYS: Provide missing asymmetric key subops for new key type ops [ver #2]
Provide the missing asymmetric key subops for new key type ops. This
include query, encrypt, decrypt and create signature. Verify signature
already exists. Also provided are accessor functions for this:
int query_asymmetric_key(const struct key *key,
struct kernel_pkey_query *info);
int encrypt_blob(struct kernel_pkey_params *params,
const void *data, void *enc);
int decrypt_blob(struct kernel_pkey_params *params,
const void *enc, void *data);
int create_signature(struct kernel_pkey_params *params,
const void *data, void *enc);
The public_key_signature struct gains an encoding field to carry the
encoding for verify_signature().
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>
Diffstat (limited to 'include/keys')
-rw-r--r-- | include/keys/asymmetric-subtype.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/keys/asymmetric-subtype.h b/include/keys/asymmetric-subtype.h index e0a9c2368872..9ce2f0fae57e 100644 --- a/include/keys/asymmetric-subtype.h +++ b/include/keys/asymmetric-subtype.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/seq_file.h> | 17 | #include <linux/seq_file.h> |
18 | #include <keys/asymmetric-type.h> | 18 | #include <keys/asymmetric-type.h> |
19 | 19 | ||
20 | struct kernel_pkey_query; | ||
21 | struct kernel_pkey_params; | ||
20 | struct public_key_signature; | 22 | struct public_key_signature; |
21 | 23 | ||
22 | /* | 24 | /* |
@@ -34,6 +36,13 @@ struct asymmetric_key_subtype { | |||
34 | /* Destroy a key of this subtype */ | 36 | /* Destroy a key of this subtype */ |
35 | void (*destroy)(void *payload_crypto, void *payload_auth); | 37 | void (*destroy)(void *payload_crypto, void *payload_auth); |
36 | 38 | ||
39 | int (*query)(const struct kernel_pkey_params *params, | ||
40 | struct kernel_pkey_query *info); | ||
41 | |||
42 | /* Encrypt/decrypt/sign data */ | ||
43 | int (*eds_op)(struct kernel_pkey_params *params, | ||
44 | const void *in, void *out); | ||
45 | |||
37 | /* Verify the signature on a key of this subtype (optional) */ | 46 | /* Verify the signature on a key of this subtype (optional) */ |
38 | int (*verify_signature)(const struct key *key, | 47 | int (*verify_signature)(const struct key *key, |
39 | const struct public_key_signature *sig); | 48 | const struct public_key_signature *sig); |