From patchwork Thu Feb 17 20:38:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 571781 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1HKbnCo031678 for ; Thu, 17 Feb 2011 20:37:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329Ab1BQUhr (ORCPT ); Thu, 17 Feb 2011 15:37:47 -0500 Received: from mail-qy0-f181.google.com ([209.85.216.181]:36927 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067Ab1BQUhr (ORCPT ); Thu, 17 Feb 2011 15:37:47 -0500 Received: by qyk12 with SMTP id 12so3101925qyk.19 for ; Thu, 17 Feb 2011 12:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=a+AZC++ALgouPcM6iWWkED1v2/QXlJDpAflsnNFEahk=; b=m+jNNTIxK+i1N9nF1fojYURE1Dyqx9+HtCrda/uiy43dxJzqbqmm2D8JSSLwuFWV2p O4MYwyeLtGoNAnS1s6Ti0rEvn5WEu5WIgdzjozbZJtp+mfEdx24cao96yx2J6W6fauTq 3VEFsdmoSzlzWMDk3PfJvDwU0u0/5rlVziAiQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=bA5nFZKV0weHku0nIt0Fadksnrlp0QUnJDEZJ6QUslJXomjJ8HpF5iciLE1FS6RBgi Xaap2rChiMfcySS47UDbwR0p9TNnpoCjTJk9CYzJbD91YpvsmWrGSQMk4SKXJQLudMIy SmqB1/FUY6a/A8cpAV8E/EHjOKVAxfDlSjlU8= Received: by 10.224.47.141 with SMTP id n13mr3085501qaf.289.1297975066337; Thu, 17 Feb 2011 12:37:46 -0800 (PST) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id y17sm972323qci.9.2011.02.17.12.37.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Feb 2011 12:37:44 -0800 (PST) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH] cifs: Fix regression in LANMAN (LM) auth code Date: Thu, 17 Feb 2011 14:38:31 -0600 Message-Id: <1297975111-4466-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 17 Feb 2011 20:37:49 +0000 (UTC) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 1adc962..1676570 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -656,13 +656,13 @@ ssetup_ntlmssp_authenticate: if (type == LANMAN) { #ifdef CONFIG_CIFS_WEAK_PW_HASH - char lnm_session_key[CIFS_SESS_KEY_SIZE]; + char lnm_session_key[CIFS_AUTH_RESP_SIZE]; pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE; /* no capabilities flags in old lanman negotiation */ - pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); + pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE); /* Calculate hash with password and copy into bcc_ptr. * Encryption Key (stored as in cryptkey) gets used if the @@ -675,8 +675,8 @@ ssetup_ntlmssp_authenticate: true : false, lnm_session_key); ses->flags |= CIFS_SES_LANMAN; - memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_SESS_KEY_SIZE); - bcc_ptr += CIFS_SESS_KEY_SIZE; + memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE); + bcc_ptr += CIFS_AUTH_RESP_SIZE; /* can not sign if LANMAN negotiated so no need to calculate signing key? but what if server