diff options
author | Tommi Virtanen <tommi.virtanen@dreamhost.com> | 2011-03-26 02:32:57 +0300 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-03-29 23:11:16 +0400 |
commit | 8323c3aa74cd92465350294567142d12ffdcc963 (patch) | |
tree | 052e7374393994eea8d534f98ee1bc7acea4c2d9 /net/ceph/crypto.c | |
parent | fbdb9190482fd83a3eb20cdeb0da454759f479d7 (diff) | |
download | linux-8323c3aa74cd92465350294567142d12ffdcc963.tar.xz |
ceph: Move secret key parsing earlier.
This makes the base64 logic be contained in mount option parsing,
and prepares us for replacing the homebew key management with the
kernel key retention service.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph/crypto.c')
-rw-r--r-- | net/ceph/crypto.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index 7b505b0c983f..75f0893fa11f 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -9,6 +9,17 @@ #include <linux/ceph/decode.h> #include "crypto.h" +int ceph_crypto_key_clone(struct ceph_crypto_key *dst, + const struct ceph_crypto_key *src) +{ + memcpy(dst, src, sizeof(struct ceph_crypto_key)); + dst->key = kmalloc(src->len, GFP_NOFS); + if (!dst->key) + return -ENOMEM; + memcpy(dst->key, src->key, src->len); + return 0; +} + int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end) { if (*p + sizeof(u16) + sizeof(key->created) + |