20#define NONAMELESSUNION
28#include "wine/unicode.h"
38 TRACE(
"(%d, %p, %p, %d)\n", dwValueType,
pValue, psz, csz);
86 FIXME(
"string type %d unimplemented\n", dwValueType);
105 TRACE(
"(%d, %p, %p, %d)\n", dwValueType,
pValue, psz, csz);
140 for (
i = 0;
i < strLen &&
ptr - psz < csz;
ptr++,
i++)
146 FIXME(
"string type %d unimplemented\n", dwValueType);
185 TRACE(
"(%d, %p, %p, %d)\n", dwValueType,
pValue, psz, csz);
224 if (
pValue->pbData[
i] ==
'"' &&
ptr - psz < csz - 1)
227 if (needsQuotes &&
ptr - psz < csz)
265 if (*
src ==
'"' &&
dst - psz < csz - 1)
268 if (needsQuotes &&
dst - psz < csz)
274 FIXME(
"string type %d unimplemented\n", dwValueType);
294 TRACE(
"(%d, %p, %p, %d)\n", dwValueType,
pValue, psz, csz);
333 if (
pValue->pbData[
i] ==
'"' &&
ptr - psz < csz - 1)
336 if (needsQuotes &&
ptr - psz < csz)
348 for (
i = 0;
i < strLen;
i++)
365 for (
i = 0;
i < strLen &&
ptr - psz < csz;
ptr++,
i++)
371 if (needsQuotes &&
ptr - psz < csz)
377 FIXME(
"string type %d unimplemented\n", dwValueType);
405 memcpy(psz, prefix, chars);
406 *(psz + chars) =
'=';
419 static const char commaSep[] =
", ";
420 static const char semiSep[] =
"; ";
421 static const char crlfSep[] =
"\r\n";
422 static const char plusSep[] =
" + ";
423 static const char spaceSep[] =
" ";
455 rdnSepLen =
strlen(rdnSep);
456 for (
i = 0; (!psz ||
ret < csz) && i < info->cRDN;
i++)
458 for (
j = 0; (!psz ||
ret < csz) && j < rdn->cRDNAttr;
j++)
476 prefixBuf,
sizeof(prefixBuf),
NULL,
NULL);
486 psz ? psz +
ret :
NULL, psz ? csz -
ret - 1 : 0);
492 psz ? csz -
ret : 0);
495 if (j < rdn->cRDNAttr - 1)
497 if (psz &&
ret < csz - rdnSepLen - 1)
502 if (i < info->cRDN - 1)
504 if (psz &&
ret < csz - sepLen - 1)
541 for (
i = 0;
i < chars;
i++)
542 *(psz +
i) = prefix[
i];
543 *(psz + chars) =
'=';
566 *(psz + chars) =
'=';
582 static const WCHAR semiSep[] = {
';',
' ',0 };
583 static const WCHAR crlfSep[] = {
'\r',
'\n',0 };
584 static const WCHAR plusSep[] = {
' ',
'+',
' ',0 };
585 static const WCHAR spaceSep[] = {
' ',0 };
616 for (
i = 0; (!psz ||
ret < csz) && i < info->cRDN;
i++)
618 for (
j = 0; (!psz ||
ret < csz) && j < rdn->cRDNAttr;
j++)
642 for (
k = 0;
k < indentLevel;
k++)
658 psz ? psz +
ret :
NULL, psz ? csz -
ret - 1 : 0);
665 psz ? psz +
ret :
NULL, psz ? csz -
ret - 1 : 0);
671 psz ? csz -
ret : 0);
674 if (j < rdn->cRDNAttr - 1)
676 if (psz &&
ret < csz - rdnSepLen - 1)
681 if (i < info->cRDN - 1)
683 if (psz &&
ret < csz - sepLen - 1)
745 for (
i = 0;
i < errorStr - x500;
i++)
859 while (*
str && *
str !=
'"')
863 if (*(
str + 1) !=
'"')
883 map[*separators++] = 1;
929 if (
value->start[
i] ==
'"')
990 if (
info->rgRDN[
info->cRDN].rgRDNAttr)
996 info->rgRDN[
info->cRDN].cRDNAttr = 1;
997 info->rgRDN[
info->cRDN].rgRDNAttr[0].pszObjId =
999 info->rgRDN[
info->cRDN].rgRDNAttr[0].dwValueType =
1004 types = defaultTypes;
1074 static const WCHAR semiSep[] = {
';',0 };
1075 static const WCHAR crlfSep[] = {
'\r',
'\n',0 };
1076 static const WCHAR allSepsWithoutPlus[] = {
',',
';',
'\r',
'\n',0 };
1077 static const WCHAR allSeps[] = {
'+',
',',
';',
'\r',
'\n',0 };
1089 sep = allSepsWithoutPlus;
1098 if (
str && sep_used && *
str == sep_used)
str++;
1115 for (
i = 0;
i <
info.cRDN;
i++)
1119 for (
j = 0;
j <
info.rgRDN[
i].cRDNAttr;
j++)
1133 pvTypePara, pszNameString, cchNameString);
1148 pszNameString, cchNameString,
NULL,
NULL);
1149 if (nameLen <= cchNameString)
1153 pszNameString[cchNameString - 1] =
'\0';
1154 ret = cchNameString;
1160 *pszNameString =
'\0';
1184 cert->pCertInfo->cExtension,
cert->pCertInfo->rgExtension);
1196 for (
i = 0; !
entry &&
i < (*info)->cAltEntry;
i++)
1197 if ((*info)->rgAltEntry[
i].dwAltNameChoice == entryType)
1198 entry = &(*info)->rgAltEntry[
i];
1222 pszNameString, cchNameString);
1236 dwFlags, pvTypePara, pszNameString, cchNameString);
1264 else if (cchNameString)
1269 pszNameString[
ret++] = 0;
1285 type, pszNameString, cchNameString);
1294 &
entry->u.DirectoryName,
type, pszNameString, cchNameString);
1302 name, pvTypePara, pszNameString, cchNameString);
1311 &
entry->u.DirectoryName, 0, pszNameString, cchNameString);
1330 for (
i = 0; !nameAttr &&
i <
ARRAY_SIZE(simpleAttributeOIDs);
i++)
1334 &nameAttr->
Value, pszNameString, cchNameString);
1351 else if (cchNameString)
1357 pszNameString[
ret++] = 0;
1388 else if (cchNameString)
1392 pszNameString[
ret++] = 0;
1412 else if (cchNameString)
1416 pszNameString[
ret++] = 0;
1424 FIXME(
"unimplemented for type %d\n", dwType);
1432 else if (cchNameString)
1434 pszNameString[0] = 0;
ACPI_SIZE strlen(const char *String)
static unsigned char bytes[4]
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
PCERT_EXTENSION WINAPI CertFindExtension(LPCSTR pszObjId, DWORD cExtensions, CERT_EXTENSION rgExtensions[])
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
PCERT_RDN_ATTR WINAPI CertFindRDNAttr(LPCSTR pszObjId, PCERT_NAME_INFO pName)
BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, void *pvEncoded, DWORD *pcbEncoded)
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize)
VOID WINAPI CryptMemFree(LPVOID pv)
static struct list oidInfo
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
static DWORD CRYPT_AddPrefixA(LPCSTR prefix, LPSTR psz, DWORD csz)
BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500, DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded, LPCSTR *ppszError)
static void CRYPT_FreeKeynameKeeper(struct KeynameKeeper *keeper)
static BOOL is_quotable_char(char c)
static PCERT_ALT_NAME_ENTRY cert_find_alt_name_entry(PCCERT_CONTEXT cert, LPCSTR altNameOID, DWORD entryType, PCERT_ALT_NAME_INFO *info)
DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPSTR psz, DWORD csz)
DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indentLevel, const CERT_NAME_BLOB *pName, DWORD dwStrType, LPWSTR psz, DWORD csz)
static BOOL CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators, WCHAR *separator_used, struct X500TokenW *token, LPCWSTR *ppszError)
static DWORD CRYPT_AddPrefixAToW(LPCSTR prefix, LPWSTR psz, DWORD csz)
static DWORD quote_rdn_value_to_str_a(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPSTR psz, DWORD csz)
DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, DWORD dwStrType, LPSTR psz, DWORD csz)
DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPSTR pszNameString, DWORD cchNameString)
static BOOL CRYPT_EncodeValue(DWORD dwCertEncodingType, const struct X500TokenW *value, PCERT_NAME_BLOB output, const DWORD *types, LPCWSTR *ppszError)
static void CRYPT_InitializeKeynameKeeper(struct KeynameKeeper *keeper)
static void CRYPT_KeynameKeeperFromTokenW(struct KeynameKeeper *keeper, const struct X500TokenW *key)
DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, DWORD dwStrType, LPWSTR psz, DWORD csz)
DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString)
BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500, DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded, LPCWSTR *ppszError)
static const WCHAR indent[]
static BOOL CRYPT_ValueToRDN(DWORD dwCertEncodingType, PCERT_NAME_INFO info, PCCRYPT_OID_INFO keyOID, struct X500TokenW *value, DWORD dwStrType, LPCWSTR *ppszError)
static BOOL CRYPT_GetNextKeyW(LPCWSTR str, struct X500TokenW *token, LPCWSTR *ppszError)
static DWORD quote_rdn_value_to_str_w(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPWSTR psz, DWORD csz)
static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType, const struct X500TokenW *value, PCERT_NAME_BLOB output, DWORD type, LPCWSTR *ppszError)
static DWORD cert_get_name_from_rdn_attr(DWORD encodingType, const CERT_NAME_BLOB *name, LPCSTR oid, LPWSTR pszNameString, DWORD cchNameString)
static DWORD CRYPT_AddPrefixW(LPCWSTR prefix, LPWSTR psz, DWORD csz)
DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPWSTR psz, DWORD csz)
static const WCHAR commaSep[]
#define WideCharToMultiByte
#define MultiByteToWideChar
static const WCHAR *const ext[]
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HLOCAL NTAPI LocalFree(HLOCAL hMem)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
static DWORD DWORD void LPSTR DWORD cch
static LPCSTR DWORD void * pvReserved
static LPCSTR DWORD void BYTE * pbEncoded
static LPCSTR DWORD void BYTE DWORD LPCSTR * ppszError
static LPCSTR DWORD void BYTE DWORD * pcbEncoded
static LPCSTR DWORD dwStrType
PCERT_ALT_NAME_ENTRY rgAltEntry
CERT_RDN_VALUE_BLOB Value
CERT_RDN_VALUE_BLOB Value
CRYPT_DATA_BLOB ExtraInfo
static void reverse(int *pidx, int cch)
DWORD WINAPI GetLastError(void)
#define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG
#define CERT_NAME_STR_NO_QUOTING_FLAG
#define CERT_RDN_UTF8_STRING
#define CERT_RDN_IA5_STRING
#define CERT_RDN_GENERAL_STRING
#define CERT_NAME_SIMPLE_DISPLAY_TYPE
#define CERT_RDN_PRINTABLE_STRING
#define CERT_ALT_NAME_URL
#define CERT_X500_NAME_STR
#define CERT_NAME_EMAIL_TYPE
#define CERT_ALT_NAME_DIRECTORY_NAME
#define CERT_ALT_NAME_RFC822_NAME
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define CERT_RDN_VISIBLE_STRING
#define CERT_NAME_STR_NO_PLUS_FLAG
#define X509_ASN_ENCODING
#define CRYPT_OID_INFO_NAME_KEY
#define CERT_NAME_STR_SEMICOLON_FLAG
#define CRYPT_RDN_ATTR_OID_GROUP_ID
_In_ DWORD dwCertEncodingType
#define CRYPT_DECODE_ALLOC_FLAG
#define CERT_NAME_STR_CRLF_FLAG
#define szOID_ORGANIZATIONAL_UNIT_NAME
#define CERT_FRIENDLY_NAME_PROP_ID
#define CERT_RDN_VIDEOTEX_STRING
#define szOID_RSA_emailAddr
#define CERT_NAME_DNS_TYPE
#define szOID_SUBJECT_ALT_NAME
#define CERT_ALT_NAME_DNS_NAME
#define CERT_NAME_RDN_TYPE
_In_ PCCERT_CONTEXT pCertContext
#define CERT_NAME_ISSUER_FLAG
#define CERT_NAME_STR_COMMA_FLAG
#define CRYPT_ENCODE_ALLOC_FLAG
#define CERT_RDN_ENCODED_BLOB
#define CERT_NAME_ATTR_TYPE
#define CERT_NAME_URL_TYPE
#define CERT_RDN_NUMERIC_STRING
#define CRYPT_OID_INFO_OID_KEY
#define X509_ALTERNATE_NAME
#define szOID_COMMON_NAME
#define CERT_NAME_STR_REVERSE_FLAG
#define CERT_RDN_TELETEX_STRING
#define CERT_RDN_BMP_STRING
#define CERT_OID_NAME_STR
#define CERT_RDN_ANY_TYPE
#define szOID_ISSUER_ALT_NAME
#define CERT_RDN_GRAPHIC_STRING
#define CERT_NAME_FRIENDLY_DISPLAY_TYPE
#define szOID_ORGANIZATION_NAME
#define X509_UNICODE_NAME_VALUE
#define CRYPT_E_INVALID_PRINTABLE_STRING
#define CRYPT_E_INVALID_IA5_STRING
#define CRYPT_E_INVALID_NUMERIC_STRING
#define CRYPT_E_INVALID_X500_STRING
LPSTR WINAPI CharNextA(_In_ LPCSTR)