Skip to content

Commit acb0ed8

Browse files
Dr. David Alan Gilbertherbertx
authored andcommitted
crypto: asymmetric_keys - Remove unused functions
encrypt_blob(), decrypt_blob() and create_signature() were some of the functions added in 2018 by commit 5a30771 ("KEYS: Provide missing asymmetric key subops for new key type ops [ver #2]") however, they've not been used. Remove them. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent d11c8b8 commit acb0ed8

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

crypto/asymmetric_keys/signature.c

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -64,69 +64,6 @@ int query_asymmetric_key(const struct kernel_pkey_params *params,
6464
}
6565
EXPORT_SYMBOL_GPL(query_asymmetric_key);
6666

67-
/**
68-
* encrypt_blob - Encrypt data using an asymmetric key
69-
* @params: Various parameters
70-
* @data: Data blob to be encrypted, length params->data_len
71-
* @enc: Encrypted data buffer, length params->enc_len
72-
*
73-
* Encrypt the specified data blob using the private key specified by
74-
* params->key. The encrypted data is wrapped in an encoding if
75-
* params->encoding is specified (eg. "pkcs1").
76-
*
77-
* Returns the length of the data placed in the encrypted data buffer or an
78-
* error.
79-
*/
80-
int encrypt_blob(struct kernel_pkey_params *params,
81-
const void *data, void *enc)
82-
{
83-
params->op = kernel_pkey_encrypt;
84-
return asymmetric_key_eds_op(params, data, enc);
85-
}
86-
EXPORT_SYMBOL_GPL(encrypt_blob);
87-
88-
/**
89-
* decrypt_blob - Decrypt data using an asymmetric key
90-
* @params: Various parameters
91-
* @enc: Encrypted data to be decrypted, length params->enc_len
92-
* @data: Decrypted data buffer, length params->data_len
93-
*
94-
* Decrypt the specified data blob using the private key specified by
95-
* params->key. The decrypted data is wrapped in an encoding if
96-
* params->encoding is specified (eg. "pkcs1").
97-
*
98-
* Returns the length of the data placed in the decrypted data buffer or an
99-
* error.
100-
*/
101-
int decrypt_blob(struct kernel_pkey_params *params,
102-
const void *enc, void *data)
103-
{
104-
params->op = kernel_pkey_decrypt;
105-
return asymmetric_key_eds_op(params, enc, data);
106-
}
107-
EXPORT_SYMBOL_GPL(decrypt_blob);
108-
109-
/**
110-
* create_signature - Sign some data using an asymmetric key
111-
* @params: Various parameters
112-
* @data: Data blob to be signed, length params->data_len
113-
* @enc: Signature buffer, length params->enc_len
114-
*
115-
* Sign the specified data blob using the private key specified by params->key.
116-
* The signature is wrapped in an encoding if params->encoding is specified
117-
* (eg. "pkcs1"). If the encoding needs to know the digest type, this can be
118-
* passed through params->hash_algo (eg. "sha1").
119-
*
120-
* Returns the length of the data placed in the signature buffer or an error.
121-
*/
122-
int create_signature(struct kernel_pkey_params *params,
123-
const void *data, void *enc)
124-
{
125-
params->op = kernel_pkey_sign;
126-
return asymmetric_key_eds_op(params, data, enc);
127-
}
128-
EXPORT_SYMBOL_GPL(create_signature);
129-
13067
/**
13168
* verify_signature - Initiate the use of an asymmetric key to verify a signature
13269
* @key: The asymmetric key to verify against

include/crypto/public_key.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ static inline int restrict_link_by_digsig(struct key *dest_keyring,
104104
extern int query_asymmetric_key(const struct kernel_pkey_params *,
105105
struct kernel_pkey_query *);
106106

107-
extern int encrypt_blob(struct kernel_pkey_params *, const void *, void *);
108-
extern int decrypt_blob(struct kernel_pkey_params *, const void *, void *);
109-
extern int create_signature(struct kernel_pkey_params *, const void *, void *);
110107
extern int verify_signature(const struct key *,
111108
const struct public_key_signature *);
112109

0 commit comments

Comments
 (0)