Commit 4f30f90c authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement getting version from an encoded signed message.

parent 8c81a386
......@@ -865,6 +865,10 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
ret = CryptGetHashParam(msg->signerHandles[dwIndex].hash,
HP_HASHVAL, pvData, pcbData, 0);
break;
case CMSG_VERSION_PARAM:
ret = CRYPT_CopyParam(pvData, pcbData, (const BYTE *)&msg->info.version,
sizeof(msg->info.version));
break;
default:
FIXME("unimplemented for %d\n", dwParamType);
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
......
......@@ -1355,14 +1355,11 @@ static void test_signed_msg_get_param(void)
/* For "signed" messages, so is the version. */
size = 0;
ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, NULL, &size);
todo_wine
ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError());
size = sizeof(value);
ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, (LPBYTE)&value, &size);
todo_wine {
ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError());
ok(value == CMSG_SIGNED_DATA_V1, "Expected version 1, got %d\n", value);
}
/* But for this message, with no signers, the hash and signer aren't
* available.
*/
......
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