From patchwork Tue Sep 7 03:32:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 159731 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 o873YZDT011725 for ; Tue, 7 Sep 2010 03:36:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056Ab0IGDgf (ORCPT ); Mon, 6 Sep 2010 23:36:35 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:55258 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959Ab0IGDgf (ORCPT ); Mon, 6 Sep 2010 23:36:35 -0400 Received: by iwn5 with SMTP id 5so4899471iwn.19 for ; Mon, 06 Sep 2010 20:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=0oNNbjXUql4g/kiFuZZa2NKDVR+ZsZdDeCvtWp/XzZQ=; b=jGsj5o/TAABLXzsHYxoBkb5ZjqwQ9HHltKusjqzrTKBW1mrbMFBpCuKYFYSj/8vx81 4Iu/kHLf7lDxjLNmTqxo2Aw5zDbkmRbu/FJRjyyGVt0OlJdg5eT5A54RzSd85rXQiek1 81RdCwl9mbSFaYyhT9IBg9ZKfAK06JYY4o3ZA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=Il2IdUMX3IfVQTQoOP6GoEl06F4KqRFAZfr85Cw5ndxlw3pxps5lriByYHBtW62Ib5 6ba1R9lKyHpbhq0vCfa8OC0RH4MH3Y65ti709eAiP4O7rQ8cybQnkwSTgb4rQUMTUEGv OP+NnoY7ny6IhjR/u1h1rypspZAd5MAJMNvbs= Received: by 10.231.170.13 with SMTP id b13mr7296561ibz.62.1283830594537; Mon, 06 Sep 2010 20:36:34 -0700 (PDT) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id i6sm3803519iba.20.2010.09.06.20.36.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Sep 2010 20:36:33 -0700 (PDT) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH] remove unused function CalcNTLMv2_partial_mac_key Date: Mon, 6 Sep 2010 22:32:20 -0500 Message-Id: <1283830340-24991-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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 07 Sep 2010 03:36:35 +0000 (UTC) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 86e33cc..4f85651 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -224,63 +224,6 @@ int cifs_calculate_mac_key(struct session_key *key, const char *rn, return 0; } -int CalcNTLMv2_partial_mac_key(struct cifsSesInfo *ses, - const struct nls_table *nls_info) -{ - char temp_hash[16]; - struct HMACMD5Context ctx; - char *ucase_buf; - __le16 *unicode_buf; - unsigned int i, user_name_len, dom_name_len; - - if (ses == NULL) - return -EINVAL; - - E_md4hash(ses->password, temp_hash); - - hmac_md5_init_limK_to_64(temp_hash, 16, &ctx); - user_name_len = strlen(ses->userName); - if (user_name_len > MAX_USERNAME_SIZE) - return -EINVAL; - if (ses->domainName == NULL) - return -EINVAL; /* BB should we use CIFS_LINUX_DOM */ - dom_name_len = strlen(ses->domainName); - if (dom_name_len > MAX_USERNAME_SIZE) - return -EINVAL; - - ucase_buf = kmalloc((MAX_USERNAME_SIZE+1), GFP_KERNEL); - if (ucase_buf == NULL) - return -ENOMEM; - unicode_buf = kmalloc((MAX_USERNAME_SIZE+1)*4, GFP_KERNEL); - if (unicode_buf == NULL) { - kfree(ucase_buf); - return -ENOMEM; - } - - for (i = 0; i < user_name_len; i++) - ucase_buf[i] = nls_info->charset2upper[(int)ses->userName[i]]; - ucase_buf[i] = 0; - user_name_len = cifs_strtoUCS(unicode_buf, ucase_buf, - MAX_USERNAME_SIZE*2, nls_info); - unicode_buf[user_name_len] = 0; - user_name_len++; - - for (i = 0; i < dom_name_len; i++) - ucase_buf[i] = nls_info->charset2upper[(int)ses->domainName[i]]; - ucase_buf[i] = 0; - dom_name_len = cifs_strtoUCS(unicode_buf+user_name_len, ucase_buf, - MAX_USERNAME_SIZE*2, nls_info); - - unicode_buf[user_name_len + dom_name_len] = 0; - hmac_md5_update((const unsigned char *) unicode_buf, - (user_name_len+dom_name_len)*2, &ctx); - - hmac_md5_final(ses->server->ntlmv2_hash, &ctx); - kfree(ucase_buf); - kfree(unicode_buf); - return 0; -} - #ifdef CONFIG_CIFS_WEAK_PW_HASH void calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt, char *lnm_session_key)