Re: [hybi] 64-bit comment

Ian Hickson <ian@hixie.ch> Wed, 21 July 2010 07:19 UTC

Return-Path: <ian@hixie.ch>
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 BCA2A3A677C for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 00:19:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.215
X-Spam-Level:
X-Spam-Status: No, score=-2.215 tagged_above=-999 required=5 tests=[AWL=0.084, BAYES_00=-2.599, MIME_8BIT_HEADER=0.3]
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 WgKwViGB+OTh for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 00:19:22 -0700 (PDT)
Received: from looneymail-a1.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id 02F3C3A681F for <hybi@ietf.org>; Wed, 21 Jul 2010 00:19:22 -0700 (PDT)
Received: from ps20323.dreamhostps.com (ps20323.dreamhost.com [69.163.222.251]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by looneymail-a1.g.dreamhost.com (Postfix) with ESMTP id 4BCB215D565; Wed, 21 Jul 2010 00:19:38 -0700 (PDT)
Date: Wed, 21 Jul 2010 07:19:38 +0000 (UTC)
From: Ian Hickson <ian@hixie.ch>
To: =?iso-8859-15?Q?Erik_M=F6ller?= <emoller@opera.com>
In-Reply-To: <op.vesthhewr4mipi@emoller-pc.gothenburg.osa>
Message-ID: <Pine.LNX.4.64.1007210719060.7242@ps20323.dreamhostps.com>
References: <op.vesthhewr4mipi@emoller-pc.gothenburg.osa>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-1555694626-1174950047-1279696778=:7242"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [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: Wed, 21 Jul 2010 07:19:22 -0000

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.   `._.-(,_..'--(,_..'`-.;.'