Re: KEYS_READY

Kazuho Oku <kazuhooku@gmail.com> Thu, 14 February 2019 04:40 UTC

Return-Path: <kazuhooku@gmail.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2278F130F75 for <quic@ietfa.amsl.com>; Wed, 13 Feb 2019 20:40:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=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 82BkSr5VCQyO for <quic@ietfa.amsl.com>; Wed, 13 Feb 2019 20:40:46 -0800 (PST)
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (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 5D462130F70 for <quic@ietf.org>; Wed, 13 Feb 2019 20:40:45 -0800 (PST)
Received: by mail-lj1-x22d.google.com with SMTP id z25-v6so4017089ljk.7 for <quic@ietf.org>; Wed, 13 Feb 2019 20:40:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=f2LvL5hxDeroC7wRwLAnvk3hVjOfM8rSgOGLTjzK8ig=; b=HEtHOLbnv6iEtp+BhR+f3TeGlFKvSTSgjk2zgVPqtx9VSGiJRgHTGxIYRaVuOp8AV9 sGeRMoNmgwMVS/1LCvQwa9axivQTsAcLoTofYDMKNU3LrQUPBpOWDknaPInxliayTET/ jyDR+o8iSxFAA20tkhVJSH3t9/lCobTTg/j8CUgMjZ/C080m7SHkFz8RuBfP0B3BNxKq aq62S5vl8mvUn/YrxU2MprSz8IfaNd54Lu/Hegmav8LqljGy6nJgtFuzMRkjXpNMZ8La 4ThLt/sNFNTEiTnwyL+TxZTjNZxlaeGL3N4GlC7y+vUYUTeU9jZM+9+hDjvvmfoIWx/q 73JQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=f2LvL5hxDeroC7wRwLAnvk3hVjOfM8rSgOGLTjzK8ig=; b=Ahqid3Dw4hEEQAXolIgQNtWvyVtFN9QI+aiUs/45j365Af2CB30GJT8tRYBrgsRD97 u3qu6O5ZomATolGl8jqWCGA6V1cvNVx1RwiHaWswG6ZdvHjuWYARBOMOgGSeLqC3BeP8 eSKqgWU8i2iDeICL+05XGRN0OkmHw59mSoGzxReFK1VJ9vSduH3DY+hP9aVCrNvU58Oo UqnJRhHxgyoeFPOy7+5xmVGfs1nU7N9/+0HPgbGFj1YJWxfEN22rJSnXaI/+DcmtQFBj mv7H7TuCSVOm5FlCIhizbN7wQX1f/9nXTLghszbsfz6B5wTOlUT5bYWlQnTRhzeXRtEp PaKw==
X-Gm-Message-State: AHQUAuYo5oZFNqTazf17dcoXc3xr0l4+Xu4CaZz5Tn8CTY6hqfue7v5C xCKsVUpOd66F4v8fb41aZftsEEP/e/5vV3o/Exs=
X-Google-Smtp-Source: AHgI3IbAAc+R4Klal9qLhWxYrmMrlHKHs23sLblhSFpm9l7Q4tHRpzi/4JISgTbeaIdT4of/sUJWANawzyZDN6KqrQ0=
X-Received: by 2002:a2e:380d:: with SMTP id f13-v6mr999875lja.17.1550119243438; Wed, 13 Feb 2019 20:40:43 -0800 (PST)
MIME-Version: 1.0
References: <1550022355.557617.1656828112.4DD1CEE6@webmail.messagingengine.com> <CANatvzy_juza_meGR_-KuBV9FA=F754mv54aawxMb8hYWxb1gA@mail.gmail.com> <CAN1APdcVYKWuapZ3XHxXa_nVACwkRD-xeF3ub-5ROttE7QVrmQ@mail.gmail.com> <CAOYVs2ooxAuwu_zr2XZ-y9UqUP5kTbjoFrckAOi40bF9vODGOg@mail.gmail.com> <CAKcm_gNk=jKrnXM4Ht4yF0RX25wtVifjxz0c1gay0uie7PMw6A@mail.gmail.com> <CANatvzxBYzEaDZ1Ftt=o1zT5zVcVTd1EwtGiJOC-mkrNUWzVAQ@mail.gmail.com> <CAN1APdfzepc9DE98UsWw=hB4dM38qKLxdAjpsYuddDBatcscDA@mail.gmail.com> <739AFC55-DD02-47AA-A29E-B9C34ED7D6F9@gmail.com> <CAN1APddWLdmRo+ZZDnmvrBEFQk4TTcS3UK_9AU4KqAeSkiBvJQ@mail.gmail.com> <375A63C5-7120-4688-8873-EEA90693332E@huitema.net> <CANatvzxoOFzpkcH_4VpQscpZq8ak0QL0D6REvyJVjE+ga97SVQ@mail.gmail.com> <1550111606.3717440.1657643080.033E200B@webmail.messagingengine.com> <CANatvzy_ApgnZHnVC9N2GSXR8+pzKtHYZiidDnA8gt7Xu_AU=A@mail.gmail.com> <CACpbDcf-xmq4BExZ=vfZiH36bS=eto5UWUCZUYoe2mVKkbK9fw@mail.gmail.com>
In-Reply-To: <CACpbDcf-xmq4BExZ=vfZiH36bS=eto5UWUCZUYoe2mVKkbK9fw@mail.gmail.com>
From: Kazuho Oku <kazuhooku@gmail.com>
Date: Thu, 14 Feb 2019 13:40:31 +0900
Message-ID: <CANatvzwgHjBSp61SVgw-SJE1Qb+uMcVYLPo0PoM7hyvNm0E8eQ@mail.gmail.com>
Subject: Re: KEYS_READY
To: Jana Iyengar <jri.ietf@gmail.com>
Cc: Martin Thomson <mt@lowentropy.net>, IETF QUIC WG <quic@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/FupAFuk05cqHZ1egZ9mPiKa3u4c>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Feb 2019 04:40:48 -0000

2019年2月14日(木) 13:30 Jana Iyengar <jri.ietf@gmail.com>:
>
>
>
> On Wed, Feb 13, 2019 at 8:23 PM Kazuho Oku <kazuhooku@gmail.com> wrote:
>>
>> TL;DR I think that the issue with the PR is that it not only tries to
>> address issue but it changes existing mechanism. It might make sense
>> to consider just fixing the issues. Proposal below.
>>
>> I think there are two concerns regarding the PR.
>>
>> The PR changes how Initial keys are retired. Instead of relying on the
>> delivery of Handshake packets, it relies on the delivery of
>> KEYS_ACTIVE frames. However, we do not require KEY_ACTIVE frames to be
>> included in every Handshake packet being sent. There is a risk that
>> Initial keys might not get dropped as early as they are now. The other
>> issue is that an endpoint might never receive a Handshake packet that
>> carries a KEY_ACTIVE frame. This happens packet loss occurs. To
>> accommodate that, the PR states that the delivery of KEY_ACTIVE frame
>> in either a Handshake or a 1-RTT packet signals the disposal of the
>> Initial packet. That's workable, but I think it shows the problem with
>> the approach.
>>
>> KEY_ACTIVE frame does not name the key that is activated. That is
>> causing the strange retransmission rules for the frame. The right
>> approach seems to suggest endpoints to incorporate the frame in every
>> ACK-eliciting packet it sends. This is a logic we have not had so far,
>> and it could be difficult for certain implementations that do not know
>> what it is sending when it starts to build a packet.
>>
>> Considering these two issues, I think it might be worth discussing the
>> following straw-man:
>>
>> * Do not touch how Initial keys are dropped. Use the new frame just to
>> indicate the completion of the handshake and the retirement of the
>> previous generation of 1-RTT keys.
>> * Include the 1-RTT key generation number in the frame, so that
>> ordinary retransmission logic can be used. Note also that the
>> retransmission rule does not need to be aggressive, because we do not
>> use the frame for dropping Initial keys.
>>
>> When the handshake is complete, both endpoints send
>> KEYS_ACTIVE(generation=0). That indicates the peer that the peer can
>> drop the Handshake keys, and also that the endpoint is ready to
>> receive a key update.
>>
>> Completion of key update works exactly the same way. When key update
>> is complete, both endpoints send
>> KEY_ACTIVE(generation=previous_generation), indicating that the peer
>> can drop the 1-RTT keys, and that the endpoint is ready to receive
>> another key update.
>
>
> This is a good simplification, I think.  I'll note that you still cannot update keys again until you've received an ACK for the previous KEYS_ACTIVE.

We can require that, however it might be simpler to state that
receiving a KEY_ACTIVE frame from the peer allows an endpoint to
execute a key update.

>
>>
>> Regarding the validation of the generation number, I think we can call it a MAY.
>
>
> What validation?

In the straw-man, KEY_ACTIVE frame carries the generation number of
the 1-RTT key.

The value can be anything equal to or less than the current generation
number, because the delivery of the frame can be severely delayed
(this is the norm for QUIC frames used to communicate a monotonously
increasing number; e.g., MAX_STREAMS).

However, an endpoint should never receive a KEY_ACTIVE frame
containing a generation number that is greater than the generation it
has ever used. Endpoints might want to police that. That's the
validation I'm referring to.

>
> - jana
>
>>
>> 2019年2月14日(木) 11:33 Martin Thomson <mt@lowentropy.net>:
>> >
>> > A few different responses...
>> >
>> > On Wed, Feb 13, 2019, at 23:59, Marten Seemann wrote:
>> > > I agree with Kazuho that using a bit in the first byte seems to capture the
>> > > update logic we're looking for better. There's no need to retransmit any
>> > > information, since the bit is set on every subsequent packet.
>> >
>> > I was OK with that PR, and while we might go back and forth on the merits of using a bit vs. a frame, the consensus in Tokyo was that the frame was superior.  Also, this solves more problems.
>> >
>> > On Thu, Feb 14, 2019, at 02:48, Kazuho Oku wrote:
>> > > IIUC key updates are rare, and therefore the frame can be non-ack-
>> > > eliciting. FWIW, the current design does not elicit an ACK in response
>> > > to key update.
>> >
>> > I used the opposite logic.  Key updates are rare and therefore eliciting an acknowledgment does not cost much.  It's one packet per update.  The interesting thing there is that you guarantee that KEYS_ACTIVE frame is sent, so maybe the text about not sending it until you have something to send is not needed.
>> >
>> > On Thu, Feb 14, 2019, at 09:09, Kazuho Oku wrote:
>> > > 2019年2月14日(木) 3:20 Christian Huitema <huitema@huitema.net>:
>> > > > The more I look at it, the more I think that key update / key ready should be treated in much the same way as path challenge / path response.
>> > >
>> > > I am not sure if I like that alternative, primary because it does not
>> > > seem right as a way to drop Initial, 0-RTT, Handshake keys. We are
>> > > trying to address two issues at once; how to drop those keys in lower
>> > > epochs, and how to do key update correctly.
>> >
>> > The test we are looking for is whether a peer can read packets with a particular key.  You can test easily if they can write packets with a key because you receive a packet protected with that key.
>> >
>> > PATH_CHALLENGE/PATH_RESPONSE have baggage, so I don't want to use those.  A new challenge/response could work, but it doesn't offer much over a simple assertion (which is what the proposed frame is).  If the assertion is wrong, then the consequence is a broken connection, so there isn't much incentive to get this wrong.  PATH_CHALLENGE/PATH_RESPONSE contain a field that protects against lying, because there are scenarios in which lying provides advantage (that is, the "DoS this IP please" case).
>> >
>>
>>
>> --
>> Kazuho Oku
>>


-- 
Kazuho Oku