mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
libceph: uninline ceph_crypto_key_destroy()
Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
2b1e1a7cd0
commit
6db2304aab
@ -80,6 +80,14 @@ int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *inkey)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
|
||||||
|
{
|
||||||
|
if (key) {
|
||||||
|
kfree(key->key);
|
||||||
|
key->key = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static struct crypto_skcipher *ceph_crypto_alloc_cipher(void)
|
static struct crypto_skcipher *ceph_crypto_alloc_cipher(void)
|
||||||
{
|
{
|
||||||
return crypto_alloc_skcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC);
|
return crypto_alloc_skcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC);
|
||||||
|
@ -14,19 +14,12 @@ struct ceph_crypto_key {
|
|||||||
void *key;
|
void *key;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
|
|
||||||
{
|
|
||||||
if (key) {
|
|
||||||
kfree(key->key);
|
|
||||||
key->key = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
|
int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
|
||||||
const struct ceph_crypto_key *src);
|
const struct ceph_crypto_key *src);
|
||||||
int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end);
|
int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end);
|
||||||
int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end);
|
int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end);
|
||||||
int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in);
|
int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in);
|
||||||
|
void ceph_crypto_key_destroy(struct ceph_crypto_key *key);
|
||||||
|
|
||||||
/* crypto.c */
|
/* crypto.c */
|
||||||
int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt,
|
int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt,
|
||||||
|
Loading…
Reference in New Issue
Block a user