Commit 30bf5d9a authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Fix reading key prov info from serialized data.

parent 11d01847
......@@ -244,12 +244,7 @@ static BOOL WINAPI CertContext_GetProperty(void *context, DWORD dwPropId,
return ret;
}
/* info is assumed to be a CRYPT_KEY_PROV_INFO, followed by its container name,
* provider name, and any provider parameters, in a contiguous buffer, but
* where info's pointers are assumed to be invalid. Upon return, info's
* pointers point to the appropriate memory locations.
*/
static void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info)
void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info)
{
DWORD i, containerLen, provNameLen;
LPBYTE data = (LPBYTE)info + sizeof(CRYPT_KEY_PROV_INFO);
......
......@@ -97,6 +97,14 @@ extern PCWINE_CONTEXT_INTERFACE pCTLInterface;
const void *CRYPT_ReadSerializedElement(const BYTE *pbElement,
DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType);
/* Fixes up the the pointers in info, where info is assumed to be a
* CRYPT_KEY_PROV_INFO, followed by its container name, provider name, and any
* provider parameters, in a contiguous buffer, but where info's pointers are
* assumed to be invalid. Upon return, info's pointers point to the
* appropriate memory locations.
*/
void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info);
DWORD CertStore_GetAccessState(HCERTSTORE hCertStore);
/**
......
......@@ -363,6 +363,16 @@ const void *CRYPT_ReadSerializedElement(const BYTE *pbElement, DWORD cbElement,
ret = contextInterface->setProp(context,
hdr->propID, 0, pbElement);
break;
case CERT_KEY_PROV_INFO_PROP_ID:
{
PCRYPT_KEY_PROV_INFO info =
(PCRYPT_KEY_PROV_INFO)pbElement;
CRYPT_FixKeyProvInfoPointers(info);
ret = contextInterface->setProp(context,
hdr->propID, 0, pbElement);
break;
}
default:
FIXME("prop ID %ld: stub\n", hdr->propID);
}
......
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