Commit 0a62c7bd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

secur32: Update output buffer offset on return from schan_send() call.

parent 1c894ec9
...@@ -1299,7 +1299,8 @@ static SECURITY_STATUS SEC_ENTRY schan_EncryptMessage(PCtxtHandle context_handle ...@@ -1299,7 +1299,8 @@ static SECURITY_STATUS SEC_ENTRY schan_EncryptMessage(PCtxtHandle context_handle
SIZE_T data_size; SIZE_T data_size;
SIZE_T length; SIZE_T length;
char *data; char *data;
int idx; int idx, output_buffer_idx = -1;
ULONG output_offset = 0;
TRACE("context_handle %p, quality %ld, message %p, message_seq_no %ld\n", TRACE("context_handle %p, quality %ld, message %p, message_seq_no %ld\n",
context_handle, quality, message, message_seq_no); context_handle, quality, message, message_seq_no);
...@@ -1326,8 +1327,13 @@ static SECURITY_STATUS SEC_ENTRY schan_EncryptMessage(PCtxtHandle context_handle ...@@ -1326,8 +1327,13 @@ static SECURITY_STATUS SEC_ENTRY schan_EncryptMessage(PCtxtHandle context_handle
params.output = message; params.output = message;
params.buffer = data; params.buffer = data;
params.length = &length; params.length = &length;
params.output_buffer_idx = &output_buffer_idx;
params.output_offset = &output_offset;
status = GNUTLS_CALL( send, &params ); status = GNUTLS_CALL( send, &params );
if (!status && output_buffer_idx != -1)
message->pBuffers[output_buffer_idx].cbBuffer = output_offset;
TRACE("Sent %Id bytes.\n", length); TRACE("Sent %Id bytes.\n", length);
if (length != data_size) if (length != data_size)
......
...@@ -878,7 +878,8 @@ static NTSTATUS schan_send( void *args ) ...@@ -878,7 +878,8 @@ static NTSTATUS schan_send( void *args )
} }
} }
t->out.desc->pBuffers[t->out.current_buffer_idx].cbBuffer = t->out.offset; *params->output_buffer_idx = t->out.current_buffer_idx;
*params->output_offset = t->out.offset;
return SEC_E_OK; return SEC_E_OK;
} }
......
...@@ -167,6 +167,8 @@ struct send_params ...@@ -167,6 +167,8 @@ struct send_params
SecBufferDesc *output; SecBufferDesc *output;
const void *buffer; const void *buffer;
SIZE_T *length; SIZE_T *length;
int *output_buffer_idx;
ULONG *output_offset;
}; };
struct set_application_protocols_params struct set_application_protocols_params
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment