From: Luke Leighton Date: Fri, 23 Oct 1998 15:21:37 +0000 (+0000) Subject: possible bug in change oem password code: replaced E_P16 and E_md4hash X-Git-Tag: samba-4.0.0alpha6~801^2~21393 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=8fb0cd3c11ec58da9e292fd3acaf77e8d45e1522;hp=a0991ee87bdfdf66850114bc04cdd577ef87d000 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) --- diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 59022c80a83..4369573fe80 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -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;