diff options
author | Jeremy Allison <jra@samba.org> | 2008-02-15 09:35:18 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-02-15 09:35:18 -0800 |
commit | 0e57795f86fafe541d826deb6d49e77e5644a024 (patch) | |
tree | 9b663339dd634f0a6c6565422c2c1e5ccb06c3b8 /source3/libsmb/credentials.c | |
parent | 4737a35ac81803275f2c1edc860a87f31d14f2eb (diff) | |
parent | abdedc7940b187789ffc583dabc778f824039095 (diff) | |
download | samba-0e57795f86fafe541d826deb6d49e77e5644a024.tar.gz samba-0e57795f86fafe541d826deb6d49e77e5644a024.tar.bz2 samba-0e57795f86fafe541d826deb6d49e77e5644a024.zip |
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
(This used to be commit 847874ca757ac8ca32082305c8caed5abc7fed1d)
Diffstat (limited to 'source3/libsmb/credentials.c')
-rw-r--r-- | source3/libsmb/credentials.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/libsmb/credentials.c b/source3/libsmb/credentials.c index 1256a6210e..f03bf22df1 100644 --- a/source3/libsmb/credentials.c +++ b/source3/libsmb/credentials.c @@ -329,6 +329,25 @@ bool creds_client_check(const struct dcinfo *dc, const DOM_CHAL *rcv_srv_chal_in return True; } +bool netlogon_creds_client_check(const struct dcinfo *dc, + const struct netr_Credential *rcv_srv_chal_in) +{ + if (memcmp(dc->srv_chal.data, rcv_srv_chal_in->data, + sizeof(dc->srv_chal.data))) { + + DEBUG(0,("netlogon_creds_client_check: credentials check failed.\n")); + DEBUGADD(5,("netlogon_creds_client_check: challenge : %s\n", + credstr(rcv_srv_chal_in->data))); + DEBUGADD(5,("calculated: %s\n", credstr(dc->srv_chal.data))); + return false; + } + + DEBUG(10,("netlogon_creds_client_check: credentials check OK.\n")); + + return true; +} + + /**************************************************************************** Step the client credentials to the next element in the chain, updating the current client and server credentials and the seed @@ -345,3 +364,15 @@ void creds_client_step(struct dcinfo *dc, DOM_CRED *next_cred_out) next_cred_out->challenge = dc->clnt_chal; next_cred_out->timestamp.time = dc->sequence; } + +void netlogon_creds_client_step(struct dcinfo *dc, + struct netr_Authenticator *next_cred_out) +{ + dc->sequence += 2; + creds_step(dc); + creds_reseed(dc); + + memcpy(&next_cred_out->cred.data, &dc->clnt_chal.data, + sizeof(next_cred_out->cred.data)); + next_cred_out->timestamp = dc->sequence; +} |