diff options
author | Luke Leighton <lkcl@samba.org> | 1998-10-09 23:31:50 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-10-09 23:31:50 +0000 |
commit | 78c1fd054f25ae2d0fa57669a0db102bc916577c (patch) | |
tree | bf83af82967874093ba0384be021064f2389e9cd /source3/libsmb/smbencrypt.c | |
parent | abb67ee6deac030c4bc38e166cd3e3ab086ae285 (diff) | |
download | samba-78c1fd054f25ae2d0fa57669a0db102bc916577c.tar.gz samba-78c1fd054f25ae2d0fa57669a0db102bc916577c.tar.xz samba-78c1fd054f25ae2d0fa57669a0db102bc916577c.zip |
dce/rpc
(This used to be commit 8a7ac4a25d177235a98c0f84f97ee50432fb6359)
Diffstat (limited to 'source3/libsmb/smbencrypt.c')
-rw-r--r-- | source3/libsmb/smbencrypt.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c index a9e680ccdd5..27c19d58365 100644 --- a/source3/libsmb/smbencrypt.c +++ b/source3/libsmb/smbencrypt.c @@ -191,3 +191,26 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24) } +BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16]) +{ + int new_pw_len = strlen(passwd); + + if (new_pw_len > 512) + { + DEBUG(0,("make_oem_passwd_hash: new password is too long.\n")); + return False; + } + + /* + * Now setup the data area. + * We need to generate a random fill + * for this area to make it harder to + * decrypt. JRA. + */ + generate_random_buffer((unsigned char *)data, 516, False); + fstrcpy( &data[512 - new_pw_len], passwd); + SIVAL(data, 512, new_pw_len); + + SamOEMhash( (unsigned char *)data, (unsigned char *)old_pw_hash, True); +} + |