Re: [hybi] Masking only Payload/Extension Data

John Tamplin <jat@google.com> Thu, 10 March 2011 19:12 UTC

Return-Path: <jat@google.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 F011C3A686C for <hybi@core3.amsl.com>; Thu, 10 Mar 2011 11:12:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.832
X-Spam-Level:
X-Spam-Status: No, score=-105.832 tagged_above=-999 required=5 tests=[AWL=0.144, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 D862uC1rmRU1 for <hybi@core3.amsl.com>; Thu, 10 Mar 2011 11:12:29 -0800 (PST)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by core3.amsl.com (Postfix) with ESMTP id 836053A6826 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:12:28 -0800 (PST)
Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p2AJDkHg001490 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:13:46 -0800
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1299784426; bh=y2t02HlFWOtiFZLJp6E3utMnRFw=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BdQG67YYfL9+6MuQyMGetbC+zvXCIb+fXjOxXZx1cg8sZPtBPIVpBnAw1PCOdHaTQ bUd3TQRPnmnVSucxl5IRg==
Received: from gwj15 (gwj15.prod.google.com [10.200.10.15]) by hpaq12.eem.corp.google.com with ESMTP id p2AJDiTH004433 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Thu, 10 Mar 2011 11:13:45 -0800
Received: by gwj15 with SMTP id 15so1289159gwj.25 for <hybi@ietf.org>; Thu, 10 Mar 2011 11:13:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ciqxPe3lomzR6bGnuFbVHlEzNdBiCPa8G6z9dQBGpto=; b=VPplZbERZ4BpJgMW1yEGDxkEw9mdHrv1Dq+qQJyXCuhoX8iZdEP2oz1Uc8C5ti/z11 C1EZ9Pm1rHYTHWW/WVaA==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=FYIfMBhABOqw80cZ+j+oOWglSCra6YHCF1BDNaIPApJI1A7OkkTYFlSsbvKnUjJSlv +NVoZ+E4/7a0LgulsS5A==
Received: by 10.150.170.19 with SMTP id s19mr1472293ybe.67.1299784424084; Thu, 10 Mar 2011 11:13:44 -0800 (PST)
MIME-Version: 1.0
Received: by 10.150.200.16 with HTTP; Thu, 10 Mar 2011 11:13:24 -0800 (PST)
In-Reply-To: <AANLkTi=Dc355npia4g3zijYOrt0BfiwbX9bUGzXa=Cq1@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>
From: John Tamplin <jat@google.com>
Date: Thu, 10 Mar 2011 14:13:24 -0500
Message-ID: <AANLkTikaECyZ-jQ+pX1eOezBrGTajrBk6TwNQ7ZCE1GY@mail.gmail.com>
To: David Endicott <dendicott@gmail.com>
Content-Type: multipart/alternative; boundary="000e0cd4cc3ce1d59a049e25a4b1"
X-System-Of-Record: true
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:12:31 -0000

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