secur32: Fix DecryptMessage for the dummy case.

This commit is contained in:
Kai Blin 2006-09-07 17:32:40 +02:00 committed by Alexandre Julliard
parent 85655db106
commit 98aeac78fc
2 changed files with 13 additions and 3 deletions

View File

@ -1445,6 +1445,8 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext,
static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext,
PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP) PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
{ {
SECURITY_STATUS ret;
ULONG ntlmssp_flags_save;
PNegoHelper helper; PNegoHelper helper;
TRACE("(%p %p %ld %p)\n", phContext, pMessage, MessageSeqNo, pfQOP); TRACE("(%p %p %ld %p)\n", phContext, pMessage, MessageSeqNo, pfQOP);
@ -1475,7 +1477,16 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext,
pMessage->pBuffers[1].pvBuffer, pMessage->pBuffers[1].cbBuffer); pMessage->pBuffers[1].pvBuffer, pMessage->pBuffers[1].cbBuffer);
} }
return ntlm_VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP); /* Make sure we use a session key for the signature check, EncryptMessage
* always does that, even in the dummy case */
ntlmssp_flags_save = helper->neg_flags;
helper->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
ret = ntlm_VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP);
helper->neg_flags = ntlmssp_flags_save;
return ret;
} }
static SecurityFunctionTableA ntlmTableA = { static SecurityFunctionTableA ntlmTableA = {

View File

@ -819,10 +819,9 @@ static void testSignSeal()
memcpy(data[1].pvBuffer, crypt_message_server, data[1].cbBuffer); memcpy(data[1].pvBuffer, crypt_message_server, data[1].cbBuffer);
sec_status = pDecryptMessage(client.ctxt, crypt, 0, &qop); sec_status = pDecryptMessage(client.ctxt, crypt, 0, &qop);
todo_wine {
ok(sec_status == SEC_E_OK, "DecryptMessage returned %s, not SEC_E_OK.\n", ok(sec_status == SEC_E_OK, "DecryptMessage returned %s, not SEC_E_OK.\n",
getSecError(sec_status)); getSecError(sec_status));
}
ok(!memcmp(crypt->pBuffers[1].pvBuffer, message_binary, ok(!memcmp(crypt->pBuffers[1].pvBuffer, message_binary,
crypt->pBuffers[1].cbBuffer), crypt->pBuffers[1].cbBuffer),
"Failed to decrypt message correctly.\n"); "Failed to decrypt message correctly.\n");