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:", ' |