Re: [hybi] Framing take IV

Ian Hickson <ian@hixie.ch> Wed, 04 August 2010 04:36 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 3B2FA3A6BB3 for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 21:36:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.506
X-Spam-Level:
X-Spam-Status: No, score=-2.506 tagged_above=-999 required=5 tests=[AWL=0.093, BAYES_00=-2.599]
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 VE1Ke85RQX+Q for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 21:36:50 -0700 (PDT)
Received: from homiemail-a43.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id DAD753A67CF for <hybi@ietf.org>; Tue, 3 Aug 2010 21:36:50 -0700 (PDT)
Received: from homiemail-a43.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a43.g.dreamhost.com (Postfix) with ESMTP id 03E598C065; Tue, 3 Aug 2010 21:37:20 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; c=nofws; d=hixie.ch; h=date:from:to:cc :subject:in-reply-to:message-id:references:mime-version: content-type; q=dns; s=hixie.ch; b=KA0Imqqp/kos6X8hy+OlYEHdwPjOb ZOqkq/bhMoIt/TmIUPPRiupK3TA8mT1Pnvgv8cx2yJiT2Q1DFRvAuH0A08M6VYxw AI2xUiSATSZBKtSzfifK+jKEf91d34c0v9XcYDy9MmV2cwgUMwTgmEWfXzlCzH+h kxZaer/SAPe3a0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=hixie.ch; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version: content-type; s=hixie.ch; bh=+TN9GxdpR/rRsb5nDlu9nZ7DjeE=; b=YIr qCYuFa85fXWsidBWM+195NgPL9zMdXu3+Qc9hebwHfuesqft4M5qyVdRVAolXYFE /L3lvm4q5XGvga8UIj6oEovYwVHSO7rE9E1IBhprSvWEpA0FcY8/5pxTgSD+Ya+6 eKdWmtAPI44LT0FhYcainEoQnwQq0wvuYt3KczJM=
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) (Authenticated sender: internal@index.hixie.ch) by homiemail-a43.g.dreamhost.com (Postfix) with ESMTPSA id F36428C05F; Tue, 3 Aug 2010 21:37:19 -0700 (PDT)
Date: Wed, 04 Aug 2010 04:37:19 +0000
From: Ian Hickson <ian@hixie.ch>
To: Greg Wilkins <gregw@webtide.com>
In-Reply-To: <AANLkTi=3CJDKu37LV+6CG=d7VP5fOe-JNV9Cd=99BjjA@mail.gmail.com>
Message-ID: <Pine.LNX.4.64.1008040429410.5947@ps20323.dreamhostps.com>
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com> <AANLkTi=3CJDKu37LV+6CG=d7VP5fOe-JNV9Cd=99BjjA@mail.gmail.com>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing take IV
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, 04 Aug 2010 04:36:52 -0000

On Wed, 4 Aug 2010, Greg Wilkins wrote:
> On 4 August 2010 10:53, Ian Hickson <ian@hixie.ch> wrote:
> 
> at the f2f there was a very loud hum for a single framing mechanism. 
> Following that, there were loud hums for fragmentation and fixed length 
> frames, even without consideration of multiplexing.
> 
> I believe the feeling was that fragmentation makes sending and receiving 
> big messages simpler.  It also prepares the ground for multiplexing 
> extensions. There was very little support for variable length lengths, 
> as that was just seen as more complex than fragmentation.
> 
> But if you have a counter proposal that meets the single framing hum, 
> then please post it.

With all due respect, I'd much rather base work on this protocol on actual 
technical arguments, and not on a self-selected group of people humming, 
as much fun as that may be.

Here's a proposal for length-based frames:

 - one byte to indicate the frame type (used by the WebSocket API to 
   decide what kind of event to fire)
 - a BER-encoded packed integer, most-significant-digits first, high bit 
   used to indicate a continuation byte, giving the payload length.
 - payload

I'm still not convinced that length-based frames are safe enough for the 
Web, but I have been convinced by the various discussions of security bugs 
related to framing that sentinel-based frames are likely just as insecure. 
I really think we should find a solution that is more secure than either, 
though; I don't think that we should go with length-based frames on the 
basis that the alternatives are equally likely to lead to security bugs.

In the absence of a better solution, though, the above (basically the same 
as what the protocol has now, except with sentinel-based frame type 
removed) seems to fit the bill fine.

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