Re: [hybi] Masking only Payload/Extension Data

David Endicott <dendicott@gmail.com> Thu, 10 March 2011 19:28 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 ED5BE3A68B1 for <hybi@core3.amsl.com>; Thu, 10 Mar 2011 11:28:37 -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 M8RrFBXu1IlY for <hybi@core3.amsl.com>; Thu, 10 Mar 2011 11:28:36 -0800 (PST)
Received: from mail-ww0-f44.google.com (mail-ww0-f44.google.com [74.125.82.44]) by core3.amsl.com (Postfix) with ESMTP id B15FD3A6826 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:28:35 -0800 (PST)
Received: by wwa36 with SMTP id 36so1651519wwa.13 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:29:53 -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=hik55uaQwB7RWYSnDlvgsi2fsYVJ8TDa+6Mp9rTBuDw=; b=YHO8G39QJIydlHPa+8jOSD7tM5ECx0HkiipKPiGFMQsm6Sp3i107lbIK5KQVqtSQIR kDIuU7CBwVkSa4MTxZsqrtDO6FmpXj8G6d4B1wWPV+NehLYYRpuFeH++c7ow3ahjrK5X +wW+9QYJjMv3k6wzConIvMGc7lrA6ff834nVg=
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=c8OoyrIcRx80aMQ/psWpQwv5UmMt1h8oWjuJ8vG3JOMI+/UKByi8DPkIO//SMxypbV um33XmjNLqaWzhAVSBd7wguKUHbDjiESaCjJ8BBFM1AFMzJQ08TpZEewrddMnYfBAK5A O0TeqknDUCokE/ixN18Ew1DZ+Q6FjnMZNUIGE=
MIME-Version: 1.0
Received: by 10.216.190.131 with SMTP id e3mr6941629wen.76.1299785392808; Thu, 10 Mar 2011 11:29:52 -0800 (PST)
Received: by 10.216.122.13 with HTTP; Thu, 10 Mar 2011 11:29:52 -0800 (PST)
In-Reply-To: <AANLkTikaECyZ-jQ+pX1eOezBrGTajrBk6TwNQ7ZCE1GY@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>
Date: Thu, 10 Mar 2011 14:29:52 -0500
Message-ID: <AANLkTin-6t=yyPKqBJ38WsNBy5+b4d5MmKpPmdNfh0UQ@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:28:38 -0000

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
>