secur32: Fill a SECBUFFER_MISSING buffer if the message is not complete.

This commit is contained in:
Mikko Rasa 2010-09-15 20:30:10 +03:00 committed by Alexandre Julliard
parent b335e94788
commit 506af9205d
1 changed files with 9 additions and 0 deletions

View File

@ -1244,6 +1244,15 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
if(buffer->cbBuffer < expected_size)
{
TRACE("Expected %u bytes, but buffer only contains %u bytes\n", expected_size, buffer->cbBuffer);
buffer->BufferType = SECBUFFER_MISSING;
buffer->cbBuffer = expected_size - buffer->cbBuffer;
/* This is a bit weird, but windows does it too */
idx = schan_find_sec_buffer_idx(message, 0, SECBUFFER_EMPTY);
buffer = &message->pBuffers[idx];
buffer->BufferType = SECBUFFER_MISSING;
buffer->cbBuffer = expected_size - buffer->cbBuffer;
TRACE("Returning SEC_E_INCOMPLETE_MESSAGE\n");
return SEC_E_INCOMPLETE_MESSAGE;
}