diff options
author | Jeremy Allison <jra@samba.org> | 1998-03-19 20:06:47 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-03-19 20:06:47 +0000 |
commit | 20770b6f1c25288e90d3e0d215afa7f0809ce124 (patch) | |
tree | ff60815a291db1bf9e95ff4cba0c3c2ffa2f8b70 /source/libsmb/smbdes.c | |
parent | e02e3bcbbd4333113dde7bef47763fb229148007 (diff) | |
download | samba-20770b6f1c25288e90d3e0d215afa7f0809ce124.tar.gz samba-20770b6f1c25288e90d3e0d215afa7f0809ce124.tar.xz samba-20770b6f1c25288e90d3e0d215afa7f0809ce124.zip |
Adding the same changes to HEAD as were added to BRANCH_1_9_18.
Changed smbpasswd to be client-server for a normal user, rather
than accessing the private/smbpasswd file directly (it still accesses
this file directly when run as root, so root can add users/change a
users password without knowing the old password).
A shakeout of this change is that smbpasswd can now be used to
change a users password on a remote NT machine (yep - you heard
that one right - we can now change a NT password from UNIX !!!!!).
Jeremy.
Diffstat (limited to 'source/libsmb/smbdes.c')
-rw-r--r-- | source/libsmb/smbdes.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/libsmb/smbdes.c b/source/libsmb/smbdes.c index 8f95a5a297b..e5d8f4a1e0b 100644 --- a/source/libsmb/smbdes.c +++ b/source/libsmb/smbdes.c @@ -323,6 +323,12 @@ void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out) smbhash(out+8, in+8, p14+7, 0); } +void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out) +{ + smbhash(out, in, p14, 1); + smbhash(out+8, in+8, p14+7, 1); +} + void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key) { unsigned char buf[8]; @@ -341,7 +347,7 @@ void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key) smbhash(out, buf, key2, 1); } -void SamOEMhash( unsigned char *data, unsigned char *key) +void SamOEMhash( unsigned char *data, unsigned char *key, int val) { unsigned char s_box[256]; unsigned char index_i = 0; @@ -365,7 +371,7 @@ void SamOEMhash( unsigned char *data, unsigned char *key) s_box[j] = tc; } - for( ind = 0; ind < 516; ind++) + for( ind = 0; ind < (val ? 516 : 16); ind++) { unsigned char tc; unsigned char t; |