Commit 71a5859d authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement getting the hash for each signer of a signed encoded message.

parent 4e2b3ab9
...@@ -765,9 +765,23 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg) ...@@ -765,9 +765,23 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg)
static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData) DWORD dwIndex, void *pvData, DWORD *pcbData)
{ {
FIXME("(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex, pvData, CSignedEncodeMsg *msg = (CSignedEncodeMsg *)hCryptMsg;
pcbData); BOOL ret = FALSE;
return FALSE;
switch (dwParamType)
{
case CMSG_COMPUTED_HASH_PARAM:
if (dwIndex >= msg->cSigners)
SetLastError(CRYPT_E_INVALID_INDEX);
else
ret = CryptGetHashParam(msg->signers[dwIndex].hash, HP_HASHVAL,
pvData, pcbData, 0);
break;
default:
FIXME("unimplemented for %d\n", dwParamType);
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
}
return ret;
} }
static BOOL CSignedEncodeMsg_UpdateHash(CSignedEncodeMsg *msg, static BOOL CSignedEncodeMsg_UpdateHash(CSignedEncodeMsg *msg,
......
...@@ -1298,7 +1298,6 @@ static void test_signed_msg_encoding(void) ...@@ -1298,7 +1298,6 @@ static void test_signed_msg_encoding(void)
signedEmptyContent, sizeof(signedEmptyContent)); signedEmptyContent, sizeof(signedEmptyContent));
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
todo_wine
check_param("detached signed hash", msg, CMSG_COMPUTED_HASH_PARAM, check_param("detached signed hash", msg, CMSG_COMPUTED_HASH_PARAM,
signedHash, sizeof(signedHash)); signedHash, sizeof(signedHash));
todo_wine todo_wine
...@@ -1309,7 +1308,6 @@ static void test_signed_msg_encoding(void) ...@@ -1309,7 +1308,6 @@ static void test_signed_msg_encoding(void)
detachedSignedContent, sizeof(detachedSignedContent)); detachedSignedContent, sizeof(detachedSignedContent));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = CryptMsgGetParam(msg, CMSG_COMPUTED_HASH_PARAM, 1, NULL, &size); ret = CryptMsgGetParam(msg, CMSG_COMPUTED_HASH_PARAM, 1, NULL, &size);
todo_wine
ok(!ret && GetLastError() == CRYPT_E_INVALID_INDEX, ok(!ret && GetLastError() == CRYPT_E_INVALID_INDEX,
"Expected CRYPT_E_INVALID_INDEX, got %x\n", GetLastError()); "Expected CRYPT_E_INVALID_INDEX, got %x\n", GetLastError());
......
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