diff options
author | Luke Leighton <lkcl@samba.org> | 1998-10-10 00:46:28 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-10-10 00:46:28 +0000 |
commit | 827a9d862ebe3d5ce1853999d16bd121fddcc796 (patch) | |
tree | 90f001fc27b4c65b9104cc910a3525eb7ca04941 /source3/libsmb | |
parent | 78c1fd054f25ae2d0fa57669a0db102bc916577c (diff) | |
download | samba-827a9d862ebe3d5ce1853999d16bd121fddcc796.tar.gz samba-827a9d862ebe3d5ce1853999d16bd121fddcc796.tar.bz2 samba-827a9d862ebe3d5ce1853999d16bd121fddcc796.zip |
dce/rpc
(This used to be commit dfb48aab6153e53a5efd1f8ee518375cc584b101)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 2 | ||||
-rw-r--r-- | source3/libsmb/smbencrypt.c | 18 |
2 files changed, 15 insertions, 5 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 72d7ca935b..64e67c5522 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -2052,7 +2052,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_passwo strupper(upper_case_old_pw); E_P16((uchar *)upper_case_old_pw, old_pw_hash); - if (!make_oem_passwd_hash( data, new_password, old_pw_hash)) + if (!make_oem_passwd_hash( data, new_password, old_pw_hash, False)) { return False; } diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c index 27c19d5836..7caf417ea1 100644 --- a/source3/libsmb/smbencrypt.c +++ b/source3/libsmb/smbencrypt.c @@ -190,10 +190,9 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24) #endif } - -BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16]) +BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16], BOOL unicode) { - int new_pw_len = strlen(passwd); + int new_pw_len = strlen(passwd) * (unicode ? 2 : 1); if (new_pw_len > 512) { @@ -208,9 +207,20 @@ BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16]) * decrypt. JRA. */ generate_random_buffer((unsigned char *)data, 516, False); - fstrcpy( &data[512 - new_pw_len], passwd); + if (unicode) + { + struni2( (uint16*)(&data[512 - new_pw_len]), passwd); + } + else + { + fstrcpy( &data[512 - new_pw_len], passwd); + } SIVAL(data, 512, new_pw_len); +#ifdef DEBUG_PASSWORD + DEBUG(100,("make_oem_passwd_hash\n")); + dump_data(100, data, 516); +#endif SamOEMhash( (unsigned char *)data, (unsigned char *)old_pw_hash, True); } |