From patchwork Mon Dec 12 20:48:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9471299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A32EE607D3 for ; Mon, 12 Dec 2016 20:50:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9997A28518 for ; Mon, 12 Dec 2016 20:50:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E3F42851B; Mon, 12 Dec 2016 20:50:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AE7028518 for ; Mon, 12 Dec 2016 20:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932268AbcLLUuH (ORCPT ); Mon, 12 Dec 2016 15:50:07 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34546 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbcLLUuF (ORCPT ); Mon, 12 Dec 2016 15:50:05 -0500 Received: by mail-wm0-f68.google.com with SMTP id g23so13806966wme.1 for ; Mon, 12 Dec 2016 12:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=ao6/aWZrkGHFtICnKENFtVJPJjDzMHFgLBMkDId6/5s=; b=VbH89Ovw3FE3RXY0oFmPJOkp0PPMSBIlMLd7LxqDaAVQA/WDMm8JMWff8NhBjTKFp3 S5++7Nuk2kRj9VDU1J3PYv5JbwScHgggHRDfckoMNOU7X7skpTh7vpe5+qFpUINjFn2U oW8wKCdzpM4XQ5VfmwQaLnb+9c9oh/aFkl+SnNY0kpY86Q9lyVmjpDE/jW1XR+piwXjD w8TxY11iTjMr1mVvR/OmGCxR5biYjnE7AI9TYlPFvs6Z8Nql0dQX1luzKIrJsfnUHP9M coDXbMylgF5G98rtkbn02dWQA2XIY9g3X4Py9l3Xv0GP2CPAIVV9Q36j/AG3lDT7B3jG DRhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ao6/aWZrkGHFtICnKENFtVJPJjDzMHFgLBMkDId6/5s=; b=MyR73x5p46N2cdl357fC5nEtAEGucyiRytOQACuiZHnMFDatI84aL8h/0AaZ8SkMkr glQ22KVHsGnISleZwPEctvXTsneZjpj0nGnZVos9fbQGTIDLxRlXpJbEKBVj5mbcWlgT U5E5BJ5t0c0CpwdXz6r0ktLP5qDWm3gIWsHwCUyEN5QcWd+SXM9I4Y3C3tWTxLDxaqbU G84wWcJNou5EXABr5U47kjnSyMCFIv6/iashCCDHtYGi/MEu2oOv82wVLZeX55OwOTfQ rwkbvrltsctCiS6bAXvSr7JmH0gcSsyGohvGRnxYGkFXpEBqHjoUf5xZPl4jnn5eMD/H JGIQ== X-Gm-Message-State: AKaTC01MlJk0WfNA4raCoMHtCBOSFVJcNdrzA8ZDqJiR9vmE7MkUOAB+qLdyKvtxkLaqbQ== X-Received: by 10.28.49.193 with SMTP id x184mr18598224wmx.44.1481575804245; Mon, 12 Dec 2016 12:50:04 -0800 (PST) Received: from dhcp-1-105.brq.redhat.com ([213.175.37.12]) by smtp.gmail.com with ESMTPSA id 135sm37201887wmh.14.2016.12.12.12.50.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 12:50:03 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 02/15] libceph: old_key in process_one_ticket() is redundant Date: Mon, 12 Dec 2016 21:48:47 +0100 Message-Id: <1481575740-1834-3-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1481575740-1834-1-git-send-email-idryomov@gmail.com> References: <1481575740-1834-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 0a990e709356 ("ceph: clean up service ticket decoding"), th->session_key isn't assigned until everything is decoded. Signed-off-by: Ilya Dryomov --- net/ceph/auth_x.c | 4 +--- 1 file changed, 1 insertion(+), 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;