mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
possible bug in change oem password code: replaced E_P16 and E_md4hash
with a call to nt_lm_owf_gen. if this still doesn't get the NT hash generated correctly then there may instead be a bug in mod_smbpwd_entry(). (This used to be commit 1c8c644210870fef7ea3eddf411b01a98f991fcc)
This commit is contained in:
parent
a0991ee87b
commit
8fb0cd3c11
@ -760,19 +760,12 @@ BOOL check_oem_password(char *user,
|
||||
BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override)
|
||||
{
|
||||
int ret;
|
||||
fstring upper_case_new_passwd;
|
||||
uchar new_nt_p16[16];
|
||||
uchar new_p16[16];
|
||||
|
||||
memset(upper_case_new_passwd, '\0', sizeof(upper_case_new_passwd));
|
||||
fstrcpy(upper_case_new_passwd, new_passwd);
|
||||
strupper(upper_case_new_passwd);
|
||||
|
||||
E_P16((uchar *)upper_case_new_passwd, new_p16);
|
||||
nt_lm_owf_gen(new_passwd, new_nt_p16, new_p16);
|
||||
|
||||
smbpw->smb_passwd = new_p16;
|
||||
|
||||
E_md4hash((uchar *) new_passwd, new_nt_p16);
|
||||
smbpw->smb_nt_passwd = new_nt_p16;
|
||||
|
||||
/* Now write it into the file. */
|
||||
@ -780,7 +773,6 @@ BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL overri
|
||||
ret = mod_smbpwd_entry(smbpw,override);
|
||||
unbecome_root(0);
|
||||
|
||||
memset(upper_case_new_passwd, '\0', strlen(upper_case_new_passwd));
|
||||
memset(new_passwd, '\0', strlen(new_passwd));
|
||||
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user