Subject: Re: [hybi] 64-bit comment

From: Ian Hickson <[email-masked]>
Date: Wed, 21 Jul 2010 07:19:38 +0000 (UTC)

On Thu, 24 Jun 2010, Erik Möller wrote:
>
> [43. Let expected be the MD5 fingerprint of challenge as a big-endian 128 bit
> string. [RFC1321]]
> 
> A comment on the 64-bit issue of that code could be helpful I think. If you're
> just trying WebSockets on for size and do a simple server you're likely just
> going to use the code from rfc1321 to calculate the Md5 and it's pretty easy
> to miss the fact that it contains the following definition:
> 
> /* UINT4 defines a four byte word */
> typedef unsigned long int UINT4;
> 
> Works fine on 32-bit OS and LLP64 (i.e. Win64) but on any other 64-bit OS
> that's going to typedef UINT4 to be 8 bytes which will happily compile without
> errors but will produce an incorrect hash.

I'm very happy to include a note here, what text would you suggest?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'