mirror of
https://github.com/reactos/wine.git
synced 2025-01-21 03:15:18 +00:00
crypt32: Decode names using CRYPT_AsnDecodeArrayNoAlloc.
This commit is contained in:
parent
fd2a4c4330
commit
67ee87664e
@ -2081,9 +2081,29 @@ static BOOL WINAPI CRYPT_AsnDecodeName(DWORD dwCertEncodingType,
|
||||
sizeof(CERT_NAME_INFO),
|
||||
CRYPT_AsnDecodeRdn, sizeof(CERT_RDN), TRUE,
|
||||
offsetof(CERT_RDN, rgRDNAttr) };
|
||||
DWORD bytesNeeded;
|
||||
|
||||
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
|
||||
pDecodePara, pvStructInfo, pcbStructInfo, NULL, NULL);
|
||||
ret = CRYPT_AsnDecodeArrayNoAlloc(&arrayDesc, pbEncoded, cbEncoded,
|
||||
dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL);
|
||||
if (ret)
|
||||
{
|
||||
if (!pvStructInfo)
|
||||
*pcbStructInfo = bytesNeeded;
|
||||
else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
|
||||
pvStructInfo, pcbStructInfo, bytesNeeded)))
|
||||
{
|
||||
CERT_NAME_INFO *info;
|
||||
|
||||
if (dwFlags & CRYPT_DECODE_ALLOC_FLAG)
|
||||
pvStructInfo = *(BYTE **)pvStructInfo;
|
||||
info = pvStructInfo;
|
||||
info->rgRDN =
|
||||
(PCERT_RDN)((BYTE *)pvStructInfo + sizeof(CERT_NAME_INFO));
|
||||
ret = CRYPT_AsnDecodeArrayNoAlloc(&arrayDesc,
|
||||
pbEncoded, cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG,
|
||||
&info->cRDN, pcbStructInfo, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
__EXCEPT_PAGE_FAULT
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user