summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-12-02 16:35:07 +0100
committerIlya Dryomov <idryomov@gmail.com>2016-12-12 23:09:19 +0100
commit55d9cc834f933698fc864f0d36f3cca533d30a8d (patch)
treef4da2db2a0ac28189e3a4e27fb8b9f753824ca9d /net
parent462e650451c577d15eeb4d883d70fa9e4e529fad (diff)
downloadlinux-55d9cc834f933698fc864f0d36f3cca533d30a8d.tar.gz
linux-55d9cc834f933698fc864f0d36f3cca533d30a8d.tar.bz2
linux-55d9cc834f933698fc864f0d36f3cca533d30a8d.zip
libceph: introduce ceph_x_encrypt_offset()
Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/auth_x.c8
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,