Patchwork D7850: sslutil: migrate to hashutil.sha1 instead of hashlib.sha1

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2020, 4:40 a.m.
Message ID <8667dee5e9979fdcf4a0b26e7ce4c292@localhost.localdomain>
Download mbox | patch
Permalink /patch/44304/
State Not Applicable
Headers show

Comments

phabricator - Jan. 14, 2020, 4:40 a.m.
Closed by commit rHGfde05ece875c: sslutil: migrate to hashutil.sha1 instead of hashlib.sha1 (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7850?vs=19191&id=19201

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7850/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7850

AFFECTED FILES
  mercurial/sslutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -24,6 +24,7 @@ 
     util,
 )
 from .utils import (
+    hashutil,
     resourceutil,
     stringutil,
 )
@@ -949,7 +950,7 @@ 
     # 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()),
     }