mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
crypt32: Implement CertGetNameStringW for CERT_NAME_DNS_TYPE.
This commit is contained in:
parent
6dfe7bc3a6
commit
2fe736d928
@ -1130,6 +1130,30 @@ DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
|
||||
cchNameString);
|
||||
break;
|
||||
}
|
||||
case CERT_NAME_DNS_TYPE:
|
||||
{
|
||||
CERT_ALT_NAME_INFO *info;
|
||||
PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext,
|
||||
altNameOID, CERT_ALT_NAME_DNS_NAME, &info);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
if (!pszNameString)
|
||||
ret = strlenW(entry->pwszDNSName) + 1;
|
||||
else
|
||||
{
|
||||
ret = min(strlenW(entry->pwszDNSName), cchNameString - 1);
|
||||
memcpy(pszNameString, entry->pwszDNSName, ret * sizeof(WCHAR));
|
||||
pszNameString[ret++] = 0;
|
||||
}
|
||||
}
|
||||
if (info)
|
||||
LocalFree(info);
|
||||
if (!ret)
|
||||
ret = cert_get_name_from_rdn_attr(pCertContext->dwCertEncodingType,
|
||||
name, szOID_COMMON_NAME, pszNameString, cchNameString);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
FIXME("unimplemented for type %d\n", dwType);
|
||||
ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user