diff options
author | Luke Leighton <lkcl@samba.org> | 2000-01-03 19:19:48 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-01-03 19:19:48 +0000 |
commit | fbd17c8dafeefac788f4bc1c41045726825f513f (patch) | |
tree | 93aea0a144e9f649d32d7340e12ec9965aab6825 /source3/libsmb | |
parent | 632b4f806eae15e319b8f62caef5d25634cf720c (diff) | |
download | samba-fbd17c8dafeefac788f4bc1c41045726825f513f.tar.gz samba-fbd17c8dafeefac788f4bc1c41045726825f513f.tar.bz2 samba-fbd17c8dafeefac788f4bc1c41045726825f513f.zip |
simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
(This used to be commit 8976e26d46cb991710bc77463f7f928ac00dd4d8)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/pwd_cache.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/source3/libsmb/pwd_cache.c b/source3/libsmb/pwd_cache.c index 94b60d3ff0..4f02c42efb 100644 --- a/source3/libsmb/pwd_cache.c +++ b/source3/libsmb/pwd_cache.c @@ -62,6 +62,60 @@ void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key) } /**************************************************************************** +compares two passwords. hmm, not as trivial as expected. hmm. +****************************************************************************/ +BOOL pwd_compare(struct pwd_info *pwd1, struct pwd_info *pwd2) +{ + pwd_deobfuscate(pwd1); + pwd_deobfuscate(pwd2); + if (pwd1->cleartext && pwd2->cleartext) + { + if (strequal(pwd1->password, pwd2->password)) + { + pwd_obfuscate(pwd1); + pwd_obfuscate(pwd2); + return True; + } + } + if (pwd1->null_pwd && pwd2->null_pwd) + { + pwd_obfuscate(pwd1); + pwd_obfuscate(pwd2); + return True; + } + + if (!pwd1->null_pwd && !pwd2->null_pwd && + !pwd1->cleartext && !pwd2->cleartext) + { +#ifdef DEBUG_PASSWORD + DEBUG(100,("pwd compare: nt#\n")); + dump_data(100, pwd1->smb_nt_pwd, 16); + dump_data(100, pwd2->smb_nt_pwd, 16); +#endif + if (memcmp(pwd1->smb_nt_pwd, pwd2->smb_nt_pwd, 16) == 0) + { + pwd_obfuscate(pwd1); + pwd_obfuscate(pwd2); + return True; + } +#ifdef DEBUG_PASSWORD + DEBUG(100,("pwd compare: lm#\n")); + dump_data(100, pwd1->smb_lm_pwd, 16); + dump_data(100, pwd2->smb_lm_pwd, 16); +#endif + if (memcmp(pwd1->smb_lm_pwd, pwd2->smb_lm_pwd, 16) == 0) + { + pwd_obfuscate(pwd1); + pwd_obfuscate(pwd2); + return True; + } + } + pwd_obfuscate(pwd1); + pwd_obfuscate(pwd2); + return False; +} + +/**************************************************************************** reads a password ****************************************************************************/ void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt) |