Changeset 746 for vendor/current/libcli/auth
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- Location:
- vendor/current/libcli/auth
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/libcli/auth/credentials.c
r740 r746 70 70 unsigned char zero[4], tmp[16]; 71 71 HMACMD5Context ctx; 72 struct MD5Contextmd5;72 MD5_CTX md5; 73 73 74 74 ZERO_STRUCT(creds->session_key); -
vendor/current/libcli/auth/ntlm_check.c
r740 r746 88 88 const DATA_BLOB *sec_blob, 89 89 const char *user, const char *domain, 90 bool upper_case_domain, /* should the domain be transformed into upper case? */91 90 DATA_BLOB *user_sess_key) 92 91 { … … 123 122 */ 124 123 125 if (!ntv2_owf_gen(part_passwd, user, domain, upper_case_domain,kr)) {124 if (!ntv2_owf_gen(part_passwd, user, domain, kr)) { 126 125 return false; 127 126 } … … 162 161 const DATA_BLOB *sec_blob, 163 162 const char *user, const char *domain, 164 bool upper_case_domain, /* should the domain be transformed into upper case? */165 163 DATA_BLOB *user_sess_key) 166 164 { … … 193 191 client_key_data = data_blob_talloc(mem_ctx, ntv2_response->data+16, ntv2_response->length-16); 194 192 195 if (!ntv2_owf_gen(part_passwd, user, domain, upper_case_domain,kr)) {193 if (!ntv2_owf_gen(part_passwd, user, domain, kr)) { 196 194 return false; 197 195 } … … 298 296 const static uint8_t zeros[8]; 299 297 DATA_BLOB tmp_sess_key; 298 const char *upper_client_domain = NULL; 299 300 if (client_domain != NULL) { 301 upper_client_domain = talloc_strdup_upper(mem_ctx, client_domain); 302 if (upper_client_domain == NULL) { 303 return NT_STATUS_NO_MEMORY; 304 } 305 } 300 306 301 307 if (stored_nt == NULL) { … … 349 355 use it 350 356 */ 351 DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with domain [%s]\n", client_domain)); 357 DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with domain [%s]\n", 358 client_domain ? client_domain : "<NULL>")); 352 359 if (smb_pwd_check_ntlmv2(mem_ctx, 353 360 nt_response, … … 355 362 client_username, 356 363 client_domain, 357 false,358 364 user_sess_key)) { 359 365 if (user_sess_key->length) { … … 363 369 } 364 370 365 DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with uppercased version of domain [%s]\n", client_domain)); 371 DEBUG(4,("ntlm_password_check: Checking NTLMv2 password with uppercased version of domain [%s]\n", 372 upper_client_domain ? upper_client_domain : "<NULL>")); 366 373 if (smb_pwd_check_ntlmv2(mem_ctx, 367 374 nt_response, 368 375 stored_nt->hash, challenge, 369 376 client_username, 370 client_domain, 371 true, 377 upper_client_domain, 372 378 user_sess_key)) { 373 379 if (user_sess_key->length) { … … 383 389 client_username, 384 390 "", 385 false,386 391 user_sess_key)) { 387 392 if (user_sess_key->length) { … … 471 476 - related to Win9X, legacy NAS pass-though authentication 472 477 */ 473 DEBUG(4,("ntlm_password_check: Checking LMv2 password with domain %s\n", client_domain)); 478 DEBUG(4,("ntlm_password_check: Checking LMv2 password with domain %s\n", 479 client_domain ? client_domain : "<NULL>")); 474 480 if (smb_pwd_check_ntlmv2(mem_ctx, 475 481 lm_response, … … 477 483 client_username, 478 484 client_domain, 479 false,480 485 &tmp_sess_key)) { 481 486 if (nt_response->length > 24) { … … 489 494 client_username, 490 495 client_domain, 491 false,492 496 user_sess_key); 493 497 } else { … … 501 505 } 502 506 503 DEBUG(4,("ntlm_password_check: Checking LMv2 password with upper-cased version of domain %s\n", client_domain)); 507 DEBUG(4,("ntlm_password_check: Checking LMv2 password with upper-cased version of domain %s\n", 508 upper_client_domain ? upper_client_domain : "<NULL>")); 504 509 if (smb_pwd_check_ntlmv2(mem_ctx, 505 510 lm_response, 506 511 stored_nt->hash, challenge, 507 512 client_username, 508 client_domain, 509 true, 513 upper_client_domain, 510 514 &tmp_sess_key)) { 511 515 if (nt_response->length > 24) { … … 518 522 stored_nt->hash, challenge, 519 523 client_username, 520 client_domain, 521 true, 524 upper_client_domain, 522 525 user_sess_key); 523 526 } else { … … 537 540 client_username, 538 541 "", 539 false,540 542 &tmp_sess_key)) { 541 543 if (nt_response->length > 24) { … … 549 551 client_username, 550 552 "", 551 false,552 553 user_sess_key); 553 554 } else { -
vendor/current/libcli/auth/ntlmssp_server.c
r740 r746 360 360 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_NTLM2) { 361 361 if (ntlmssp_state->nt_resp.length == 24 && ntlmssp_state->lm_resp.length == 24) { 362 struct MD5Contextmd5_session_nonce_ctx;362 MD5_CTX md5_session_nonce_ctx; 363 363 state->doing_ntlm2 = true; 364 364 -
vendor/current/libcli/auth/ntlmssp_sign.c
r740 r746 52 52 const char *constant) 53 53 { 54 struct MD5Contextctx3;54 MD5_CTX ctx3; 55 55 MD5Init(&ctx3); 56 56 MD5Update(&ctx3, session_key.data, session_key.length); -
vendor/current/libcli/auth/proto.h
r740 r746 110 110 bool ntv2_owf_gen(const uint8_t owf[16], 111 111 const char *user_in, const char *domain_in, 112 bool upper_case_domain, /* Transform the domain into UPPER case */113 112 uint8_t kr_buf[16]); 114 113 void SMBOWFencrypt(const uint8_t passwd[16], const uint8_t *c8, uint8_t p24[24]); -
vendor/current/libcli/auth/schannel_sign.c
r740 r746 111 111 uint8_t packet_digest[16]; 112 112 static const uint8_t zeros[4]; 113 struct MD5Contextctx;113 MD5_CTX ctx; 114 114 115 115 MD5Init(&ctx); -
vendor/current/libcli/auth/smbencrypt.c
r740 r746 100 100 void E_md5hash(const uint8_t salt[16], const uint8_t nthash[16], uint8_t hash_out[16]) 101 101 { 102 struct MD5Contexttctx;102 MD5_CTX tctx; 103 103 MD5Init(&tctx); 104 104 MD5Update(&tctx, salt, 16); … … 169 169 bool ntv2_owf_gen(const uint8_t owf[16], 170 170 const char *user_in, const char *domain_in, 171 bool upper_case_domain, /* Transform the domain into UPPER case */172 171 uint8_t kr_buf[16]) 173 172 { … … 197 196 talloc_free(mem_ctx); 198 197 return false; 199 }200 201 if (upper_case_domain) {202 domain_in = strupper_talloc(mem_ctx, domain_in);203 if (domain_in == NULL) {204 talloc_free(mem_ctx);205 return false;206 }207 198 } 208 199 … … 475 466 This prevents username swapping during the auth exchange 476 467 */ 477 if (!ntv2_owf_gen(nt_hash, user, domain, true,ntlm_v2_hash)) {468 if (!ntv2_owf_gen(nt_hash, user, domain, ntlm_v2_hash)) { 478 469 return false; 479 470 } … … 624 615 void encode_or_decode_arc4_passwd_buffer(unsigned char pw_buf[532], const DATA_BLOB *psession_key) 625 616 { 626 struct MD5Contexttctx;617 MD5_CTX tctx; 627 618 unsigned char key_out[16]; 628 619 … … 704 695 { 705 696 uint8_t buffer[516]; 706 struct MD5Contextctx;697 MD5_CTX ctx; 707 698 struct wkssvc_PasswordBuffer *my_pwd_buf = NULL; 708 699 DATA_BLOB confounded_session_key; … … 742 733 { 743 734 uint8_t buffer[516]; 744 struct MD5Contextctx;735 MD5_CTX ctx; 745 736 size_t pwd_len; 746 737
Note:
See TracChangeset
for help on using the changeset viewer.