summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-12 11:54:37 +0100
committerVolker Lendecke <vl@samba.org>2008-02-28 13:12:34 +0100
commit4b5169f590425334d9ae3f2b7be2201e2e0b747e (patch)
tree382d673a93b54b107ac13255d92ea905da2c00c1
parentbbe6d400e7bbc0089c8158a49a5d8d0b5717125f (diff)
downloadsamba-4b5169f590425334d9ae3f2b7be2201e2e0b747e.tar.gz
samba-4b5169f590425334d9ae3f2b7be2201e2e0b747e.tar.bz2
samba-4b5169f590425334d9ae3f2b7be2201e2e0b747e.zip
Add explicit buf arg to cli_encrypt_message and cli_calculate_sign_mac
(This used to be commit db6ae9ed2326e6cd68475375d049084cf1d5a98c)
-rw-r--r--source3/libsmb/cliconnect.c2
-rw-r--r--source3/libsmb/clientgen.c5
-rw-r--r--source3/libsmb/smb_seal.c6
-rw-r--r--source3/libsmb/smb_signing.c4
4 files changed, 9 insertions, 8 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index d88a5d6242..9c27d30166 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -757,7 +757,7 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli, const char *use
/* 'resign' the last message, so we get the right sequence numbers
for checking the first reply from the server */
- cli_calculate_sign_mac(cli);
+ cli_calculate_sign_mac(cli, cli->outbuf);
if (!cli_check_sign_mac(cli)) {
nt_status = NT_STATUS_ACCESS_DENIED;
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 3b7669f33e..2fd304f135 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -343,10 +343,11 @@ bool cli_send_smb(struct cli_state *cli)
if (cli->fd == -1)
return false;
- cli_calculate_sign_mac(cli);
+ cli_calculate_sign_mac(cli, cli->outbuf);
if (enc_on) {
- NTSTATUS status = cli_encrypt_message(cli, &buf_out);
+ NTSTATUS status = cli_encrypt_message(cli, cli->outbuf,
+ &buf_out);
if (!NT_STATUS_IS_OK(status)) {
close(cli->fd);
cli->fd = -1;
diff --git a/source3/libsmb/smb_seal.c b/source3/libsmb/smb_seal.c
index b5befbf7cd..a81ae9afd5 100644
--- a/source3/libsmb/smb_seal.c
+++ b/source3/libsmb/smb_seal.c
@@ -483,15 +483,15 @@ NTSTATUS cli_decrypt_message(struct cli_state *cli)
Encrypt an outgoing buffer. Return the encrypted pointer in buf_out.
******************************************************************************/
-NTSTATUS cli_encrypt_message(struct cli_state *cli, char **buf_out)
+NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out)
{
/* Ignore non-session messages. */
- if(CVAL(cli->outbuf,0)) {
+ if (CVAL(buf,0)) {
return NT_STATUS_OK;
}
/* If we supported multiple encrytion contexts
* here we'd look up based on tid.
*/
- return common_encrypt_buffer(cli->trans_enc_state, cli->outbuf, buf_out);
+ return common_encrypt_buffer(cli->trans_enc_state, buf, buf_out);
}
diff --git a/source3/libsmb/smb_signing.c b/source3/libsmb/smb_signing.c
index f03c21bd0e..eeaf28c3d1 100644
--- a/source3/libsmb/smb_signing.c
+++ b/source3/libsmb/smb_signing.c
@@ -573,9 +573,9 @@ void cli_free_signing_context(struct cli_state *cli)
* Sign a packet with the current mechanism
*/
-void cli_calculate_sign_mac(struct cli_state *cli)
+void cli_calculate_sign_mac(struct cli_state *cli, char *buf)
{
- cli->sign_info.sign_outgoing_message(cli->outbuf, &cli->sign_info);
+ cli->sign_info.sign_outgoing_message(buf, &cli->sign_info);
}
/**