From f28f113d8e76824b080359c90efd9c92de533740 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 Mar 2009 21:27:58 +1100 Subject: Rework Samba3 to use new libcli/auth code (partial) This commit is mostly to cope with the removal of SamOemHash (replaced by arcfour_crypt()) and other collisions (such as changed function arguments compared to Samba3). We still provide creds_hash3 until Samba3 uses the credentials code in netlogon server Andrew Bartlett --- source3/smbd/chgpasswd.c | 7 ++++--- source3/smbd/trans2.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index ccab71c0a2..72f06fb2ed 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -46,6 +46,7 @@ */ #include "includes.h" +#include "../libcli/auth/libcli_auth.h" static NTSTATUS check_oem_password(const char *user, uchar password_encrypted_with_lm_hash[516], @@ -832,7 +833,7 @@ static NTSTATUS check_oem_password(const char *user, const uint8 *encryption_key; const uint8 *lanman_pw, *nt_pw; uint32 acct_ctrl; - uint32 new_pw_len; + size_t new_pw_len; uchar new_nt_hash[16]; uchar new_lm_hash[16]; uchar verifier[16]; @@ -919,13 +920,13 @@ static NTSTATUS check_oem_password(const char *user, /* * Decrypt the password with the key */ - SamOEMhash( password_encrypted, encryption_key, 516); + arcfour_crypt( password_encrypted, encryption_key, 516); if (!decode_pw_buffer(talloc_tos(), password_encrypted, pp_new_passwd, &new_pw_len, - nt_pass_set ? STR_UNICODE : STR_ASCII)) { + nt_pass_set ? CH_UTF16 : CH_DOS)) { TALLOC_FREE(sampass); return NT_STATUS_WRONG_PASSWORD; } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 04b1145e58..72b4ba0742 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -26,6 +26,7 @@ #include "includes.h" #include "version.h" #include "smbd/globals.h" +#include "../libcli/auth/libcli_auth.h" extern enum protocol_types Protocol; -- cgit