mercurial/sslutil.py
changeset 34775 17919e9006b9
parent 34748 8c1d0fe1f431
child 35369 c8ecd96cc357
equal deleted inserted replaced
34774:fd4caf1b23f6 34775:17919e9006b9
   184     ciphers = ui.config('hostsecurity', '%s:ciphers' % hostname, ciphers)
   184     ciphers = ui.config('hostsecurity', '%s:ciphers' % hostname, ciphers)
   185     s['ciphers'] = ciphers
   185     s['ciphers'] = ciphers
   186 
   186 
   187     # Look for fingerprints in [hostsecurity] section. Value is a list
   187     # Look for fingerprints in [hostsecurity] section. Value is a list
   188     # of <alg>:<fingerprint> strings.
   188     # of <alg>:<fingerprint> strings.
   189     fingerprints = ui.configlist('hostsecurity', '%s:fingerprints' % hostname,
   189     fingerprints = ui.configlist('hostsecurity', '%s:fingerprints' % hostname)
   190                                  [])
       
   191     for fingerprint in fingerprints:
   190     for fingerprint in fingerprints:
   192         if not (fingerprint.startswith(('sha1:', 'sha256:', 'sha512:'))):
   191         if not (fingerprint.startswith(('sha1:', 'sha256:', 'sha512:'))):
   193             raise error.Abort(_('invalid fingerprint for %s: %s') % (
   192             raise error.Abort(_('invalid fingerprint for %s: %s') % (
   194                                 hostname, fingerprint),
   193                                 hostname, fingerprint),
   195                               hint=_('must begin with "sha1:", "sha256:", '
   194                               hint=_('must begin with "sha1:", "sha256:", '