Subject: [hybi] 64-bit comment

From: Erik Möller <[email-masked]>
Date: Thu, 24 Jun 2010 11:47:34 +0200

[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.

-- 
Erik Möller
Core Developer
Opera Software