Re: [Webpush] Major change to encryption

Costin Manolache <costin@gmail.com> Tue, 01 November 2016 17:58 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 7CB5B1294DA for <webpush@ietfa.amsl.com>; Tue, 1 Nov 2016 10:58:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.699
X-Spam-Level:
X-Spam-Status: No, score=-1.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, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=no 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 HL7USh7xfx4Q for <webpush@ietfa.amsl.com>; Tue, 1 Nov 2016 10:58:25 -0700 (PDT)
Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (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 B3A2B129413 for <webpush@ietf.org>; Tue, 1 Nov 2016 10:58:25 -0700 (PDT)
Received: by mail-oi0-x233.google.com with SMTP id 128so113615872oih.0 for <webpush@ietf.org>; Tue, 01 Nov 2016 10:58:25 -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=xgP7er559fzjZzkf+MNNoEVK8rT4UXIaCEIR8RLQLcs=; b=MzVuSmJxsRgGFs8PPuXoPyYXSrSxmVJFfQDN2UK1kZLMSKPf7BW17L6dg4/MTAvEoL danr5ULTqsbuag++nJNUNeI+lVkmIi4SAZ+lASRpH8t2u+h5EgWhh0z+ZLRamdOiUB2b ieJn3tdRELvQMwHOLMYOdJ/6igotLjOZCm6D3wSMKFKudIfL9LDE7vxj758zKq9dN6IX t6DOJh0BlScWbfwXJ/+UdPYA9ks4CuJ94itkWj47Hphgcfv4deNOC1wMNClw5Su8asR6 xW+WiX6AOiFZ5AahXkpxljCdYRgHdwoXbS6nFD2TJ5tnapkvrPgX/F04VDeIPtnxPrRi RCpg==
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=xgP7er559fzjZzkf+MNNoEVK8rT4UXIaCEIR8RLQLcs=; b=Ch+soRwCtzNJEdm/H12ILNwAuIKv8nZilFYnczRUWhsBx+FKQ7ytzo6G28cdwV8E+7 qdUoyWHyepYe8GxltSiBUUbViwS2GWGChSR1tDRYfvHjAu08X/jS5tYxU9ZShcCvbUEM zpOZnqY2x+W7iPDUU6h68CiQhT5ZsBoTLKaNxt5R13B4/p4PTbaS5bnKcWxecfGqR/Sf 45dIlyt0FCqWPsJ88zFgEuPpeevFnJ8zjZtL0AUIoSuTv3MMYSTc0QrU2yTjaHg7Zvnb lSZpIOndyP0xpE94blnp1jp8vjsfhQ2/xZympxP7xd1oAMsT/aubRt5ljMgpyWQHt8+U vsNA==
X-Gm-Message-State: ABUngvcrfXz39pUcFZBqJa47rF6LsPUeZJdDvJICHXvgcepTT8YmK/4Chh5QYfuacJazy8btcLXUwD50ckdgpQ==
X-Received: by 10.107.183.148 with SMTP id h142mr106643iof.190.1478023104967; Tue, 01 Nov 2016 10:58:24 -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>
In-Reply-To: <CABkgnnUSou5xroNP5dppHJOCydErzKm4c6_Z2tw1w2hLhqb6Bg@mail.gmail.com>
From: Costin Manolache <costin@gmail.com>
Date: Tue, 01 Nov 2016 17:58:14 +0000
Message-ID: <CAP8-Fqn7siP7JuguZHipHHsc6Hj7dfai3u3hS8MpjLJOCWqerA@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>, Peter Beverloo <beverloo@google.com>
Content-Type: multipart/alternative; boundary=94eb2c0b8e6e243a270540411264
Archived-At: <https://mailarchive.ietf.org/arch/msg/webpush/19pz0qIZBNN0GheAmKu72cYLr9k>
Cc: jr conlin <jconlin@mozilla.com>, "webpush@ietf.org" <webpush@ietf.org>
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: Tue, 01 Nov 2016 17:58:27 -0000

Using the Crypto-Key for vapid is fine with me - I have no problem with
keeping it for this purpose, in vapid spec. Or to use Crypto-Key in
other specs that deal with key distribution or other things.

However I still think that for consistency, the dh-public key used for
decrypting
the message should be in the binary header, next to salt - maybe even
 using the 'key id' field ( renamed to 'symmetric key id or public key' ).
The binary blob should be sufficient to decode the message, if the
content-encoding is known, using secrets known to the receiver ( symmetric
key in http case, or EC private key for webpush ).

I think it's important to recognize that client-to-pushservice communication
may use different transports, in addition to http/2 push promises. In
particular
it may be layered over Webcoket, newly proposed WiSH, etc - and in many
cases the implementation will be greatly simplified if the binary blob can
be sent as-is (after any protocol-specific authentication ).

Costin




On Mon, Oct 31, 2016 at 4:57 PM Martin Thomson <martin.thomson@gmail.com>
wrote:

Hi Peter and JR,

Thanks both for picking up on my stupid errors.  Hasty is not always
careful enough, but I was working to a time limit.  With 5 minutes
left, I think that I managed to get all your input integrated.

And your reminder about vapid was timely.  I think that we can
dispense with any attempt to remove Crypto-Key, since we have to have
it for vapid anyway.

Now I need to think about getting the python implementation updated.

--Martin

On 1 November 2016 at 10:31, Peter Beverloo <beverloo@google.com> wrote:
> Hi Martin,
>
> Thanks for the update and the proposal!
>
> I've reviewed these today, and have minor some points of feedback. I'll
> deliberately avoid the topics of interoperability and upgrade cost here.
>
> First of all, this indeed vastly improves layering between the drafts. I
> very much like how webpush-encryption is now built on top of encryption-
> encoding as opposed to being some sort of fork.
>
>>> A push message MUST include a zero length keyid parameter in the
>>> content coding header. This allows implementations to ignore the first
>>> 21 octets of a push message.
>
> I don't think this is right. The `salt` and the `rs` must still be known,
> and those are included in the header.
>
>>> A push service is not required to support more than 4096 octets of
>>> payload body (see Section 7.2 of [I-D.ietf-webpush-protocol]), which
>>> equates to at most 4059 octets of cleartext.
>
> I think this forgot about the padding --
>
>   4096 - 16 (auth) - 2 (padding length) - 21 (header w/o keyid) = 4,057
>
> May also want to s/cleartext/plaintext/ for consistency with encryption-
> encoding.
>
>>> An Application Server MUST include exactly one aes128gcm content
>>> coding, and at most one entry in the Crypto-Key field. This allows the
>>> keyid parameter to be omitted.
>
> This means the draft is incompatible with VAPID again. It must have at
> most one Crypto-Key entry that has a `dh` value.
>
> I haven't yet been able to validate the examples in the draft, but it
> sounds like you're changing these anyway per jr's feedback (+1 to that).
>
> Thanks,
> Peter
>
>
> On Mon, Oct 31, 2016 at 11:19 PM, Martin Thomson <martin.thomson@gmail.com
>
> wrote:
>>
>> On 1 November 2016 at 10:07, jr conlin <jconlin@mozilla.com> wrote:
>> > One small comment, then? Can we change the transmitted Content-Encoding
>> > type to match the new Content-type of "aes128gcm" instead of the long
>> > abandoned "aesgcm128"? (See point #4)
>>
>> Ouch, that's going to hurt.  I'll have to redo the examples :*(  40
>> minutes until the deadline, go!
>>
>> _______________________________________________
>> Webpush mailing list
>> Webpush@ietf.org
>> https://www.ietf.org/mailman/listinfo/webpush
>
>

_______________________________________________
Webpush mailing list
Webpush@ietf.org
https://www.ietf.org/mailman/listinfo/webpush