Re: [TLS] A flags extension

Nick Harper <nharper@google.com> Tue, 26 March 2019 09:58 UTC

Return-Path: <nharper@google.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EFD3B1202B0 for <tls@ietfa.amsl.com>; Tue, 26 Mar 2019 02:58:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.5
X-Spam-Level:
X-Spam-Status: No, score=-17.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 ZNnazJ0r3i_e for <tls@ietfa.amsl.com>; Tue, 26 Mar 2019 02:58:39 -0700 (PDT)
Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (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 2991E1202C7 for <tls@ietf.org>; Tue, 26 Mar 2019 02:58:39 -0700 (PDT)
Received: by mail-oi1-x22f.google.com with SMTP id e22so9413592oiy.0 for <tls@ietf.org>; Tue, 26 Mar 2019 02:58:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=57ftcleWw6/sgBdeD2i9LnGM7FoUwGX8b4C3R6jyZAY=; b=c8fSzAxiM+2ckVwlePpiYwTaxrCtHO6/nx6NvB8EMNpBXRLmVmysG/G65FvOVptv+M ff0cj4iZypNvnF/6TQC+EJ3oaI+tpaqefJ6Ygdd9zYHx1JrXZVBWlhlYHAH3rusl8rb+ DamBL7W9ZhdMGZziMwLtHP/8dCLY9VUYRlGVhfG+4dxdXV4SfbnLfsRtWR0RUTHBBgUx 25hF/vWzLGprt78oM+5Qf28tHJtyJ64vI826//pC5pg8Yx9/YgwUQwTPJtG0hQji34ZX XoXUk9kWVhYIDiSjy2YqK3PH891GeNwgpr+Zk0Va7Y3r6fk2+pD0gR17JM2gK1wGNXDe /3Ng==
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; bh=57ftcleWw6/sgBdeD2i9LnGM7FoUwGX8b4C3R6jyZAY=; b=KHb9SoSsY5q/yJZtEvOWbx43XA/UDmx3V+wWAOVzc4W4myQIhh7gIGXKyZU4RGNTs7 18EClKEU4I3cV7ULwYswcKKAFMkqittp8fCS/sZXR+QiRfgJFFHG1iGrZLHreCqYJ3Wz s2U2s7GibSVn3B3KF9bG6HgZrf9H1Jz5cMUHiNOESuT14p5uBtQfJD3+oFbjp37/82rY moZoQwidXvZOouWqvvUy67tmOtCgtadSxKRbw3YX61nIpHlM4BPDwjGM37uFEpM+AgOR El/hNME5Veu2pNeReuNmfE0+X5hJJ2puPvP924iLj9kLjzMTGGtKH44KA/YUSz/siSDT FSew==
X-Gm-Message-State: APjAAAV+4sratlt0hqggDAdYIXAUQJIBENbmX43njFhS9EJjRpYE3pv+ TobBjYCNcndFZzGRi2nxtdQgovnW4aV3D978ysUqTQ==
X-Google-Smtp-Source: APXvYqxkxLjR1f0ybPznb/THLBFchn8PiUoAxIb8w8bVGhUJraamerrDper9t/yDueE/hqKPdYGUQk48sgwzBk4dUdc=
X-Received: by 2002:aca:c782:: with SMTP id x124mr15007908oif.61.1553594318104; Tue, 26 Mar 2019 02:58:38 -0700 (PDT)
MIME-Version: 1.0
References: <A7EC005E-3463-406B-930F-925B4D2338E4@gmail.com> <B0FF00D7-8727-4371-8DAA-AD2A920504F8@akamai.com> <2e5a5623-7de9-4f12-b699-b0b248432f96@www.fastmail.com> <F5AD3A62-C0D1-49F7-8D10-27A7DA92DCCC@gmail.com> <be8f455bf446d6db3ba81a8ac98ed9d485cc43de.camel@redhat.com> <C1694B79-1CA2-44B5-A77E-8F12FE0C785D@gmail.com>
In-Reply-To: <C1694B79-1CA2-44B5-A77E-8F12FE0C785D@gmail.com>
From: Nick Harper <nharper@google.com>
Date: Tue, 26 Mar 2019 10:58:27 +0100
Message-ID: <CACdeXi+NzB1+d1yf1Gg+e2u_K94JPKt=b7YJL=_DBsBUjWXSNw@mail.gmail.com>
To: Yoav Nir <ynir.ietf@gmail.com>
Cc: Nikos Mavrogiannopoulos <nmav@redhat.com>, "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000007516420584fc5d52"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/_5KHxhIUpeSgyT9tCOFvtcWZ1vQ>
Subject: Re: [TLS] A flags extension
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Mar 2019 09:58:52 -0000

One option for a bitstring could be to encode it in little endian and
truncate 0 bytes at the end of the encoding.

On Tue, Mar 26, 2019 at 10:50 AM Yoav Nir <ynir.ietf@gmail.com> wrote:

>
>
> > On 26 Mar 2019, at 10:35, Nikos Mavrogiannopoulos <nmav@redhat.com>
> wrote:
> >
> > On Tue, 2019-03-26 at 10:11 +0100, Yoav Nir wrote:
> >>> On 26 Mar 2019, at 9:06, Martin Thomson <mt@lowentropy.net> wrote:
> >>>
> >>> This needs more space for each flag.  8 bits is a pretty small
> >>> space.  If you are concerned with the size of the result, we have
> >>> some variable-length integer encodings you could try.
> >>
> >> Ah, the beautiful variable length encodings.  Like:
> >>
> >> - 0x00 - 0xBF - for standards-action allocations
> >> - 0xC0,0x00 - 0xEF,0xFF - for non-standards track
> >> - 0xF0,0x00 - 0xFF,0xFF - for private use among consenting parties.
> >> Are we really worried that we’re going to have more than 255 optional
> >> features for TLS?
> >
> > Given that adding an extended flags extension which can hold even more
> > flags is also easy, the 255-optional features do not seem so limited.
> >
> > Going into the extension itself, the array FlagExtensionType seems to
> > be the TLS-way to define such variable, but flags are easier, more
> > efficient to parse, and take less space if they are bits on an integer
> > value (32-bit or 64-bit). Have you considered a simpler structure like
> > that?
> >
> > struct {
> >   uint64 flags;
> >   uint64 ext_flags1;
> >   uint64 ext_flags2;
> >   uint24 ext_flags3;
> >   uint16 priv_flags;
> > } Flags;
> >
> > The advantage is that it can carry the same information with much less
> > bytes on the wire and it is easier to parse in low level languages.
> >
> > The disadvantage is that an extension flag would now need to specify
> > the bit it occupies _and_ the particular element it is set to.
>
> I thought about that. I guess it depends on how many of these optional
> features we expect to be declared at the same time.
>
> With the current way the draft is written, if the client supports 12 such
> extensions, the extension takes 16 bytes.  With a bitstring, it’s always
> the same length. so we’d need 36 bytes for a 256-bit space. If the client
> supports 100 extensions, my encoding takes 104 bytes while the bitstring is
> still 36 bytes.
>
> The question is which is more likely?
>
> Yoav
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>