Commit 1c894ec9 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

secur32: Simplify input buffer handling for schan_recv() call.

parent fee52bd4
......@@ -1409,6 +1409,7 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
SIZE_T received = 0;
int idx;
unsigned char *buf_ptr;
SecBufferDesc input_desc = { 0 };
TRACE("context_handle %p, message %p, message_seq_no %ld, quality %p\n",
context_handle, message, message_seq_no, quality);
......@@ -1446,8 +1447,11 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
received = data_size;
input_desc.cBuffers = 1;
input_desc.pBuffers = &message->pBuffers[idx];
params.session = ctx->session;
params.input = message;
params.input = &input_desc;
params.input_size = expected_size;
params.buffer = data;
params.length = &received;
......
......@@ -307,7 +307,7 @@ static int recv_message_get_next_buffer(struct schan_buffers *s)
{
if (s->current_buffer_idx != -1)
return -1;
return schan_find_sec_buffer_idx(s->desc, 0, SECBUFFER_DATA);
return s->desc->cBuffers ? 0 : -1;
}
static char *get_buffer(struct schan_buffers *s, SIZE_T *count)
......
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