# HG changeset patch # User Augie Fackler # Date 2020-01-13 22:16:54 # Node ID fde05ece875cd7aca4d649ec9c00776dca33ce9c # Parent 4ebd162f4d8c7f668b060b151cf80fa827cd5880 sslutil: migrate to hashutil.sha1 instead of hashlib.sha1 This is a straight-line replacement like the others, but I split it out since it's used in a network context and I'm not sure this is appropriate (we should probably drop support for sha1 fingerprints over TLS) and wanted this to be easily dropped. Differential Revision: https://phab.mercurial-scm.org/D7850 diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py --- a/mercurial/sslutil.py +++ b/mercurial/sslutil.py @@ -24,6 +24,7 @@ from . import ( util, ) from .utils import ( + hashutil, resourceutil, stringutil, ) @@ -949,7 +950,7 @@ def validatesocket(sock): # If a certificate fingerprint is pinned, use it and only it to # validate the remote cert. peerfingerprints = { - b'sha1': node.hex(hashlib.sha1(peercert).digest()), + b'sha1': node.hex(hashutil.sha1(peercert).digest()), b'sha256': node.hex(hashlib.sha256(peercert).digest()), b'sha512': node.hex(hashlib.sha512(peercert).digest()), }