Re: [Webpush] Major change to encryption

Costin Manolache <costin@gmail.com> Wed, 02 November 2016 04:47 UTC

Return-Path: <costin@gmail.com>
X-Original-To: webpush@ietfa.amsl.com
Delivered-To: webpush@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3372B1299EA for <webpush@ietfa.amsl.com>; Tue, 1 Nov 2016 21:47:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dC1dP_R--ws9 for <webpush@ietfa.amsl.com>; Tue, 1 Nov 2016 21:46:59 -0700 (PDT)
Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 61627129494 for <webpush@ietf.org>; Tue, 1 Nov 2016 21:46:59 -0700 (PDT)
Received: by mail-it0-x234.google.com with SMTP id e187so65606057itc.0 for <webpush@ietf.org>; Tue, 01 Nov 2016 21:46:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kKCZKnHlb1DSr+YkC3LcCzkNOyNtUEjbaZE78vWWYVo=; b=q5bMPHqrH/f7/SbfBeEXmna0AGKZfsc5FpaA/l2bYZL/DvNXP9667T3P9VEKAk74tb N6AGEUwxeywaKhGlc9ej7ejAP4CTLD5iXfl8HHaL3B1iG/RDmYLO2EpREGsz4jSZM3qO tuVq8iAYRcVm0++La6PjsykINA0l7aXOrRtN3eF8DXpy3V5+Qk8a+holp2I8pSsVzvaa Nq+DDWkrUWQT1ZVDDsCif0pTpaNrNM65RQNoPdqVbEEKlW4QnuG7QyfvRwx2E+0/BZSV hsc3j6yC87ufNl5yr/3uY81MO75li06vPfFXohRdfvMUwV1pbIxjGdoKI4p1xafY2q11 7zsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kKCZKnHlb1DSr+YkC3LcCzkNOyNtUEjbaZE78vWWYVo=; b=RHPiLzeAch0TkULRHPGU+mXL/fd1s8IwEiDJosOfEi3uuKwKBeAbpFKsG9Z/4kXR43 khjw1BkhZ+y+SunxgI5whq9kaqsp+dq4yN15AmLQ/FdEKhFu4n63FZnsxNfRIClff/Lj wuiWi9ThleF8d5Lgpqq0CvFCFEh3EQD+GuRAsK81ydv1p+YKBa21m4zs/oXkinqHFwE5 BH7VH44la3E+j4QEO92JjGoro5C7CU2lHOslG/I9HBVs52Tg8vR4i+qaNV0kCMxK9Odd BMSECmX5gmCc6qNLazf/QNotEB0JI1jxKIRdlnk3o3TONRtMfMn3A5w+V8MYzUpri1SF iCKA==
X-Gm-Message-State: ABUngvfX0DwEVmetOw7NfpVHaKztvs6Q2SdAziqq6J6H+mzQDZUPsB8rxgUsBj4SPwJS6q0QdSkIgM3n/8HOMA==
X-Received: by 10.107.183.148 with SMTP id h142mr2275512iof.190.1478062018717; Tue, 01 Nov 2016 21:46:58 -0700 (PDT)
MIME-Version: 1.0
References: <CABkgnnUiLBOGQ6fSTiLcxn_RKbEHFYHzCAv3OMg_btETfKjRGA@mail.gmail.com> <da15e3e3-9d20-7e2c-eceb-d369a3529226@mozilla.com> <CABkgnnVeGAtADwvf_FWKvNDpAtKNVvWpiFAr-LPf47hgHSqiag@mail.gmail.com> <f6bb7ff3-1d6c-3b8c-b956-aaa0c046fd3a@mozilla.com> <CABkgnnUzR747r3VC1DLTqnZJwPvkAoH-SbB+y7-UY0i1Z+fX3A@mail.gmail.com> <CALt3x6nS2+LG6aZPEZL5wPA_c00pCjZ5WswcFqty35weut2rOw@mail.gmail.com> <CABkgnnUSou5xroNP5dppHJOCydErzKm4c6_Z2tw1w2hLhqb6Bg@mail.gmail.com> <CAP8-Fqn7siP7JuguZHipHHsc6Hj7dfai3u3hS8MpjLJOCWqerA@mail.gmail.com> <84f3da33-a9a4-1bbc-f290-e283cec07c22@mozilla.com> <CAP8-Fqk+suz9YpFKbdTa42nUfknWfPH-M017UjRjV2oLxUZKjQ@mail.gmail.com> <CABkgnnW3LK5Gvj=05QFrUktZhHEvwS-dkLE3BE_1iaSoMizUdg@mail.gmail.com> <CA+XEteO0DeT4VEVArWwzR_6n-e2EA5dcsjG_Sqmc2Hwgqp6y6A@mail.gmail.com> <CAP8-FqkA1EbpxmRn_LjShep+oMtmSWszBpytcA=d4G1emrUm1g@mail.gmail.com>
In-Reply-To: <CAP8-FqkA1EbpxmRn_LjShep+oMtmSWszBpytcA=d4G1emrUm1g@mail.gmail.com>
From: Costin Manolache <costin@gmail.com>
Date: Wed, 02 Nov 2016 04:46:47 +0000
Message-ID: <CAP8-Fqkc89JdKWEs+PixYyyGpS2W3Du4HGQ4_hWau_Y6p3r6Hg@mail.gmail.com>
To: jrconlin@mozilla.com, Martin Thomson <martin.thomson@gmail.com>
Content-Type: multipart/alternative; boundary="94eb2c0b8e6e94ed6a05404a21b2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/webpush/Ijkbpc9ffSCCdl8tbFvYxJWqQ08>
Cc: "webpush@ietf.org" <webpush@ietf.org>, Peter Beverloo <beverloo@google.com>
Subject: Re: [Webpush] Major change to encryption
X-BeenThere: webpush@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Discussion of potential IETF work on a web push protocol <webpush.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/webpush>, <mailto:webpush-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/webpush/>
List-Post: <mailto:webpush@ietf.org>
List-Help: <mailto:webpush-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/webpush>, <mailto:webpush-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Nov 2016 04:47:01 -0000

