Commit 795d3e2c authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

secur32: Clear SECBUFFER_ALERT output buffer count in schan_InitializeSecurityContextW.

Since we write no data into this buffer, set the count to 0. Otherwise, some applications assume there has been alert data written into the buffer. Signed-off-by: 's avatarConnor McAdams <cmcadams@codeweavers.com> Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 117f79aa
......@@ -894,6 +894,12 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
pInput->pBuffers[1].cbBuffer = pInput->pBuffers[0].cbBuffer-ctx->transport.in.offset;
}
for (i = 0; i < pOutput->cBuffers; i++)
{
SecBuffer *buffer = &pOutput->pBuffers[i];
if (buffer->BufferType == SECBUFFER_ALERT) buffer->cbBuffer = 0;
}
*pfContextAttr = ISC_RET_REPLAY_DETECT | ISC_RET_SEQUENCE_DETECT | ISC_RET_CONFIDENTIALITY | ISC_RET_STREAM;
if (ctx->req_ctx_attr & ISC_REQ_EXTENDED_ERROR) *pfContextAttr |= ISC_RET_EXTENDED_ERROR;
if (ctx->req_ctx_attr & ISC_REQ_DATAGRAM) *pfContextAttr |= ISC_RET_DATAGRAM;
......
......@@ -700,7 +700,7 @@ static void test_context_output_buffer_size(DWORD protocol, DWORD flags, ULONG c
status = InitializeSecurityContextA(&cred_handle, NULL, (SEC_CHAR *)"localhost", ctxt_flags_req,
0, 0, &in_buffers, 0, &context, &out_buffers, &attrs, NULL);
ok(status == SEC_I_CONTINUE_NEEDED, "%d: Expected SEC_I_CONTINUE_NEEDED, got %08x\n", i, status);
if (i) todo_wine ok(!buffer->cbBuffer, "Expected SECBUFFER_ALERT buffer to be empty\n");
if (i) ok(!buffer->cbBuffer, "Expected SECBUFFER_ALERT buffer to be empty\n");
DeleteSecurityContext(&context);
}
......@@ -1661,7 +1661,7 @@ static void test_dtls(void)
ok( !exp.LowPart, "got %08x\n", exp.LowPart );
ok( !exp.HighPart, "got %08x\n", exp.HighPart );
ok( buffers[1].pBuffers[1].BufferType == SECBUFFER_ALERT, "Expected buffertype SECBUFFER_ALERT, got %#x\n", buffers[1].pBuffers[1].BufferType);
todo_wine ok( !buffers[1].pBuffers[1].cbBuffer, "Expected SECBUFFER_ALERT buffer to be empty, got %#x\n", buffers[1].pBuffers[1].cbBuffer);
ok( !buffers[1].pBuffers[1].cbBuffer, "Expected SECBUFFER_ALERT buffer to be empty, got %#x\n", buffers[1].pBuffers[1].cbBuffer);
prev_buf_len = buffers[1].pBuffers[0].cbBuffer;
/*
......
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