[hybi] 64-bit comment

Erik Möller <emoller@opera.com> Thu, 24 June 2010 09:47 UTC

Return-Path: <emoller@opera.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 156433A6407 for <hybi@core3.amsl.com>; Thu, 24 Jun 2010 02:47:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.256
X-Spam-Level:
X-Spam-Status: No, score=-4.256 tagged_above=-999 required=5 tests=[AWL=-0.557, BAYES_50=0.001, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qZJFsWxuVXQb for <hybi@core3.amsl.com>; Thu, 24 Jun 2010 02:47:40 -0700 (PDT)
Received: from smtp.opera.com (smtp.opera.com [213.236.208.81]) by core3.amsl.com (Postfix) with ESMTP id 0EC3E3A6A53 for <hybi@ietf.org>; Thu, 24 Jun 2010 02:47:34 -0700 (PDT)
Received: from emoller-pc.gothenburg.osa (046-tdc.opera.com [213.236.208.46] (may be forged)) (authenticated bits=0) by smtp.opera.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o5O9lZlr016566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <hybi@ietf.org>; Thu, 24 Jun 2010 09:47:36 GMT
Content-Type: text/plain; charset="iso-8859-15"; format="flowed"; delsp="yes"
Date: Thu, 24 Jun 2010 11:47:34 +0200
To: Hybi <hybi@ietf.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
From: Erik Möller <emoller@opera.com>
Organization: Opera Software
Message-ID: <op.vesthhewr4mipi@emoller-pc.gothenburg.osa>
User-Agent: Opera Mail/10.53 (Win32)
Subject: [hybi] 64-bit comment
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 24 Jun 2010 09:47:43 -0000

[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