Commit 99f6894c authored by Christian Inci's avatar Christian Inci Committed by Alexandre Julliard

crypt32: Fix CertStrToName's CERT_NAME_STR_NO_QUOTING_FLAG usage.

parent 35103290
......@@ -971,7 +971,7 @@ static BOOL CRYPT_EncodeValue(DWORD dwCertEncodingType,
}
static BOOL CRYPT_ValueToRDN(DWORD dwCertEncodingType, PCERT_NAME_INFO info,
PCCRYPT_OID_INFO keyOID, struct X500TokenW *value, LPCWSTR *ppszError)
PCCRYPT_OID_INFO keyOID, struct X500TokenW *value, DWORD dwStrType, LPCWSTR *ppszError)
{
BOOL ret = FALSE;
......@@ -1005,7 +1005,7 @@ static BOOL CRYPT_ValueToRDN(DWORD dwCertEncodingType, PCERT_NAME_INFO info,
types = defaultTypes;
/* Remove surrounding quotes */
if (value->start[0] == '"')
if (value->start[0] == '"' && !(dwStrType & CERT_NAME_STR_NO_QUOTING_FLAG))
{
value->start++;
value->end--;
......@@ -1095,7 +1095,7 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
{
str = token.end;
ret = CRYPT_ValueToRDN(dwCertEncodingType, &info,
keyOID, &token, ppszError);
keyOID, &token, dwStrType, ppszError);
}
}
}
......
......@@ -828,7 +828,7 @@ static void test_CertStrToNameA(void)
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
ret = pCertStrToNameA(X509_ASN_ENCODING, "CN=\"abc\"", CERT_NAME_STR_NO_QUOTING_FLAG, NULL, buf,
&size, NULL);
todo_wine ok(!ret && GetLastError() == ERROR_MORE_DATA,
ok(!ret && GetLastError() == ERROR_MORE_DATA,
"Expected ERROR_MORE_DATA, got %08x\n", GetLastError());
for (i = 0; i < sizeof(namesA) / sizeof(namesA[0]); i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment