winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
910 discussions
Start a n
N
ew thread
Owen Rudge : comctl32: Add basic structure for IImageList interface.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: a4f2ab9d14bb4ed76958a5405aa463c4569fb9e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a4f2ab9d14bb4ed76958a5405…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Nov 12 10:27:40 2009 -0600 comctl32: Add basic structure for IImageList interface. --- dlls/comctl32/Makefile.in | 2 +- dlls/comctl32/imagelist.c | 329 +++++++++++++++++++++++++++++++++++++++++++-- dlls/comctl32/imagelist.h | 32 +++-- 3 files changed, 338 insertions(+), 25 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a4f2ab9d14bb4ed76958a…
1
0
0
0
Huw Davies : msctf: Correctly initialize the description field.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: d775d6e31fa928efa2c9f8d3dca9736e77d243a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d775d6e31fa928efa2c9f8d3d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Nov 12 22:51:10 2009 +0000 msctf: Correctly initialize the description field. Found by Valgrind. --- dlls/msctf/threadmgr.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index 56f1c36..5f3a90a 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -883,6 +883,7 @@ static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface, newkey->guid = *rguid; newkey->prekey = *prekey; newkey->tid = tid; + newkey->description = NULL; if (cchDesc) { newkey->description = HeapAlloc(GetProcessHeap(),0,cchDesc * sizeof(WCHAR));
1
0
0
0
Detlef Riekenberg : ntdll/tests: GetVolumePathnameW is not present before w2k.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: 447e224380410ea008cec0cd25da2d97344afb55 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=447e224380410ea008cec0cd2…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Thu Nov 12 23:42:53 2009 +0100 ntdll/tests: GetVolumePathnameW is not present before w2k. --- dlls/ntdll/tests/file.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index ba6b07e..06e35b4 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -40,6 +40,8 @@ #define IO_COMPLETION_ALL_ACCESS 0x001F0003 #endif +static BOOL (WINAPI * pGetVolumePathNameW)(LPCWSTR, LPWSTR, DWORD); + static NTSTATUS (WINAPI *pRtlFreeUnicodeString)( PUNICODE_STRING ); static VOID (WINAPI *pRtlInitUnicodeString)( PUNICODE_STRING, LPCWSTR ); static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)( LPCWSTR, PUNICODE_STRING, PWSTR*, CURDIR* ); @@ -950,6 +952,12 @@ static void test_file_name_information(void) HANDLE h; UINT len; + /* GetVolumePathName is not present before w2k */ + if (!pGetVolumePathNameW) { + win_skip("GetVolumePathNameW not found\n"); + return; + } + file_name_size = GetSystemDirectoryW( NULL, 0 ); file_name = HeapAlloc( GetProcessHeap(), 0, file_name_size * sizeof(*file_name) ); volume_prefix = HeapAlloc( GetProcessHeap(), 0, file_name_size * sizeof(*volume_prefix) ); @@ -960,7 +968,7 @@ static void test_file_name_information(void) "GetSystemDirectoryW returned %u, expected %u.\n", len, file_name_size - 1); - len = GetVolumePathNameW( file_name, volume_prefix, file_name_size ); + len = pGetVolumePathNameW( file_name, volume_prefix, file_name_size ); ok(len, "GetVolumePathNameW failed.\n"); len = lstrlenW( volume_prefix ); @@ -1018,6 +1026,7 @@ static void test_file_name_information(void) START_TEST(file) { + HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); HMODULE hntdll = GetModuleHandleA("ntdll.dll"); if (!hntdll) { @@ -1025,6 +1034,8 @@ START_TEST(file) return; } + pGetVolumePathNameW = (void *)GetProcAddress(hkernel32, "GetVolumePathNameW"); + pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U");
1
0
0
0
Rico Schüller : user32: Add argument check for PTITLEBARINFO in GetTitleBarInfo().
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: a679b4e3af0538d918968572f5e6f7a6b09e6956 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a679b4e3af0538d918968572f…
Author: Rico Schüller <kgbricola(a)web.de> Date: Thu Nov 12 21:50:01 2009 +0100 user32: Add argument check for PTITLEBARINFO in GetTitleBarInfo(). --- dlls/user32/nonclient.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index ccea517..e38e454 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -1630,6 +1630,11 @@ BOOL WINAPI GetTitleBarInfo(HWND hwnd, PTITLEBARINFO tbi) { TRACE("(%p %p)\n", hwnd, tbi); + if(!tbi) { + SetLastError(ERROR_NOACCESS); + return FALSE; + } + if(tbi->cbSize != sizeof(TITLEBARINFO)) { TRACE("Invalid TITLEBARINFO size: %d\n", tbi->cbSize); SetLastError(ERROR_INVALID_PARAMETER);
1
0
0
0
Juan Lang : crypt32: Fix test failures.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: 9aee8fd556ff8b32fe93970dd856ac780d8df4cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9aee8fd556ff8b32fe93970dd…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Nov 12 12:48:05 2009 -0800 crypt32: Fix test failures. --- dlls/crypt32/tests/chain.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 1da1993..be3a0bd 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -3032,7 +3032,8 @@ static const SimpleChainStatusCheck simpleStatus27[] = { static const CERT_TRUST_STATUS elementStatus27Broken[] = { { CERT_TRUST_NO_ERROR, CERT_TRUST_HAS_NAME_MATCH_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, - CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER }, + CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER | + CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, }; static const SimpleChainStatusCheck simpleStatus27Broken[] = { { sizeof(elementStatus27Broken) / sizeof(elementStatus27Broken[0]), @@ -3405,7 +3406,7 @@ static ChainCheck chainCheckEmbeddedNullBroken = { { { CERT_TRUST_IS_NOT_TIME_NESTED | CERT_TRUST_IS_NOT_VALID_FOR_USAGE | CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT, CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, + { CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, 1, simpleStatus27Broken }, 0 };
1
0
0
0
Juan Lang : crypt32: Accept any matching dNSName in a subject alternate name.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: 21ecc84620aa37fa005048a1b52a0890bb6e7fdc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=21ecc84620aa37fa005048a1b…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Nov 12 12:26:05 2009 -0800 crypt32: Accept any matching dNSName in a subject alternate name. --- dlls/crypt32/chain.c | 11 ++++++++--- dlls/crypt32/tests/chain.c | 7 +------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index 805447d..eb6d757 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -2373,16 +2373,21 @@ static BOOL match_dns_to_subject_alt_name(PCERT_EXTENSION ext, &subjectName, &size)) { DWORD i; - BOOL found = FALSE; - for (i = 0; !found && i < subjectName->cAltEntry; i++) + /* RFC 5280 states that multiple instances of each name type may exist, + * in section 4.2.1.6: + * "Multiple name forms, and multiple instances of each name form, + * MAY be included." + * It doesn't specify the behavior in such cases, but common usage is + * to accept a certificate if any name matches. + */ + for (i = 0; !matches && i < subjectName->cAltEntry; i++) { if (subjectName->rgAltEntry[i].dwAltNameChoice == CERT_ALT_NAME_DNS_NAME) { TRACE_(chain)("dNSName: %s\n", debugstr_w( subjectName->rgAltEntry[i].u.pwszDNSName)); - found = TRUE; if (!strcmpiW(server_name, subjectName->rgAltEntry[i].u.pwszDNSName)) matches = TRUE; diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 323f062..1da1993 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -3688,11 +3688,6 @@ static const ChainPolicyCheck stanfordPolicyCheckWithMatchingName = { { 0, 0, -1, -1, NULL}, NULL, 0 }; -static const ChainPolicyCheck stanfordPolicyCheckWithMatchingNameTodo = { - { sizeof(stanfordChain) / sizeof(stanfordChain[0]), stanfordChain }, - { 0, 0, -1, -1, NULL}, NULL, TODO_ERROR -}; - static const ChainPolicyCheck stanfordPolicyCheckWithoutMatchingName = { { sizeof(stanfordChain) / sizeof(stanfordChain[0]), stanfordChain }, { 0, CERT_E_CN_NO_MATCH, 0, 0, NULL}, NULL, 0 @@ -4022,7 +4017,7 @@ static void check_ssl_policy(void) /* With "
www.cs.stanford.edu
": match */ sslPolicyPara.pwszServerName = www_dot_cs_dot_stanford_dot_edu; checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, - &stanfordPolicyCheckWithMatchingNameTodo, 0, &oct2009, &policyPara); + &stanfordPolicyCheckWithMatchingName, 0, &oct2009, &policyPara); /* With "
a.cs.stanford.edu
": no match */ sslPolicyPara.pwszServerName = a_dot_cs_dot_stanford_dot_edu; checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL,
1
0
0
0
Juan Lang : crypt32: Add tests for cs.stanford.edu's chain.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: 95a14deff997c7b3b19bb71ebbb69a187dc8c4fd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=95a14deff997c7b3b19bb71eb…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Nov 12 10:47:04 2009 -0800 crypt32: Add tests for
cs.stanford.edu
's chain. --- dlls/crypt32/tests/chain.c | 312 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 312 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=95a14deff997c7b3b19bb…
1
0
0
0
Juan Lang : crypt32: Use broken() to mark an expected result from a broken version of crypt32.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: d311cc9bdb71b21d339336668b11825fd6723ac0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d311cc9bdb71b21d339336668…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Nov 12 10:35:12 2009 -0800 crypt32: Use broken() to mark an expected result from a broken version of crypt32. --- dlls/crypt32/tests/chain.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 57fe2b0..b9ffec9 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -3230,6 +3230,12 @@ static void testGetCertChain(void) chainCheckEmbeddedNull.todo, 0); if (chain) { + ok(chain->TrustStatus.dwErrorStatus == + chainCheckEmbeddedNull.status.status.dwErrorStatus || + broken(chain->TrustStatus.dwErrorStatus == + chainCheckEmbeddedNullBroken.status.status.dwErrorStatus), + "unexpected chain error status %08x\n", + chain->TrustStatus.dwErrorStatus); if (chainCheckEmbeddedNull.status.status.dwErrorStatus == chain->TrustStatus.dwErrorStatus) checkChainStatus(chain, &chainCheckEmbeddedNull.status,
1
0
0
0
Juan Lang : crypt32: Implement matching a certificate with a wildcard in its name.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: b91d0c8bde9e27ea9c647c6ba9913487d60b3d2e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b91d0c8bde9e27ea9c647c6ba…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Nov 11 17:45:49 2009 -0800 crypt32: Implement matching a certificate with a wildcard in its name. --- dlls/crypt32/chain.c | 138 +++++++++++++++++++++++++++++++++++++++++--- dlls/crypt32/tests/chain.c | 2 +- 2 files changed, 131 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index 54bff75..805447d 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -2418,6 +2418,134 @@ static BOOL find_matching_domain_component(CERT_NAME_INFO *name, return matches; } +static BOOL match_domain_component(LPCWSTR allowed_component, DWORD allowed_len, + LPCWSTR server_component, DWORD server_len, BOOL allow_wildcards, + BOOL *see_wildcard) +{ + LPCWSTR allowed_ptr, server_ptr; + BOOL matches = TRUE; + + *see_wildcard = FALSE; + if (server_len < allowed_len) + { + WARN_(chain)("domain component %s too short for %s\n", + debugstr_wn(server_component, server_len), + debugstr_wn(allowed_component, allowed_len)); + /* A domain component can't contain a wildcard character, so a domain + * component shorter than the allowed string can't produce a match. + */ + return FALSE; + } + for (allowed_ptr = allowed_component, server_ptr = server_component; + matches && allowed_ptr - allowed_component < allowed_len; + allowed_ptr++, server_ptr++) + { + if (*allowed_ptr == '*') + { + if (allowed_ptr - allowed_component < allowed_len - 1) + { + WARN_(chain)("non-wildcard characters after wildcard not supported\n"); + matches = FALSE; + } + else if (!allow_wildcards) + { + WARN_(chain)("wildcard after non-wildcard component\n"); + matches = FALSE; + } + else + { + /* the preceding characters must have matched, so the rest of + * the component also matches. + */ + *see_wildcard = TRUE; + break; + } + } + matches = tolowerW(*allowed_ptr) == tolowerW(*server_ptr); + } + if (matches && server_ptr - server_component < server_len) + { + /* If there are unmatched characters in the server domain component, + * the server domain only matches if the allowed string ended in a '*'. + */ + matches = *allowed_ptr == '*'; + } + return matches; +} + +static BOOL match_common_name(LPCWSTR server_name, PCERT_RDN_ATTR nameAttr) +{ + LPCWSTR allowed = (LPCWSTR)nameAttr->Value.pbData; + LPCWSTR allowed_component = allowed; + DWORD allowed_len = nameAttr->Value.cbData / sizeof(WCHAR); + LPCWSTR server_component = server_name; + DWORD server_len = strlenW(server_name); + BOOL matches = TRUE, allow_wildcards = TRUE; + + TRACE_(chain)("CN = %s\n", debugstr_wn(allowed_component, allowed_len)); + + /* From RFC 2818 (HTTP over TLS), section 3.1: + * "Names may contain the wildcard character * which is considered to match + * any single domain name component or component fragment. E.g., + * *.a.com matches
foo.a.com
but not
bar.foo.a.com
.
f*.com
matches
foo.com
+ * but not
bar.com
." + * + * And from RFC 2595 (Using TLS with IMAP, POP3 and ACAP), section 2.4: + * "A "*" wildcard character MAY be used as the left-most name component in + * the certificate. For example, *.example.com would match
a.example.com
, + *
foo.example.com
, etc. but would not match
example.com
." + * + * There are other protocols which use TLS, and none of them is + * authoritative. This accepts certificates in common usage, e.g. + * *.domain.com matches
www.domain.com
but not
domain.com
, and + *
www*.domain.com
matches
www1.domain.com
but not
mail.domain.com
. + */ + do { + LPCWSTR allowed_dot, server_dot; + + allowed_dot = memchrW(allowed_component, '.', + allowed_len - (allowed_component - allowed)); + server_dot = memchrW(server_component, '.', + server_len - (server_component - server_name)); + /* The number of components must match */ + if ((!allowed_dot && server_dot) || (allowed_dot && !server_dot)) + { + if (!allowed_dot) + WARN_(chain)("%s: too many components for CN=%s\n", + debugstr_w(server_name), debugstr_wn(allowed, allowed_len)); + else + WARN_(chain)("%s: not enough components for CN=%s\n", + debugstr_w(server_name), debugstr_wn(allowed, allowed_len)); + matches = FALSE; + } + else + { + LPCWSTR allowed_end, server_end; + BOOL has_wildcard; + + allowed_end = allowed_dot ? allowed_dot : allowed + allowed_len; + server_end = server_dot ? server_dot : server_name + server_len; + matches = match_domain_component(allowed_component, + allowed_end - allowed_component, server_component, + server_end - server_component, allow_wildcards, &has_wildcard); + /* Once a non-wildcard component is seen, no wildcard components + * may follow + */ + if (!has_wildcard) + allow_wildcards = FALSE; + if (matches) + { + allowed_component = allowed_dot ? allowed_dot + 1 : allowed_end; + server_component = server_dot ? server_dot + 1 : server_end; + } + } + } while (matches && allowed_component && + allowed_component - allowed < allowed_len && + server_component && server_component - server_name < server_len); + TRACE_(chain)("returning %d\n", matches); + return matches; +} + static BOOL match_dns_to_subject_dn(PCCERT_CONTEXT cert, LPCWSTR server_name) { BOOL matches = FALSE; @@ -2466,16 +2594,10 @@ static BOOL match_dns_to_subject_dn(PCCERT_CONTEXT cert, LPCWSTR server_name) PCERT_RDN_ATTR attr; /* If the certificate isn't using a DN attribute in the name, make - * make sure the common name matches. Again, use memicmpW rather - * than strcmpiW in order to avoid being fooled by an embedded NULL. + * make sure the common name matches. */ if ((attr = CertFindRDNAttr(szOID_COMMON_NAME, name))) - { - TRACE_(chain)("CN = %s\n", debugstr_w( - (LPWSTR)attr->Value.pbData)); - matches = !memicmpW(server_name, (LPWSTR)attr->Value.pbData, - attr->Value.cbData / sizeof(WCHAR)); - } + matches = match_common_name(server_name, attr); } LocalFree(name); } diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 8092c8c..57fe2b0 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -3392,7 +3392,7 @@ static const ChainPolicyCheck iTunesPolicyCheckWithoutMatchingName = { static const ChainPolicyCheck opensslPolicyCheckWithMatchingName = { { sizeof(opensslChain) / sizeof(opensslChain[0]), opensslChain }, - { 0, 0, -1, -1, NULL}, NULL, TODO_ERROR + { 0, 0, -1, -1, NULL}, NULL, 0 }; static const ChainPolicyCheck opensslPolicyCheckWithoutMatchingName = {
1
0
0
0
Juan Lang : crypt32: Test matching a certificate with a wildcard in its name.
by Alexandre Julliard
13 Nov '09
13 Nov '09
Module: wine Branch: master Commit: e7406726477e0dc1403554a03a40e7763e686a82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7406726477e0dc1403554a03…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Nov 11 16:28:23 2009 -0800 crypt32: Test matching a certificate with a wildcard in its name. --- dlls/crypt32/tests/chain.c | 49 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 43 insertions(+), 6 deletions(-) diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 0f04604..8092c8c 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -3371,12 +3371,12 @@ static const ChainPolicyCheck sslPolicyCheck[] = { { 0, CERT_E_UNTRUSTEDROOT, 0, 0, NULL }, NULL, 0 }, }; -static const ChainPolicyCheck sslPolicyCheckWithMatchingNameExpired = { +static const ChainPolicyCheck googlePolicyCheckWithMatchingNameExpired = { { sizeof(googleChain) / sizeof(googleChain[0]), googleChain }, { 0, CERT_E_EXPIRED, 0, 0, NULL}, NULL, 0 }; -static const ChainPolicyCheck sslPolicyCheckWithMatchingName = { +static const ChainPolicyCheck googlePolicyCheckWithMatchingName = { { sizeof(googleChain) / sizeof(googleChain[0]), googleChain }, { 0, 0, -1, -1, NULL}, NULL, 0 }; @@ -3385,11 +3385,22 @@ static const ChainPolicyCheck sslPolicyCheckWithMatchingName = { static const CERT_CHAIN_POLICY_STATUS noMatchingNameBrokenStatus = { 0, CERT_E_ROLE, 0, 0, NULL }; -static const ChainPolicyCheck sslPolicyCheckWithoutMatchingName = { +static const ChainPolicyCheck iTunesPolicyCheckWithoutMatchingName = { { sizeof(iTunesChain) / sizeof(iTunesChain[0]), iTunesChain }, { 0, CERT_E_CN_NO_MATCH, 0, 0, NULL}, &noMatchingNameBrokenStatus, 0 }; +static const ChainPolicyCheck opensslPolicyCheckWithMatchingName = { + { sizeof(opensslChain) / sizeof(opensslChain[0]), opensslChain }, + { 0, 0, -1, -1, NULL}, NULL, TODO_ERROR +}; + +static const ChainPolicyCheck opensslPolicyCheckWithoutMatchingName = { + { sizeof(opensslChain) / sizeof(opensslChain[0]), opensslChain }, + { 0, CERT_E_CN_NO_MATCH, 0, 0, NULL}, NULL, 0 +}; + + static const ChainPolicyCheck authenticodePolicyCheck[] = { { { sizeof(chain0) / sizeof(chain0[0]), chain0 }, { 0, CERT_E_UNTRUSTEDROOT, 0, 1, NULL }, NULL, 0 }, @@ -3595,6 +3606,13 @@ static void check_ssl_policy(void) WCHAR winehq[] = { 'w','i','n','e','h','q','.','o','r','g',0 }; WCHAR google_dot_com[] = { 'w','w','w','.','g','o','o','g','l','e','.', 'c','o','m',0 }; + WCHAR a_dot_openssl_dot_org[] = { 'a','.','o','p','e','n','s','s','l','.', + 'o','r','g',0 }; + WCHAR openssl_dot_org[] = { 'o','p','e','n','s','s','l','.','o','r','g',0 }; + WCHAR fopenssl_dot_org[] = { 'f','o','p','e','n','s','s','l','.', + 'o','r','g',0 }; + WCHAR a_dot_b_dot_openssl_dot_org[] = { 'a','.','b','.', + 'o','p','e','n','s','s','l','.','o','r','g',0 }; /* Check ssl policy with no parameter */ for (i = 0; @@ -3663,15 +3681,34 @@ static void check_ssl_policy(void) * extension. */ checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, - &sslPolicyCheckWithoutMatchingName, 0, &oct2007, &policyPara); + &iTunesPolicyCheckWithoutMatchingName, 0, &oct2007, &policyPara); /* And again, but checking the Google chain at a bad date */ sslPolicyPara.pwszServerName = google_dot_com; checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, - &sslPolicyCheckWithMatchingNameExpired, 0, &oct2007, &policyPara); + &googlePolicyCheckWithMatchingNameExpired, 0, &oct2007, &policyPara); /* And again, but checking the Google chain at a good date */ sslPolicyPara.pwszServerName = google_dot_com; checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, - &sslPolicyCheckWithMatchingName, 0, &oct2009, &policyPara); + &googlePolicyCheckWithMatchingName, 0, &oct2009, &policyPara); + /* Check again with the openssl cert, which has a wildcard in its name, + * with various combinations of matching and non-matching names. + * With "
a.openssl.org
": match + */ + sslPolicyPara.pwszServerName = a_dot_openssl_dot_org; + checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, + &opensslPolicyCheckWithMatchingName, 0, &oct2009, &policyPara); + /* With "
openssl.org
": no match */ + sslPolicyPara.pwszServerName = openssl_dot_org; + checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, + &opensslPolicyCheckWithoutMatchingName, 0, &oct2009, &policyPara); + /* With "
fopenssl.org
": no match */ + sslPolicyPara.pwszServerName = fopenssl_dot_org; + checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, + &opensslPolicyCheckWithoutMatchingName, 0, &oct2009, &policyPara); + /* with "
a.b.openssl.org
": no match */ + sslPolicyPara.pwszServerName = a_dot_b_dot_openssl_dot_org; + checkChainPolicyStatus(CERT_CHAIN_POLICY_SSL, + &opensslPolicyCheckWithoutMatchingName, 0, &oct2009, &policyPara); } static void testVerifyCertChainPolicy(void)
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
91
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Results per page:
10
25
50
100
200