diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-01-06 15:22:24 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-24 17:34:55 +0100 |
commit | f0e7e94ee1bf6a11091a1fc15780e27a57c2ea93 (patch) | |
tree | 817f0a4151d14a1744009f1abdc19b23155403be /source3/libsmb/ntlmssp_sign.c | |
parent | ca2a5693bf85ccfe5abe540e3a725945b52e8039 (diff) | |
download | samba-f0e7e94ee1bf6a11091a1fc15780e27a57c2ea93.tar.gz samba-f0e7e94ee1bf6a11091a1fc15780e27a57c2ea93.tar.xz samba-f0e7e94ee1bf6a11091a1fc15780e27a57c2ea93.zip |
s3:ntlmssp: make send_seal_key and recv_seal_key local variables
metze
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/libsmb/ntlmssp_sign.c')
-rw-r--r-- | source3/libsmb/ntlmssp_sign.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source3/libsmb/ntlmssp_sign.c b/source3/libsmb/ntlmssp_sign.c index cd3a962e87..e3d53ab137 100644 --- a/source3/libsmb/ntlmssp_sign.c +++ b/source3/libsmb/ntlmssp_sign.c @@ -353,7 +353,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_blob, recv_seal_blob; + 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: @@ -397,15 +402,12 @@ NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state) ntlmssp_state->send_sign_key, 16); /* SEND: seal ARCFOUR pad */ - calc_ntlmv2_key(ntlmssp_state->send_seal_key, + calc_ntlmv2_key(send_seal_key, weak_session_key, send_seal_const); - dump_data_pw("NTLMSSP send seal key:\n", - ntlmssp_state->send_seal_key, 16); + dump_data_pw("NTLMSSP send seal key:\n", send_seal_key, 16); - send_seal_key_blob.data = ntlmssp_state->send_seal_key; - send_seal_key_blob.length = 16; arcfour_init(&ntlmssp_state->send_seal_arc4_state, - &send_seal_key_blob); + &send_seal_blob); dump_arc4_state("NTLMSSP send seal arc4 state:\n", &ntlmssp_state->send_seal_arc4_state); @@ -417,16 +419,12 @@ NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state) ntlmssp_state->recv_sign_key, 16); /* RECV: seal ARCFOUR pad */ - calc_ntlmv2_key(ntlmssp_state->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, 16); - dump_data_pw("NTLMSSP recv seal key:\n", - ntlmssp_state->recv_seal_key, 16); - - recv_seal_blob.data = ntlmssp_state->recv_seal_key; - recv_seal_blob.length = 16; arcfour_init(&ntlmssp_state->recv_seal_arc4_state, - &recv_seal_blob); + &recv_seal_blob); dump_arc4_state("NTLMSSP recv seal arc4 state:\n", &ntlmssp_state->recv_seal_arc4_state); |