diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index b5d510d8c90..6297e722f0e 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -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); diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 3ef44b4fb90..99c1dfe798b 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -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); /** diff --git a/dlls/crypt32/serialize.c b/dlls/crypt32/serialize.c index b0765a71c98..afcd13f1043 100644 --- a/dlls/crypt32/serialize.c +++ b/dlls/crypt32/serialize.c @@ -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); }