diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-01-05 18:24:02 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-24 17:34:52 +0100 |
commit | 40395eee5b8a58e980b46a797042fb86ed4b63d8 (patch) | |
tree | 3bf7989a7cefa2fec1a01dfd68f6bd116e3f9027 /source4 | |
parent | 1b20f7192a56933a094733bea042e753c7b27c48 (diff) | |
download | samba-40395eee5b8a58e980b46a797042fb86ed4b63d8.tar.gz samba-40395eee5b8a58e980b46a797042fb86ed4b63d8.tar.bz2 samba-40395eee5b8a58e980b46a797042fb86ed4b63d8.zip |
s4:ntlmssp: move NTLM2 session_nonce to ntlmssp_server_auth_state
metze
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/ntlmssp/ntlmssp.h | 3 | ||||
-rw-r--r-- | source4/auth/ntlmssp/ntlmssp_server.c | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp.h b/source4/auth/ntlmssp/ntlmssp.h index 111b29cbb3..a47a71b66e 100644 --- a/source4/auth/ntlmssp/ntlmssp.h +++ b/source4/auth/ntlmssp/ntlmssp.h @@ -144,9 +144,6 @@ struct ntlmssp_state DATA_BLOB recv_sign_key; struct arcfour_state *send_seal_arcfour_state; struct arcfour_state *recv_seal_arcfour_state; - - /* internal variables used by NTLM2 */ - uint8_t session_nonce[16]; } ntlm2; } crypt; }; diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c index bfee4d4fa5..30077010bc 100644 --- a/source4/auth/ntlmssp/ntlmssp_server.c +++ b/source4/auth/ntlmssp/ntlmssp_server.c @@ -225,6 +225,8 @@ struct ntlmssp_server_auth_state { DATA_BLOB lm_session_key; /* internal variables used by KEY_EXCH (client-supplied user session key */ DATA_BLOB encrypted_session_key; + /* internal variables used by NTLM2 */ + uint8_t session_nonce[16]; }; /** @@ -349,11 +351,11 @@ static NTSTATUS ntlmssp_server_preauth(struct ntlmssp_state *ntlmssp_state, ntlmssp_state->doing_ntlm2 = true; - memcpy(ntlmssp_state->crypt.ntlm2.session_nonce, ntlmssp_state->internal_chal.data, 8); - memcpy(&ntlmssp_state->crypt.ntlm2.session_nonce[8], ntlmssp_state->lm_resp.data, 8); + memcpy(state->session_nonce, ntlmssp_state->internal_chal.data, 8); + memcpy(&state->session_nonce[8], ntlmssp_state->lm_resp.data, 8); MD5Init(&md5_session_nonce_ctx); - MD5Update(&md5_session_nonce_ctx, ntlmssp_state->crypt.ntlm2.session_nonce, 16); + MD5Update(&md5_session_nonce_ctx, state->session_nonce, 16); MD5Final(session_nonce_hash, &md5_session_nonce_ctx); ntlmssp_state->chal = data_blob_talloc(ntlmssp_state, @@ -411,8 +413,8 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security, if (ntlmssp_state->doing_ntlm2) { if (user_session_key && user_session_key->data && user_session_key->length == 16) { session_key = data_blob_talloc(ntlmssp_state, NULL, 16); - hmac_md5(user_session_key->data, ntlmssp_state->crypt.ntlm2.session_nonce, - sizeof(ntlmssp_state->crypt.ntlm2.session_nonce), session_key.data); + hmac_md5(user_session_key->data, state->session_nonce, + sizeof(state->session_nonce), session_key.data); DEBUG(10,("ntlmssp_server_auth: Created NTLM2 session key.\n")); dump_data_pw("NTLM2 session key:\n", session_key.data, session_key.length); |