diff options
author | Simo Sorce <idra@samba.org> | 2010-07-21 13:33:09 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-28 12:23:00 -0400 |
commit | c08d684f4ef679831e8fed69cd87e4d9b06cb3e0 (patch) | |
tree | 9c228e2e6bf292db5861161f8b0d2ca8fc32ab5b /source3/rpc_client | |
parent | 866f85e31973de356c3843836d5cacdbdf245e32 (diff) | |
download | samba-c08d684f4ef679831e8fed69cd87e4d9b06cb3e0.tar.gz samba-c08d684f4ef679831e8fed69cd87e4d9b06cb3e0.tar.bz2 samba-c08d684f4ef679831e8fed69cd87e4d9b06cb3e0.zip |
s3-dcerpc: Add auth trailer only when appropriate.
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 20 |
1 files changed, 16 insertions, 4 deletions
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; |