diff options
| author | Philip Thiem <ptthiem@gmail.com> | 2013-07-20 18:10:50 -0500 |
|---|---|---|
| committer | Philip Thiem <ptthiem@gmail.com> | 2013-07-20 18:10:50 -0500 |
| commit | a6e7ef0ae1e0ea1f147a2196efe7f2b82c301fe2 (patch) | |
| tree | 8f73e0285965d86cbb6b8d8bc599789fd4a924ef /setuptools/ssl_support.py | |
| parent | 37c48a4da11b40a5a8a3c801525b637bb2934df1 (diff) | |
| parent | 70067439d3b2b53cf2112ed0faf52c30b30ef3cd (diff) | |
| download | python-setuptools-git-a6e7ef0ae1e0ea1f147a2196efe7f2b82c301fe2.tar.gz | |
Merge with default
--HG--
extra : rebase_source : 15517dca4272e2b088930cb5599f5822cef13bae
Diffstat (limited to 'setuptools/ssl_support.py')
| -rw-r--r-- | setuptools/ssl_support.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py index 2aec655a..f8a780a9 100644 --- a/setuptools/ssl_support.py +++ b/setuptools/ssl_support.py @@ -88,9 +88,16 @@ except ImportError: class CertificateError(ValueError): pass - def _dnsname_to_pat(dn): + def _dnsname_to_pat(dn, max_wildcards=1): pats = [] for frag in dn.split(r'.'): + if frag.count('*') > max_wildcards: + # Issue #17980: avoid denials of service by refusing more + # than one wildcard per fragment. A survery of established + # policy among SSL implementations showed it to be a + # reasonable choice. + raise CertificateError( + "too many wildcards in certificate DNS name: " + repr(dn)) if frag == '*': # When '*' is a fragment by itself, it matches a non-empty dotless # fragment. |
