Mercurial > hg
comparison mercurial/util.py @ 29261:1eff545cef52
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.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 28 May 2016 12:57:28 -0700 |
parents | ce2d81aafbae |
children | 82f6193ff2bc |
comparison
equal
deleted
inserted
replaced
29260:70bc9912d83d | 29261:1eff545cef52 |
---|---|
63 else: | 63 else: |
64 from . import posix as platform | 64 from . import posix as platform |
65 | 65 |
66 md5 = hashlib.md5 | 66 md5 = hashlib.md5 |
67 sha1 = hashlib.sha1 | 67 sha1 = hashlib.sha1 |
68 sha256 = hashlib.sha256 | |
68 sha512 = hashlib.sha512 | 69 sha512 = hashlib.sha512 |
69 _ = i18n._ | 70 _ = i18n._ |
70 | 71 |
71 cachestat = platform.cachestat | 72 cachestat = platform.cachestat |
72 checkexec = platform.checkexec | 73 checkexec = platform.checkexec |