Commit 4266d9118f85b050a341992f0cfab40d392ef32c
1 parent
639e7a913d
Exists in
master
and in
4 other branches
[CIFS] ntlmv2/ntlmssp remove-unused-function CalcNTLMv2_partial_mac_key
This function is not used, so remove the definition and declaration. Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Showing 2 changed files with 0 additions and 59 deletions Side-by-side Diff
fs/cifs/cifsencrypt.c
... | ... | @@ -223,63 +223,6 @@ |
223 | 223 | return 0; |
224 | 224 | } |
225 | 225 | |
226 | -int CalcNTLMv2_partial_mac_key(struct cifsSesInfo *ses, | |
227 | - const struct nls_table *nls_info) | |
228 | -{ | |
229 | - char temp_hash[16]; | |
230 | - struct HMACMD5Context ctx; | |
231 | - char *ucase_buf; | |
232 | - __le16 *unicode_buf; | |
233 | - unsigned int i, user_name_len, dom_name_len; | |
234 | - | |
235 | - if (ses == NULL) | |
236 | - return -EINVAL; | |
237 | - | |
238 | - E_md4hash(ses->password, temp_hash); | |
239 | - | |
240 | - hmac_md5_init_limK_to_64(temp_hash, 16, &ctx); | |
241 | - user_name_len = strlen(ses->userName); | |
242 | - if (user_name_len > MAX_USERNAME_SIZE) | |
243 | - return -EINVAL; | |
244 | - if (ses->domainName == NULL) | |
245 | - return -EINVAL; /* BB should we use CIFS_LINUX_DOM */ | |
246 | - dom_name_len = strlen(ses->domainName); | |
247 | - if (dom_name_len > MAX_USERNAME_SIZE) | |
248 | - return -EINVAL; | |
249 | - | |
250 | - ucase_buf = kmalloc((MAX_USERNAME_SIZE+1), GFP_KERNEL); | |
251 | - if (ucase_buf == NULL) | |
252 | - return -ENOMEM; | |
253 | - unicode_buf = kmalloc((MAX_USERNAME_SIZE+1)*4, GFP_KERNEL); | |
254 | - if (unicode_buf == NULL) { | |
255 | - kfree(ucase_buf); | |
256 | - return -ENOMEM; | |
257 | - } | |
258 | - | |
259 | - for (i = 0; i < user_name_len; i++) | |
260 | - ucase_buf[i] = nls_info->charset2upper[(int)ses->userName[i]]; | |
261 | - ucase_buf[i] = 0; | |
262 | - user_name_len = cifs_strtoUCS(unicode_buf, ucase_buf, | |
263 | - MAX_USERNAME_SIZE*2, nls_info); | |
264 | - unicode_buf[user_name_len] = 0; | |
265 | - user_name_len++; | |
266 | - | |
267 | - for (i = 0; i < dom_name_len; i++) | |
268 | - ucase_buf[i] = nls_info->charset2upper[(int)ses->domainName[i]]; | |
269 | - ucase_buf[i] = 0; | |
270 | - dom_name_len = cifs_strtoUCS(unicode_buf+user_name_len, ucase_buf, | |
271 | - MAX_USERNAME_SIZE*2, nls_info); | |
272 | - | |
273 | - unicode_buf[user_name_len + dom_name_len] = 0; | |
274 | - hmac_md5_update((const unsigned char *) unicode_buf, | |
275 | - (user_name_len+dom_name_len)*2, &ctx); | |
276 | - | |
277 | - hmac_md5_final(ses->server->ntlmv2_hash, &ctx); | |
278 | - kfree(ucase_buf); | |
279 | - kfree(unicode_buf); | |
280 | - return 0; | |
281 | -} | |
282 | - | |
283 | 226 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
284 | 227 | void calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt, |
285 | 228 | char *lnm_session_key) |
fs/cifs/cifsproto.h
... | ... | @@ -365,8 +365,6 @@ |
365 | 365 | __u32 expected_sequence_number); |
366 | 366 | extern int cifs_calculate_mac_key(struct mac_key *key, const char *rn, |
367 | 367 | const char *pass); |
368 | -extern int CalcNTLMv2_partial_mac_key(struct cifsSesInfo *, | |
369 | - const struct nls_table *); | |
370 | 368 | extern void CalcNTLMv2_response(const struct cifsSesInfo *, char *); |
371 | 369 | extern void setup_ntlmv2_rsp(struct cifsSesInfo *, char *, |
372 | 370 | const struct nls_table *); |