Changeset 77 for trunk/samba/source/utils/ntlm_auth.c
- Timestamp:
- Sep 30, 2007, 3:42:50 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/utils/ntlm_auth.c
r22 r77 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 along with this program. If not, see <http://www.gnu.org/licenses/>. 24 23 */ 25 24 … … 365 364 if (error_string) 366 365 *error_string = smb_xstrdup("Reading winbind reply failed!"); 367 free_response(&response);366 winbindd_free_response(&response); 368 367 return nt_status; 369 368 } … … 373 372 if (error_string) 374 373 *error_string = smb_xstrdup(response.data.auth.error_string); 375 free_response(&response);374 winbindd_free_response(&response); 376 375 return nt_status; 377 376 } … … 389 388 *unix_name = SMB_STRDUP((char *)response.extra_data.data); 390 389 if (!*unix_name) { 391 free_response(&response);390 winbindd_free_response(&response); 392 391 return NT_STATUS_NO_MEMORY; 393 392 } 394 393 } 395 394 396 free_response(&response);395 winbindd_free_response(&response); 397 396 return nt_status; 398 397 } … … 460 459 if (error_string) 461 460 *error_string = smb_xstrdup("Reading winbind reply failed!"); 462 free_response(&response);461 winbindd_free_response(&response); 463 462 return nt_status; 464 463 } … … 469 468 if (error_string) 470 469 *error_string = smb_xstrdup(response.data.auth.error_string); 471 free_response(&response);470 winbindd_free_response(&response); 472 471 return nt_status; 473 472 } 474 473 475 free_response(&response);474 winbindd_free_response(&response); 476 475 477 476 return nt_status; … … 660 659 661 660 if (result != NSS_STATUS_SUCCESS) { 662 free_response(&wb_response);661 winbindd_free_response(&wb_response); 663 662 return NT_STATUS_UNSUCCESSFUL; 664 663 } … … 669 668 if (wb_response.data.ccache_ntlm_auth.auth_blob_len > 0 && 670 669 reply->data == NULL) { 671 free_response(&wb_response);670 winbindd_free_response(&wb_response); 672 671 return NT_STATUS_NO_MEMORY; 673 672 } 674 673 } 675 674 676 free_response(&wb_response);675 winbindd_free_response(&wb_response); 677 676 return NT_STATUS_MORE_PROCESSING_REQUIRED; 678 677 } … … 705 704 request = base64_decode_data_blob(buf + 3); 706 705 } else { 707 request = data_blob (NULL, 0);706 request = data_blob_null; 708 707 } 709 708 … … 762 761 763 762 DEBUG(10, ("got NTLMSSP packet:\n")); 764 dump_data(10, (const char *)request.data, request.length);763 dump_data(10, request.data, request.length); 765 764 766 765 nt_status = ntlmssp_update(ntlmssp_state, request, &reply); … … 833 832 request = base64_decode_data_blob(buf + 3); 834 833 } else { 835 request = data_blob (NULL, 0);834 request = data_blob_null; 836 835 } 837 836 … … 855 854 if (!ntlmssp_state && use_cached_creds) { 856 855 /* check whether credentials are usable. */ 857 DATA_BLOB empty_blob = data_blob (NULL, 0);856 DATA_BLOB empty_blob = data_blob_null; 858 857 859 858 nt_status = do_ccache_ntlm_auth(empty_blob, empty_blob, NULL); … … 911 910 ntlmssp_want_feature_list(ntlmssp_state, want_feature_list); 912 911 first = True; 913 initial_message = data_blob (NULL, 0);912 initial_message = data_blob_null; 914 913 } 915 914 916 915 DEBUG(10, ("got NTLMSSP packet:\n")); 917 dump_data(10, (const char *)request.data, request.length);916 dump_data(10, request.data, request.length); 918 917 919 918 if (use_cached_creds && !opt_password && !first) { … … 1136 1135 1137 1136 DEBUG(10, ("got NTLMSSP packet:\n")); 1138 dump_data(10, (const char *)request.negTokenInit.mechToken.data,1137 dump_data(10, request.negTokenInit.mechToken.data, 1139 1138 request.negTokenInit.mechToken.length); 1140 1139 1141 1140 response.type = SPNEGO_NEG_TOKEN_TARG; 1142 1141 response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP); 1143 response.negTokenTarg.mechListMIC = data_blob (NULL, 0);1142 response.negTokenTarg.mechListMIC = data_blob_null; 1144 1143 1145 1144 status = ntlmssp_update(ntlmssp_state, … … 1164 1163 response.type = SPNEGO_NEG_TOKEN_TARG; 1165 1164 response.negTokenTarg.supportedMech = SMB_STRDUP(OID_KERBEROS5_OLD); 1166 response.negTokenTarg.mechListMIC = data_blob (NULL, 0);1167 response.negTokenTarg.responseToken = data_blob (NULL, 0);1165 response.negTokenTarg.mechListMIC = data_blob_null; 1166 response.negTokenTarg.responseToken = data_blob_null; 1168 1167 1169 1168 status = ads_verify_ticket(mem_ctx, lp_realm(), 0, 1170 1169 &request.negTokenInit.mechToken, 1171 1170 &principal, NULL, &ap_rep, 1172 &session_key );1171 &session_key, True); 1173 1172 1174 1173 talloc_destroy(mem_ctx); … … 1223 1222 response.type = SPNEGO_NEG_TOKEN_TARG; 1224 1223 response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP); 1225 response.negTokenTarg.mechListMIC = data_blob (NULL, 0);1224 response.negTokenTarg.mechListMIC = data_blob_null; 1226 1225 1227 1226 if (NT_STATUS_IS_OK(status)) { … … 1277 1276 { 1278 1277 NTSTATUS status; 1279 DATA_BLOB null_blob = data_blob (NULL, 0);1278 DATA_BLOB null_blob = data_blob_null; 1280 1279 DATA_BLOB to_server; 1281 1280 char *to_server_base64; … … 1338 1337 { 1339 1338 NTSTATUS status; 1340 DATA_BLOB null_blob = data_blob (NULL, 0);1339 DATA_BLOB null_blob = data_blob_null; 1341 1340 DATA_BLOB request; 1342 1341 DATA_BLOB to_server; … … 1399 1398 char *principal; 1400 1399 DATA_BLOB tkt, to_server; 1401 DATA_BLOB session_key_krb5 = data_blob (NULL, 0);1400 DATA_BLOB session_key_krb5 = data_blob_null; 1402 1401 SPNEGO_DATA reply; 1403 1402 char *reply_base64; … … 1463 1462 reply.negTokenInit.reqFlags = 0; 1464 1463 reply.negTokenInit.mechToken = tkt; 1465 reply.negTokenInit.mechListMIC = data_blob (NULL, 0);1464 reply.negTokenInit.mechListMIC = data_blob_null; 1466 1465 1467 1466 len = write_spnego_data(&to_server, &reply); … … 1752 1751 } 1753 1752 /* clear out the state */ 1754 challenge = data_blob (NULL, 0);1755 nt_response = data_blob (NULL, 0);1756 lm_response = data_blob (NULL, 0);1753 challenge = data_blob_null; 1754 nt_response = data_blob_null; 1755 lm_response = data_blob_null; 1757 1756 SAFE_FREE(full_username); 1758 1757 SAFE_FREE(username); … … 1801 1800 parameter, 1802 1801 (int)challenge.length); 1803 challenge = data_blob (NULL, 0);1802 challenge = data_blob_null; 1804 1803 } 1805 1804 } else if (strequal(request, "NT-Response")) { … … 1809 1808 parameter, 1810 1809 (int)nt_response.length); 1811 nt_response = data_blob (NULL, 0);1810 nt_response = data_blob_null; 1812 1811 } 1813 1812 } else if (strequal(request, "LANMAN-Response")) { … … 1817 1816 parameter, 1818 1817 (int)lm_response.length); 1819 lm_response = data_blob (NULL, 0);1818 lm_response = data_blob_null; 1820 1819 } 1821 1820 } else if (strequal(request, "Password")) { … … 1951 1950 } 1952 1951 /* clear out the state */ 1953 new_nt_pswd = data_blob (NULL, 0);1954 old_nt_hash_enc = data_blob (NULL, 0);1955 new_lm_pswd = data_blob (NULL, 0);1956 old_nt_hash_enc = data_blob (NULL, 0);1952 new_nt_pswd = data_blob_null; 1953 old_nt_hash_enc = data_blob_null; 1954 new_lm_pswd = data_blob_null; 1955 old_nt_hash_enc = data_blob_null; 1957 1956 SAFE_FREE(full_username); 1958 1957 SAFE_FREE(username); … … 2000 1999 parameter, 2001 2000 (int)new_nt_pswd.length); 2002 new_nt_pswd = data_blob (NULL, 0);2001 new_nt_pswd = data_blob_null; 2003 2002 } 2004 2003 } else if (strequal(request, "old-nt-hash-blob")) { … … 2009 2008 parameter, 2010 2009 (int)old_nt_hash_enc.length); 2011 old_nt_hash_enc = data_blob (NULL, 0);2010 old_nt_hash_enc = data_blob_null; 2012 2011 } 2013 2012 } else if (strequal(request, "new-lm-password-blob")) { … … 2018 2017 parameter, 2019 2018 (int)new_lm_pswd.length); 2020 new_lm_pswd = data_blob (NULL, 0);2019 new_lm_pswd = data_blob_null; 2021 2020 } 2022 2021 } … … 2029 2028 parameter, 2030 2029 (int)old_lm_hash_enc.length); 2031 old_lm_hash_enc = data_blob (NULL, 0);2030 old_lm_hash_enc = data_blob_null; 2032 2031 } 2033 2032 } else if (strequal(request, "nt-domain")) {
Note:
See TracChangeset
for help on using the changeset viewer.