diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2016-12-02 16:35:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-26 08:24:41 +0100 |
commit | 0548b82989384a58e749f0c04781b2c823c6c1b9 (patch) | |
tree | 4527a19c4ffb150c534715b76c2b2bdce7d89090 /net/ceph | |
parent | be60457612a22a040103bc98b1ebc72d95d4d6e0 (diff) |
libceph: introduce ceph_x_encrypt_offset()
commit 55d9cc834f933698fc864f0d36f3cca533d30a8d upstream.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/auth_x.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c index 28bde937d58a..de30c585c2a2 100644 --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c @@ -39,10 +39,14 @@ static int ceph_x_should_authenticate(struct ceph_auth_client *ac) return need != 0; } +static int ceph_x_encrypt_offset(void) +{ + return sizeof(u32) + sizeof(struct ceph_x_encrypt_header); +} + static int ceph_x_encrypt_buflen(int ilen) { - return sizeof(struct ceph_x_encrypt_header) + ilen + 16 + - sizeof(u32); + return ceph_x_encrypt_offset() + ilen + 16; } static int ceph_x_encrypt(struct ceph_crypto_key *secret, |