From 4f30f90c39bc03b72e98ae00d5ff2767b5b6ee20 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 23 Jul 2007 18:22:30 -0700 Subject: [PATCH] crypt32: Implement getting version from an encoded signed message. --- dlls/crypt32/msg.c | 4 ++++ dlls/crypt32/tests/msg.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 7ba78a91c5a..8a1fea0e241 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -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); diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 6ee0de613ce..056833118b9 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -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. */ -- 2.11.4.GIT