<div dir="ltr">On Wed, Jul 6, 2016 at 10:38 AM, Kevin Bullock <span dir="ltr"><<a href="mailto:kbullock+mercurial@ringworld.org" target="_blank">kbullock+mercurial@ringworld.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">> On Jul 6, 2016, at 11:20, Matt Mackall <<a href="mailto:mpm@selenic.com">mpm@selenic.com</a>> wrote:<br>
><br>
> On Tue, 2016-07-05 at 23:36 -0700, Gregory Szorc wrote:<br>
>> # HG changeset patch<br>
>> # User Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>><br>
>> # Date 1467786847 25200<br>
>> #      Tue Jul 05 23:34:07 2016 -0700<br>
>> # Node ID 6873eb9a931da6cfcb40b2aba2f75260db5a8200<br>
>> # Parent  73b0a50ff97787557e517779a33644149d25d0a8<br>
>> sslutil: use base64 for key fingerprints (BC)<br>
>><br>
>> When I initially implemented support for SHA-256 and SHA-512<br>
>> certificate pinning, I copied the strategy used for SHA-1 fingerprints,<br>
>> which was to use hex fingerprints. SHA-256 and SHA-512 hashes are much<br>
>> longer. Using base 16 to represent the hash can be cumbersome.<br>
>><br>
>> This patch switches the fingerprints for newer fingerprints (read:<br>
>> everything in [hostsecurity]) to base64. The resulting strings are<br>
>> smaller and easier on the eyes in error messages.<br>
><br>
> I've found it very useful to be able to check the fingerprint with my laptop's<br>
> browser. My browser's trust database is generally newer and more reliable than<br>
> the equivalent database (if any!) available to Mercurial on a random old server.<br>
> Breaking that seems like a bigger loss than is gained by compactness.<br>
><br>
> For the sake of discussion, the current fingerprint size is:<br>
><br>
>  n/4 + n/8 - 1<br>
><br>
>  160: 59<br>
>  256: 95<br>
>  512: 191<br>
<br>
</div></div>Can we make the colons optional in hex fingerprints (if they aren't already)? That takes it from the above to just n/4:<br>
<br>
160: 40<br>
256: 64<br>
512: 128<br>
<br>
...which isn't as good as base64, but retains the inspectability of the current arrangement.<br></blockquote><div><br></div><div>The colons are already optional.<br><br></div><div>While I'm here, since I was on the fence about this and since mpm isn't a fan, let's drop it.<br><br></div><div>In the future, we could add support for using base64 fingerprints in the config. But I don't see a value in doing that today. <br></div></div><br></div></div>