# HG changeset patch # User Gregory Szorc # Date 1464465448 25200 # Node ID 1eff545cef5245a2adc5e118cbee8287b6fca635 # Parent 70bc9912d83d29242f53847176719cb89ab43502 util: add sha256 Upcoming patches will teach host fingerprint checking to verify non-SHA1 fingerprints. Many x509 certificates these days are SHA-256. And modern browsers often display the SHA-256 fingerprint for certificates. Since SHA-256 fingerprints are highly visible and easy to obtain, we want to support them for fingerprint pinning. So add SHA-256 support to util. I did not add SHA-256 to DIGESTS and DIGESTS_BY_STRENGTH because this will advertise the algorithm on the wire protocol. I wasn't sure if that would be appropriate. I'm playing it safe by leaving it out for now. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -65,6 +65,7 @@ md5 = hashlib.md5 sha1 = hashlib.sha1 +sha256 = hashlib.sha256 sha512 = hashlib.sha512 _ = i18n._