equal
deleted
inserted
replaced
22 node, |
22 node, |
23 pycompat, |
23 pycompat, |
24 util, |
24 util, |
25 ) |
25 ) |
26 from .utils import ( |
26 from .utils import ( |
|
27 hashutil, |
27 resourceutil, |
28 resourceutil, |
28 stringutil, |
29 stringutil, |
29 ) |
30 ) |
30 |
31 |
31 # Python 2.7.9+ overhauled the built-in SSL/TLS features of Python. It added |
32 # Python 2.7.9+ overhauled the built-in SSL/TLS features of Python. It added |
947 return |
948 return |
948 |
949 |
949 # If a certificate fingerprint is pinned, use it and only it to |
950 # If a certificate fingerprint is pinned, use it and only it to |
950 # validate the remote cert. |
951 # validate the remote cert. |
951 peerfingerprints = { |
952 peerfingerprints = { |
952 b'sha1': node.hex(hashlib.sha1(peercert).digest()), |
953 b'sha1': node.hex(hashutil.sha1(peercert).digest()), |
953 b'sha256': node.hex(hashlib.sha256(peercert).digest()), |
954 b'sha256': node.hex(hashlib.sha256(peercert).digest()), |
954 b'sha512': node.hex(hashlib.sha512(peercert).digest()), |
955 b'sha512': node.hex(hashlib.sha512(peercert).digest()), |
955 } |
956 } |
956 |
957 |
957 def fmtfingerprint(s): |
958 def fmtfingerprint(s): |