Re: [PATCH] remove unused function CalcNTLMv2_partial_mac_key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 7, 2010 at 7:26 AM, Jeff Layton <jlayton@xxxxxxxxx> wrote:
> On Tue, 7 Sep 2010 07:12:48 -0500
> Shirish Pargaonkar <shirishpargaonkar@xxxxxxxxx> wrote:
>
>> This gets removed in one of the patches.
>>
>
> Why do it there and not here? What's the point of a function prototype
> in a header with no function to back it up?
>
>> On Tue, Sep 7, 2010 at 6:17 AM, Jeff Layton <jlayton@xxxxxxxxx> wrote:
>> > On Mon,  6 Sep 2010 22:32:20 -0500
>> > shirishpargaonkar@xxxxxxxxx wrote:
>> >
>> >> From: Shirish Pargaonkar <shirishpargaonkar@xxxxxxxxx>
>> >>
>> >> Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@xxxxxxxxx>
>> >> ---
>> >>  fs/cifs/cifsencrypt.c |   57 -------------------------------------------------
>> >>  1 files changed, 0 insertions(+), 57 deletions(-)
>> >>
>> >> 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)
>> >
>> > What about the declaration in cifsproto.h?
>> >
>> > Other than that...strong ACK here. We should get rid of as much unused
>> > bloat as possible.
>> >
>> > --
>> > Jeff Layton <jlayton@xxxxxxxxx>
>> >
>>
>
>
> --
> Jeff Layton <jlayton@xxxxxxxxx>
>

sure. next spin, will get rid of them in pair.
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux