diff mercurial/sslutil.py @ 29341:0d83ad967bf8

cleanup: replace uses of util.(md5|sha1|sha256|sha512) with hashlib.\1 All versions of Python we support or hope to support make the hash functions available in the same way under the same name, so we may as well drop the util forwards.
author Augie Fackler <raf@durin42.com>
date Fri, 10 Jun 2016 00:12:33 -0400
parents ecc9b788fd69
children 98e8313dcd9e
line wrap: on
line diff
--- a/mercurial/sslutil.py	Fri Jun 10 00:25:07 2016 -0400
+++ b/mercurial/sslutil.py	Fri Jun 10 00:12:33 2016 -0400
@@ -9,6 +9,7 @@
 
 from __future__ import absolute_import
 
+import hashlib
 import os
 import ssl
 import sys
@@ -388,9 +389,9 @@
     # If a certificate fingerprint is pinned, use it and only it to
     # validate the remote cert.
     peerfingerprints = {
-        'sha1': util.sha1(peercert).hexdigest(),
-        'sha256': util.sha256(peercert).hexdigest(),
-        'sha512': util.sha512(peercert).hexdigest(),
+        'sha1': hashlib.sha1(peercert).hexdigest(),
+        'sha256': hashlib.sha256(peercert).hexdigest(),
+        'sha512': hashlib.sha512(peercert).hexdigest(),
     }
 
     def fmtfingerprint(s):