Commit 98aeac78 authored by Kai Blin's avatar Kai Blin Committed by Alexandre Julliard

secur32: Fix DecryptMessage for the dummy case.

parent 85655db1
......@@ -1445,6 +1445,8 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext,
static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext,
PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
{
SECURITY_STATUS ret;
ULONG ntlmssp_flags_save;
PNegoHelper helper;
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);
}
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 = {
......
......@@ -819,10 +819,9 @@ static void testSignSeal()
memcpy(data[1].pvBuffer, crypt_message_server, data[1].cbBuffer);
sec_status = pDecryptMessage(client.ctxt, crypt, 0, &qop);
todo_wine {
ok(sec_status == SEC_E_OK, "DecryptMessage returned %s, not SEC_E_OK.\n",
getSecError(sec_status));
}
ok(!memcmp(crypt->pBuffers[1].pvBuffer, message_binary,
crypt->pBuffers[1].cbBuffer),
"Failed to decrypt message correctly.\n");
......
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