summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-08 13:49:54 -0700
committerGünther Deschner <gd@samba.org>2010-03-24 17:34:53 +0100
commit00f99a3df580598442250d38199a457aa8c1b2e7 (patch)
tree5195f86bdb84152a01d2aab95606d3c47c5cbdad
parentfc120dd758277d22c00c3a8b9a1d0e1357fd95bf (diff)
downloadsamba-00f99a3df580598442250d38199a457aa8c1b2e7.tar.gz
samba-00f99a3df580598442250d38199a457aa8c1b2e7.tar.bz2
samba-00f99a3df580598442250d38199a457aa8c1b2e7.zip
s4:ntlmssp: make use of calc_ntlmv2_key() for seal keys
metze Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r--source4/auth/ntlmssp/ntlmssp_sign.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_sign.c b/source4/auth/ntlmssp/ntlmssp_sign.c
index 5466b52d47..f00cbaa017 100644
--- a/source4/auth/ntlmssp/ntlmssp_sign.c
+++ b/source4/auth/ntlmssp/ntlmssp_sign.c
@@ -374,9 +374,12 @@ NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state)
const char *send_seal_const;
const char *recv_sign_const;
const char *recv_seal_const;
-
- DATA_BLOB send_seal_key;
- DATA_BLOB recv_seal_key;
+ uint8_t send_seal_key[16];
+ DATA_BLOB send_seal_blob = data_blob_const(send_seal_key,
+ sizeof(send_seal_key));
+ uint8_t recv_seal_key[16];
+ DATA_BLOB recv_seal_blob = data_blob_const(recv_seal_key,
+ sizeof(recv_seal_key));
switch (ntlmssp_state->role) {
case NTLMSSP_CLIENT:
@@ -432,14 +435,13 @@ NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state)
ntlmssp_state->crypt.ntlm2.send_sign_key.length);
/* SEND: seal ARCFOUR pad */
- calc_ntlmv2_key_talloc(mem_ctx,
- &send_seal_key,
+ calc_ntlmv2_key(send_seal_key,
weak_session_key, send_seal_const);
- dump_data_pw("NTLMSSP send seal key:\n",
- send_seal_key.data,
- send_seal_key.length);
+ dump_data_pw("NTLMSSP send seal key:\n", send_seal_key, 16);
+
arcfour_init(ntlmssp_state->crypt.ntlm2.send_seal_arcfour_state,
- &send_seal_key);
+ &send_seal_blob);
+
dump_data_pw("NTLMSSP send sesl hash:\n",
ntlmssp_state->crypt.ntlm2.send_seal_arcfour_state->sbox,
sizeof(ntlmssp_state->crypt.ntlm2.send_seal_arcfour_state->sbox));
@@ -456,14 +458,13 @@ NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state)
ntlmssp_state->crypt.ntlm2.recv_sign_key.length);
/* RECV: seal ARCFOUR pad */
- calc_ntlmv2_key_talloc(mem_ctx,
- &recv_seal_key,
+ calc_ntlmv2_key(recv_seal_key,
weak_session_key, recv_seal_const);
- dump_data_pw("NTLMSSP recv seal key:\n",
- recv_seal_key.data,
- recv_seal_key.length);
+ dump_data_pw("NTLMSSP recv seal key:\n", recv_seal_key, 16);
+
arcfour_init(ntlmssp_state->crypt.ntlm2.recv_seal_arcfour_state,
- &recv_seal_key);
+ &recv_seal_blob);
+
dump_data_pw("NTLMSSP receive seal hash:\n",
ntlmssp_state->crypt.ntlm2.recv_seal_arcfour_state->sbox,
sizeof(ntlmssp_state->crypt.ntlm2.recv_seal_arcfour_state->sbox));