summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-07-21 13:33:09 -0400
committerSimo Sorce <idra@samba.org>2010-07-28 12:23:00 -0400
commitc08d684f4ef679831e8fed69cd87e4d9b06cb3e0 (patch)
tree9c228e2e6bf292db5861161f8b0d2ca8fc32ab5b /source3
parent866f85e31973de356c3843836d5cacdbdf245e32 (diff)
downloadsamba-c08d684f4ef679831e8fed69cd87e4d9b06cb3e0.tar.gz
samba-c08d684f4ef679831e8fed69cd87e4d9b06cb3e0.tar.bz2
samba-c08d684f4ef679831e8fed69cd87e4d9b06cb3e0.zip
s3-dcerpc: Add auth trailer only when appropriate.
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c20
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;