summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-07-08 15:04:40 -0400
committerSimo Sorce <idra@samba.org>2010-07-08 18:38:55 -0400
commit559113596478a5ac8f5227bc25a3720db56314fe (patch)
treed583b4a557ef1ca8da55a3e6c517229b7fd4b583 /source3
parent1febe9de6b6137d575ac1b1263e7d1f7a29cea1f (diff)
downloadsamba-559113596478a5ac8f5227bc25a3720db56314fe.tar.gz
samba-559113596478a5ac8f5227bc25a3720db56314fe.tar.bz2
samba-559113596478a5ac8f5227bc25a3720db56314fe.zip
s3-dcerpc: use dcerpc_push_dcerpc_auth in add_schannel_auth_footer()
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 847a6ae718..403cc954cf 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2210,12 +2210,12 @@ static NTSTATUS add_ntlmssp_auth_footer(struct rpc_pipe_client *cli,
static NTSTATUS add_schannel_auth_footer(struct rpc_pipe_client *cli,
uint32 ss_padding_len,
- prs_struct *outgoing_pdu)
+ prs_struct *rpc_out)
{
- RPC_HDR_AUTH auth_info;
+ DATA_BLOB auth_info;
struct schannel_state *sas = cli->auth->a_u.schannel_auth;
- char *data_p = prs_data_p(outgoing_pdu) + RPC_HEADER_LEN + RPC_HDR_RESP_LEN;
- size_t data_and_pad_len = prs_offset(outgoing_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN;
+ char *data_p = prs_data_p(rpc_out) + RPC_HEADER_LEN + RPC_HDR_RESP_LEN;
+ size_t data_and_pad_len = prs_offset(rpc_out) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN;
DATA_BLOB blob;
NTSTATUS status;
@@ -2223,18 +2223,6 @@ static NTSTATUS add_schannel_auth_footer(struct rpc_pipe_client *cli,
return NT_STATUS_INVALID_PARAMETER;
}
- /* Init and marshall the auth header. */
- init_rpc_hdr_auth(&auth_info,
- map_pipe_auth_type_to_rpc_auth_type(cli->auth->auth_type),
- cli->auth->auth_level,
- ss_padding_len,
- 1 /* context id. */);
-
- if(!smb_io_rpc_hdr_auth("hdr_auth", &auth_info, outgoing_pdu, 0)) {
- DEBUG(0,("add_schannel_auth_footer: failed to marshall RPC_HDR_AUTH.\n"));
- return NT_STATUS_NO_MEMORY;
- }
-
DEBUG(10,("add_schannel_auth_footer: SCHANNEL seq_num=%d\n",
sas->seq_num));
@@ -2271,7 +2259,18 @@ static NTSTATUS add_schannel_auth_footer(struct rpc_pipe_client *cli,
}
/* Finally marshall the blob. */
- if (!prs_copy_data_in(outgoing_pdu, (const char *)blob.data, blob.length)) {
+ status = dcerpc_push_dcerpc_auth(prs_get_mem_context(rpc_out),
+ map_pipe_auth_type_to_rpc_auth_type(cli->auth->auth_type),
+ cli->auth->auth_level,
+ ss_padding_len,
+ 1 /* context id. */,
+ &blob,
+ &auth_info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (!prs_copy_data_in(rpc_out, (const char *)auth_info.data, auth_info.length)) {
return NT_STATUS_NO_MEMORY;
}