summaryrefslogtreecommitdiff
path: root/net/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-12-02 16:35:06 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-26 08:24:41 +0100
commitbe60457612a22a040103bc98b1ebc72d95d4d6e0 (patch)
treee124b967a8326ebce9ab9151cd1335812eee88d3 /net/ceph
parent2e62bf3c6fe94b9c7fd37beac4b8b8fcd3f72d71 (diff)
libceph: old_key in process_one_ticket() is redundant
commit 462e650451c577d15eeb4d883d70fa9e4e529fad upstream. Since commit 0a990e709356 ("ceph: clean up service ticket decoding"), th->session_key isn't assigned until everything is decoded. 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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index 4d14dc8c7746..28bde937d58a 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -148,7 +148,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
int dlen;
char is_enc;
struct timespec validity;
- struct ceph_crypto_key old_key;
void *ticket_buf = NULL;
void *tp, *tpend;
void **ptp;
@@ -187,7 +186,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
if (tkt_struct_v != 1)
goto bad;
- memcpy(&old_key, &th->session_key, sizeof(old_key));
ret = ceph_crypto_key_decode(&new_session_key, &dp, dend);
if (ret)
goto out;
@@ -204,7 +202,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
if (is_enc) {
/* encrypted */
dout(" encrypted ticket\n");
- dlen = ceph_x_decrypt(&old_key, p, end, &ticket_buf, 0);
+ dlen = ceph_x_decrypt(&th->session_key, p, end, &ticket_buf, 0);
if (dlen < 0) {
ret = dlen;
goto out;