From c08d684f4ef679831e8fed69cd87e4d9b06cb3e0 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 21 Jul 2010 13:33:09 -0400 Subject: s3-dcerpc: Add auth trailer only when appropriate. --- source3/rpc_client/cli_pipe.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 9274a1da5e..093f4980f6 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1288,6 +1288,7 @@ static uint32 calculate_data_len_tosend(struct rpc_pipe_client *cli, switch (cli->auth->auth_level) { case DCERPC_AUTH_LEVEL_NONE: case DCERPC_AUTH_LEVEL_CONNECT: + case DCERPC_AUTH_LEVEL_PACKET: data_space = cli->max_xmit_frag - DCERPC_REQUEST_LENGTH; data_len = MIN(data_space, data_left); *p_ss_padding = 0; @@ -1486,10 +1487,21 @@ static NTSTATUS prepare_next_frag(struct rpc_api_pipe_req_state *state, return NT_STATUS_NO_MEMORY; } - status = dcerpc_add_auth_footer(state->cli->auth, ss_padding, - &state->rpc_out); - if (!NT_STATUS_IS_OK(status)) { - return status; + switch (state->cli->auth->auth_level) { + case DCERPC_AUTH_LEVEL_NONE: + case DCERPC_AUTH_LEVEL_CONNECT: + case DCERPC_AUTH_LEVEL_PACKET: + break; + case DCERPC_AUTH_LEVEL_INTEGRITY: + case DCERPC_AUTH_LEVEL_PRIVACY: + status = dcerpc_add_auth_footer(state->cli->auth, ss_padding, + &state->rpc_out); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + break; + default: + return NT_STATUS_INVALID_PARAMETER; } state->req_data_sent += data_sent_thistime; -- cgit