crypt32: Check registered CryptFormatObject functions before using default hex format.

This commit is contained in:
Juan Lang 2008-11-20 09:32:57 -08:00 committed by Alexandre Julliard
parent 2ca48d072e
commit 57fde4e8a2
1 changed files with 3 additions and 2 deletions

View File

@ -2337,8 +2337,6 @@ static CryptFormatObjectFunc CRYPT_GetBuiltinFormatFunction(DWORD encodingType,
format = CRYPT_FormatNetscapeCertType;
else if (!strcmp(lpszStructType, SPC_FINANCIAL_CRITERIA_OBJID))
format = CRYPT_FormatSpcFinancialCriteria;
if (!format && !(formatStrType & CRYPT_FORMAT_STR_NO_HEX))
format = CRYPT_FormatHexString;
return format;
}
@ -2364,6 +2362,9 @@ BOOL WINAPI CryptFormatObject(DWORD dwCertEncodingType, DWORD dwFormatType,
CryptGetOIDFunctionAddress(set, dwCertEncodingType, lpszStructType, 0,
(void **)&format, &hFunc);
}
if (!format && (dwCertEncodingType & CERT_ENCODING_TYPE_MASK) ==
X509_ASN_ENCODING && !(dwFormatStrType & CRYPT_FORMAT_STR_NO_HEX))
format = CRYPT_FormatHexString;
if (format)
ret = format(dwCertEncodingType, dwFormatType, dwFormatStrType,
pFormatStruct, lpszStructType, pbEncoded, cbEncoded, pbFormat,