Commit be604576 authored by Ilya Dryomov's avatar Ilya Dryomov Committed by Greg Kroah-Hartman

libceph: old_key in process_one_ticket() is redundant

commit 462e6504 upstream.

Since commit 0a990e70 ("ceph: clean up service ticket decoding"),
th->session_key isn't assigned until everything is decoded.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarSage Weil <sage@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e62bf3c
...@@ -148,7 +148,6 @@ static int process_one_ticket(struct ceph_auth_client *ac, ...@@ -148,7 +148,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
int dlen; int dlen;
char is_enc; char is_enc;
struct timespec validity; struct timespec validity;
struct ceph_crypto_key old_key;
void *ticket_buf = NULL; void *ticket_buf = NULL;
void *tp, *tpend; void *tp, *tpend;
void **ptp; void **ptp;
...@@ -187,7 +186,6 @@ static int process_one_ticket(struct ceph_auth_client *ac, ...@@ -187,7 +186,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
if (tkt_struct_v != 1) if (tkt_struct_v != 1)
goto bad; goto bad;
memcpy(&old_key, &th->session_key, sizeof(old_key));
ret = ceph_crypto_key_decode(&new_session_key, &dp, dend); ret = ceph_crypto_key_decode(&new_session_key, &dp, dend);
if (ret) if (ret)
goto out; goto out;
...@@ -204,7 +202,7 @@ static int process_one_ticket(struct ceph_auth_client *ac, ...@@ -204,7 +202,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
if (is_enc) { if (is_enc) {
/* encrypted */ /* encrypted */
dout(" encrypted ticket\n"); 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) { if (dlen < 0) {
ret = dlen; ret = dlen;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment