crypt32: Remove exception handling from internal decoding functions.
This commit is contained in:
parent
6d668d9d38
commit
a7f6a0128c
@ -1187,9 +1187,6 @@ static BOOL WINAPI CRYPT_AsnDecodeNameValue(DWORD dwCertEncodingType,
|
|||||||
PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
|
PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
|
||||||
{
|
{
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
|
|
||||||
__TRY
|
|
||||||
{
|
|
||||||
DWORD dataLen;
|
DWORD dataLen;
|
||||||
CERT_NAME_VALUE *value = (CERT_NAME_VALUE *)pvStructInfo;
|
CERT_NAME_VALUE *value = (CERT_NAME_VALUE *)pvStructInfo;
|
||||||
|
|
||||||
@ -1272,13 +1269,6 @@ static BOOL WINAPI CRYPT_AsnDecodeNameValue(DWORD dwCertEncodingType,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
__EXCEPT_PAGE_FAULT
|
|
||||||
{
|
|
||||||
SetLastError(STATUS_ACCESS_VIOLATION);
|
|
||||||
ret = FALSE;
|
|
||||||
}
|
|
||||||
__ENDTRY
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1287,22 +1277,19 @@ static BOOL WINAPI CRYPT_AsnDecodeRdnAttr(DWORD dwCertEncodingType,
|
|||||||
PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
|
PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
TRACE("%p, %ld, %08lx, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
|
|
||||||
pvStructInfo, *pcbStructInfo);
|
|
||||||
|
|
||||||
__TRY
|
|
||||||
{
|
|
||||||
struct AsnDecodeSequenceItem items[] = {
|
struct AsnDecodeSequenceItem items[] = {
|
||||||
{ ASN_OBJECTIDENTIFIER, offsetof(CERT_RDN_ATTR, pszObjId),
|
{ ASN_OBJECTIDENTIFIER, offsetof(CERT_RDN_ATTR, pszObjId),
|
||||||
CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), FALSE, TRUE,
|
CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), FALSE, TRUE,
|
||||||
offsetof(CERT_RDN_ATTR, pszObjId), 0 },
|
offsetof(CERT_RDN_ATTR, pszObjId), 0 },
|
||||||
{ 0, offsetof(CERT_RDN_ATTR, dwValueType), CRYPT_AsnDecodeNameValue,
|
{ 0, offsetof(CERT_RDN_ATTR, dwValueType),
|
||||||
sizeof(CERT_NAME_VALUE), FALSE, TRUE, offsetof(CERT_RDN_ATTR,
|
CRYPT_AsnDecodeNameValue, sizeof(CERT_NAME_VALUE),
|
||||||
Value.pbData), 0 },
|
FALSE, TRUE, offsetof(CERT_RDN_ATTR, Value.pbData), 0 },
|
||||||
};
|
};
|
||||||
CERT_RDN_ATTR *attr = (CERT_RDN_ATTR *)pvStructInfo;
|
CERT_RDN_ATTR *attr = (CERT_RDN_ATTR *)pvStructInfo;
|
||||||
|
|
||||||
|
TRACE("%p, %ld, %08lx, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
|
||||||
|
pvStructInfo, *pcbStructInfo);
|
||||||
|
|
||||||
if (attr)
|
if (attr)
|
||||||
TRACE("attr->pszObjId is %p\n", attr->pszObjId);
|
TRACE("attr->pszObjId is %p\n", attr->pszObjId);
|
||||||
ret = CRYPT_AsnDecodeSequence(X509_ASN_ENCODING, items,
|
ret = CRYPT_AsnDecodeSequence(X509_ASN_ENCODING, items,
|
||||||
@ -1315,13 +1302,6 @@ static BOOL WINAPI CRYPT_AsnDecodeRdnAttr(DWORD dwCertEncodingType,
|
|||||||
TRACE("attr->dwValueType is %ld\n", attr->dwValueType);
|
TRACE("attr->dwValueType is %ld\n", attr->dwValueType);
|
||||||
}
|
}
|
||||||
TRACE("returning %d (%08lx)\n", ret, GetLastError());
|
TRACE("returning %d (%08lx)\n", ret, GetLastError());
|
||||||
}
|
|
||||||
__EXCEPT_PAGE_FAULT
|
|
||||||
{
|
|
||||||
SetLastError(STATUS_ACCESS_VIOLATION);
|
|
||||||
ret = FALSE;
|
|
||||||
}
|
|
||||||
__ENDTRY
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1330,9 +1310,6 @@ static BOOL WINAPI CRYPT_AsnDecodeRdn(DWORD dwCertEncodingType,
|
|||||||
PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
|
PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
|
||||||
{
|
{
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
|
|
||||||
__TRY
|
|
||||||
{
|
|
||||||
struct AsnArrayDescriptor arrayDesc = { ASN_CONSTRUCTOR | ASN_SETOF,
|
struct AsnArrayDescriptor arrayDesc = { ASN_CONSTRUCTOR | ASN_SETOF,
|
||||||
CRYPT_AsnDecodeRdnAttr, sizeof(CERT_RDN_ATTR), TRUE,
|
CRYPT_AsnDecodeRdnAttr, sizeof(CERT_RDN_ATTR), TRUE,
|
||||||
offsetof(CERT_RDN_ATTR, pszObjId) };
|
offsetof(CERT_RDN_ATTR, pszObjId) };
|
||||||
@ -1340,13 +1317,6 @@ static BOOL WINAPI CRYPT_AsnDecodeRdn(DWORD dwCertEncodingType,
|
|||||||
|
|
||||||
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
|
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
|
||||||
pDecodePara, pvStructInfo, pcbStructInfo, rdn ? rdn->rgRDNAttr : NULL);
|
pDecodePara, pvStructInfo, pcbStructInfo, rdn ? rdn->rgRDNAttr : NULL);
|
||||||
}
|
|
||||||
__EXCEPT_PAGE_FAULT
|
|
||||||
{
|
|
||||||
SetLastError(STATUS_ACCESS_VIOLATION);
|
|
||||||
ret = FALSE;
|
|
||||||
}
|
|
||||||
__ENDTRY
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user