Commit 25e8f278 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Disallow embedded NULLs in alternate names.

parent ddf78bdb
......@@ -2990,6 +2990,12 @@ static BOOL CRYPT_AsnDecodeAltNameEntry(const BYTE *pbEncoded, DWORD cbEncoded,
case 1: /* rfc822Name */
case 2: /* dNSName */
case 6: /* uniformResourceIdentifier */
if (memchr(pbEncoded + 1 + lenBytes, 0, dataLen))
{
SetLastError(CRYPT_E_ASN1_RULE);
ret = FALSE;
}
else
bytesNeeded += (dataLen + 1) * sizeof(WCHAR);
break;
case 4: /* directoryName */
......
......@@ -1691,7 +1691,6 @@ static void test_decodeAltName(DWORD dwEncoding)
/* Fails on WinXP with CRYPT_E_ASN1_RULE. I'm not too concerned about the
* particular failure, just that it doesn't decode.
*/
todo_wine
ok(!ret, "expected failure\n");
/* An embedded bell character is allowed, however. */
ret = pCryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME,
......@@ -1715,7 +1714,6 @@ static void test_decodeAltName(DWORD dwEncoding)
/* Again, fails on WinXP with CRYPT_E_ASN1_RULE. I'm not too concerned
* about the particular failure, just that it doesn't decode.
*/
todo_wine
ok(!ret, "expected failure\n");
}
......
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