Changeset 745 for trunk/server/source3/auth/auth_compat.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/auth/auth_compat.c
r414 r745 19 19 20 20 #include "includes.h" 21 #include "auth.h" 21 22 22 23 extern struct auth_context *negprot_global_auth_context; … … 31 32 32 33 /**************************************************************************** 33 check if a username/password is OK assuming the password is a 24 byte 34 SMB hash 34 check if a username/password is OK assuming the password is in plaintext 35 35 return True if the password is correct, False otherwise 36 36 ****************************************************************************/ 37 37 38 NTSTATUS check_plaintext_password(const char *smb_name, DATA_BLOB plaintext_password, auth_serversupplied_info **server_info) 38 NTSTATUS check_plaintext_password(const char *smb_name, 39 DATA_BLOB plaintext_blob, 40 struct auth_serversupplied_info **server_info) 39 41 { 40 42 struct auth_context *plaintext_auth_context = NULL; 41 auth_usersupplied_info *user_info = NULL;43 struct auth_usersupplied_info *user_info = NULL; 42 44 uint8_t chal[8]; 43 45 NTSTATUS nt_status; 44 if (!NT_STATUS_IS_OK(nt_status = make_auth_context_subsystem(&plaintext_auth_context))) { 46 47 nt_status = make_auth_context_subsystem(talloc_tos(), 48 &plaintext_auth_context); 49 if (!NT_STATUS_IS_OK(nt_status)) { 45 50 return nt_status; 46 51 } … … 51 56 if (!make_user_info_for_reply(&user_info, 52 57 smb_name, lp_workgroup(), chal, 53 plaintext_ password)) {58 plaintext_blob)) { 54 59 return NT_STATUS_NO_MEMORY; 55 60 } … … 58 63 user_info, server_info); 59 64 60 (plaintext_auth_context->free)(&plaintext_auth_context);65 TALLOC_FREE(plaintext_auth_context); 61 66 free_user_info(&user_info); 62 67 return nt_status; … … 67 72 const char *domain, 68 73 DATA_BLOB lm_pwd, 69 DATA_BLOB nt_pwd, 70 DATA_BLOB plaintext_password, 71 bool encrypted) 74 DATA_BLOB nt_pwd) 72 75 73 76 { 74 77 NTSTATUS nt_status; 75 auth_serversupplied_info *server_info = NULL; 76 if (encrypted) { 77 auth_usersupplied_info *user_info = NULL; 78 if (actx == NULL) { 79 return NT_STATUS_INTERNAL_ERROR; 80 } 81 make_user_info_for_reply_enc(&user_info, smb_name, 82 domain, 83 lm_pwd, 84 nt_pwd); 85 nt_status = actx->check_ntlm_password(actx, user_info, &server_info); 86 free_user_info(&user_info); 87 } else { 88 nt_status = check_plaintext_password(smb_name, plaintext_password, &server_info); 89 } 78 struct auth_serversupplied_info *server_info = NULL; 79 struct auth_usersupplied_info *user_info = NULL; 80 if (actx == NULL) { 81 return NT_STATUS_INTERNAL_ERROR; 82 } 83 make_user_info_for_reply_enc(&user_info, smb_name, 84 domain, 85 lm_pwd, 86 nt_pwd); 87 nt_status = actx->check_ntlm_password(actx, user_info, &server_info); 88 free_user_info(&user_info); 90 89 TALLOC_FREE(server_info); 91 90 return nt_status; … … 112 111 */ 113 112 if (session_workgroup) { 114 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, null_password, password_blob , null_password, encrypted))) {113 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, null_password, password_blob))) { 115 114 return True; 116 115 } 117 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, password_blob, null_password , null_password, encrypted))) {116 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, password_blob, null_password))) { 118 117 return True; 119 118 } 120 119 } 121 120 122 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), null_password, password_blob , null_password, encrypted))) {121 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), null_password, password_blob))) { 123 122 return True; 124 123 } 125 124 126 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), password_blob, null_password , null_password, encrypted))) {125 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), password_blob, null_password))) { 127 126 return True; 128 127 } 129 128 } else { 130 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), null_password, null_password, password_blob, encrypted))) { 129 struct auth_serversupplied_info *server_info = NULL; 130 NTSTATUS nt_status = check_plaintext_password(smb_name, password_blob, &server_info); 131 TALLOC_FREE(server_info); 132 if (NT_STATUS_IS_OK(nt_status)) { 131 133 return True; 132 134 }
Note:
See TracChangeset
for help on using the changeset viewer.