Re: [hybi] Masking only Payload/Extension Data

David Endicott <dendicott@gmail.com> Thu, 10 March 2011 19:35 UTC

Return-Path: <dendicott@gmail.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 79EDF3A6826 for <hybi@core3.amsl.com>; Thu, 10 Mar 2011 11:35:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 HJRBgdeH7KhP for <hybi@core3.amsl.com>; Thu, 10 Mar 2011 11:35:26 -0800 (PST)
Received: from mail-wy0-f172.google.com (mail-wy0-f172.google.com [74.125.82.172]) by core3.amsl.com (Postfix) with ESMTP id 236AE3A68B1 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:35:25 -0800 (PST)
Received: by wyb42 with SMTP id 42so2021084wyb.31 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:36:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=16+eZG5+Lu3HFNIRVWCw2cB2+aTgZB99GoHyvsq1PBo=; b=DZjSgebZfXmhvVvfUDBXlf1MterRSD7MpDwSIuZNJDSSWdyPS8Novh/n0LyvyXJInH +8+dZKKMO9OfszJRKyacJT6e8SQo3AUGU2BImEj+mWJR1usVc/WlKfXugADd7QH/qeAh m0RgMmnA/h1rwtedAC4W+vfAsBLVf3u75WOaI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=QTh86WRNEVvIZyk9pek5zMfDJnT7KiDUBtRWjgHzM8/jP6mhN7HjUv+ur+CgBLnkaI fgjQmAL5OG6j+z381ys/No8pu93n0ft4NPeNwsEXmy+efymqQWrGRA/FIKCbAbKpsGot 33ZN0CEUgsP3YBv5vQU6XA3EJNp8vODwAuEr4=
MIME-Version: 1.0
Received: by 10.216.171.133 with SMTP id r5mr6012935wel.91.1299785803587; Thu, 10 Mar 2011 11:36:43 -0800 (PST)
Received: by 10.216.122.13 with HTTP; Thu, 10 Mar 2011 11:36:43 -0800 (PST)
In-Reply-To: <AANLkTin-6t=yyPKqBJ38WsNBy5+b4d5MmKpPmdNfh0UQ@mail.gmail.com>
References: <4D77B885.5050109@callenish.com> <OF36FEDDC6.06951577-ON8825784E.0062343E-8825784E.0066AC27@playstation.sony.com> <AANLkTinau4g1pB_ccJ31u7WRi5npYtHvXE5YRn5uTbeV@mail.gmail.com> <AANLkTikB4YeaYiF_NVGn61c1YxpNWbmEWQZu1WcN+=Jf@mail.gmail.com> <1299704939.2606.238.camel@ds9.ducksong.com> <20110309214212.GA29190@1wt.eu> <AANLkTi=i=8aWg=6+T7=Kn5dWeKkW6MYVCH_CuNkt_ZMM@mail.gmail.com> <AANLkTimip9o0RoZaBfONCmg5nuJVWXjOKDKgAt8zrNVV@mail.gmail.com> <AANLkTikbFBeM6+hiURSBqxFyjc2Wc-yh8UJnZiO+U0JX@mail.gmail.com> <4D7915FF.50300@callenish.com> <AANLkTik557Y=tvpA-CypTgrGpxJTtfscmFuGKi0YEt0d@mail.gmail.com> <AANLkTikbObWcOzFZGrS=yWZqzVdpm6z4j2B+WfEbqQWX@mail.gmail.com> <AANLkTi=Dc355npia4g3zijYOrt0BfiwbX9bUGzXa=Cq1@mail.gmail.com> <AANLkTikaECyZ-jQ+pX1eOezBrGTajrBk6TwNQ7ZCE1GY@mail.gmail.com> <AANLkTin-6t=yyPKqBJ38WsNBy5+b4d5MmKpPmdNfh0UQ@mail.gmail.com>
Date: Thu, 10 Mar 2011 14:36:43 -0500
Message-ID: <AANLkTimvZ_dX6-6Gt5BW3-cUHmZm1pq=nYm8HTsykbW3@mail.gmail.com>
From: David Endicott <dendicott@gmail.com>
To: John Tamplin <jat@google.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Masking only Payload/Extension Data
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, 10 Mar 2011 19:35:27 -0000

Afterthought:  an unmasked header would allow Websocket aware
intermediaries to manipulate frames without unmasking them.
Websocket aware load balancers and distributed frameworks come to
mind.


On Thu, Mar 10, 2011 at 2:29 PM, David Endicott <dendicott@gmail.com> wrote:
> Fair point.  I agree it is not an undue burden given that we already
> have to deal with variable sized length fields anyway.
>
> Upon reflection, I change my vote to: don't care.    I cannot see an
> obvious benefit or drawback to either implementation.
>
>
>
> On Thu, Mar 10, 2011 at 2:13 PM, John Tamplin <jat@google.com> wrote:
>> On Thu, Mar 10, 2011 at 2:08 PM, David Endicott <dendicott@gmail.com> wrote:
>>>
>>> It would seem to me that it must go after the length field, or else
>>> how does the server know how much of the following stream to unmask.
>>> It would need to unmask enough of the header to determine the entire
>>> frame size and then continue.  That seems an unnecessary burden and
>>> complicates server reception processing.
>>
>> I'm not sure I understand your objection.  If you are writing a blocking
>> implementation, in the unmasked case you are going to read 2 bytes, and then
>> look at the second byte to decide how many more bytes are in the header.
>>  That lets you determine the length of the frame and read the rest of it.
>>  In the masked case, (as implemented in -06) you will read 6 bytes, then
>> start applying the mask to the bytes read as you process them.  In the
>> non-blocking case, you will have a state machine keeping track of where you
>> are, and as you receive a byte after you have processed the mask you unmask
>> it and process it.  I don't see that it adds much complexity.
>>
>> --
>> John A. Tamplin
>> Software Engineer (GWT), Google
>>
>