Commit d6c9c7a0 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Honor SECURITY_FLAG_IGNORE_CERT_CN_INVALID.

parent e922faec
......@@ -23,6 +23,7 @@
#define CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
#define CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
#include "wincrypt.h"
#include "wininet.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
......@@ -3331,7 +3332,8 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID,
if (sslPara && sslPara->u.cbSize >= sizeof(HTTPSPolicyCallbackData))
{
if (sslPara->dwAuthType == AUTHTYPE_SERVER &&
sslPara->pwszServerName)
sslPara->pwszServerName &&
!(sslPara->fdwChecks & SECURITY_FLAG_IGNORE_CERT_CN_INVALID))
{
PCCERT_CONTEXT cert;
PCERT_EXTENSION altNameExt;
......
......@@ -3822,11 +3822,6 @@ static const ChainPolicyCheck winehqPolicyCheckWithMatchingName = {
{ 0, 0, -1, -1, NULL}, NULL, 0
};
static const ChainPolicyCheck winehqPolicyCheckWithIgnoredNonMatchingName = {
{ sizeof(chain29) / sizeof(chain29[0]), chain29 },
{ 0, 0, -1, -1, NULL}, NULL, TODO_ERROR
};
static const ChainPolicyCheck winehqPolicyCheckWithoutMatchingName = {
{ sizeof(chain29) / sizeof(chain29[0]), chain29 },
{ 0, CERT_E_CN_NO_MATCH, 0, 0, NULL}, NULL, 0
......@@ -4207,7 +4202,7 @@ static void check_ssl_policy(void)
/* When specifying to ignore name mismatch: match */
sslPolicyPara.fdwChecks |= SECURITY_FLAG_IGNORE_CERT_CN_INVALID;
checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, engine,
&winehqPolicyCheckWithIgnoredNonMatchingName, 0, &oct2007, &policyPara);
&winehqPolicyCheckWithMatchingName, 0, &oct2007, &policyPara);
CertFreeCertificateChainEngine(engine);
CertCloseStore(testRoot, 0);
}
......
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