From b2ab45b78b695b3e3edd36ed39c1e373ccd80c93 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Fri, 20 Nov 2009 15:37:46 -0800 Subject: [PATCH] crypt32: Only match RDN attributes whose lengths are identical. --- dlls/crypt32/cert.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index f91adc1e02b..a24757019cb 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -1853,7 +1853,10 @@ static BOOL find_matching_rdn_attr(DWORD dwFlags, const CERT_NAME_INFO *name, (LPCWSTR)name->rgRDN[i].rgRDNAttr[j].Value.pbData; LPCWSTR attrStr = (LPCWSTR)attr->Value.pbData; - if (dwFlags & CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG) + if (attr->Value.cbData != + name->rgRDN[i].rgRDNAttr[j].Value.cbData) + match = FALSE; + else if (dwFlags & CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG) match = !strncmpiW(nameStr, attrStr, attr->Value.cbData / sizeof(WCHAR)); else @@ -1870,7 +1873,10 @@ static BOOL find_matching_rdn_attr(DWORD dwFlags, const CERT_NAME_INFO *name, (LPCSTR)name->rgRDN[i].rgRDNAttr[j].Value.pbData; LPCSTR attrStr = (LPCSTR)attr->Value.pbData; - if (dwFlags & CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG) + if (attr->Value.cbData != + name->rgRDN[i].rgRDNAttr[j].Value.cbData) + match = FALSE; + else if (dwFlags & CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG) match = !strncasecmp(nameStr, attrStr, attr->Value.cbData); else -- 2.11.4.GIT