I now understand your concern - no need to steal any octet, just define
that
real message size should be 4k. I believe aesgcm also adds few byes for
authentication - we can define that the cleartext can be 4k, with header
and crypto overhead excluded..

Costin

On Tue, Nov 1, 2016 at 9:43 PM Costin Manolache <costin@gmail.com> wrote:

> AFAIK the "DH" public key must be sent to the device no matter what.
>
> Right now for GCM, if you use the webpush endpoint the headers end up in
> the key/value pairs, as base64, while the binary data goes in the raw_data.
> I have no problem if the spec defines that the binary header should be
> excluded - and
>  push services support 4k of real data ( i.e. continue to exclude the
> header overhead).
>
> If transmitting over other transports - somehow we need to send the dh
> public key and
> the body - if it doesn't fit a tickle+poll or segmentation need to be
> used. The fact the
>  public key was received in a header or was part of the body doesn't
> change this.
>
> Costin
>
> On Tue, Nov 1, 2016 at 9:02 PM JR Conlin <jconlin@mozilla.com> wrote:
>
> ​On Tue, Nov 1, 2016 at 8:50 PM, Martin Thomson <martin.thomson@gmail.com>
> wrote:
>
> Moving the public key into the body will cut into message budgets.
> We'll be at 3994 octets of plaintext maximum if we do that.
>
> ​​
>
> ​I'm a bit confused about that. For "native" networks, push servers have
> pretty wide tolerances for how much data that they can send over their
> pipes. Going between services, I can definitely understand, since you're
> held to the limits of the provider system. (APNs limits to about 2K, so
> users are kinda screwed worse.) Of course, with "bridged" systems like
> those, you still have to deal with the host system, so "headers" aren't
> free. You still have to encode the data into the body of the message in
> some fashion, which eats into the available amount.
>
> Worst of all, is that those bridged systems are also unreliable for hosts
> of reasons and then you're re-implementing TCP with one hand tied behind
> your back.​
>
> Granted, I've got a pretty limited viewpoint, so I'm sure I'm missing
> something obvious.
>
> On Tue, Nov 1, 2016 at 8:50 PM, Martin Thomson <martin.thomson@gmail.com>
> wrote:
>
> On 2 November 2016 at 12:00, Costin Manolache <costin@gmail.com> wrote:
> > Yes, when sending over GCM it's better to have the 65bytes of the key in
> the
> > binary prefix of the
> > "raw_data" byte[] instead of having to add another key/value pair, with
> the
> > b64 encoding and proto
> > overhead. But it's an optimization - not the main reason :-). A nice
> extra
> > benefit is that browsers on android
> > could dispatch the message based on the raw_data only, since the EC
> public
> > key can identify the app/SW.
>
> As I said, I'm not opposed to this, it just seems wrong.
>
> Moving the public key into the body will cut into message budgets.
> We'll be at 3994 octets of plaintext maximum if we do that.  One of
> the nice things with the header field is that users don't pay for it.
> The bad thing is that the server needs to find a way to move it.
>
> If we are going to make this change, we need to be very crisp about it.
>
>
>