Re: [TLS] I-D Action: draft-ietf-tls-tlsflags-00.txt

Ilari Liusvaara <ilariliusvaara@welho.com> Mon, 12 August 2019 22:39 UTC

Return-Path: <ilariliusvaara@welho.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 23D8F120F42 for <tls@ietfa.amsl.com>; Mon, 12 Aug 2019 15:39:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.597
X-Spam-Level:
X-Spam-Status: No, score=-2.597 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 Nd4jKnAYPj-a for <tls@ietfa.amsl.com>; Mon, 12 Aug 2019 15:39:45 -0700 (PDT)
Received: from welho-filter4.welho.com (welho-filter4.welho.com [83.102.41.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6358612080C for <tls@ietf.org>; Mon, 12 Aug 2019 11:25:24 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter4.welho.com (Postfix) with ESMTP id CF28145BE7 for <tls@ietf.org>; Mon, 12 Aug 2019 21:25:21 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp3.welho.com ([IPv6:::ffff:83.102.41.86]) by localhost (welho-filter4.welho.com [::ffff:83.102.41.26]) (amavisd-new, port 10024) with ESMTP id YdwsCyC6F4I7 for <tls@ietf.org>; Mon, 12 Aug 2019 21:25:21 +0300 (EEST)
Received: from LK-Perkele-VII (87-100-246-37.bb.dnainternet.fi [87.100.246.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp3.welho.com (Postfix) with ESMTPSA id 538042309 for <tls@ietf.org>; Mon, 12 Aug 2019 21:25:20 +0300 (EEST)
Date: Mon, 12 Aug 2019 21:25:19 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: tls@ietf.org
Message-ID: <20190812182519.GA455391@LK-Perkele-VII>
References: <156563213549.17893.514258464688769886@ietfa.amsl.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <156563213549.17893.514258464688769886@ietfa.amsl.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/6BCgfPLtct73H_P3_FKOGJLJebQ>
Subject: Re: [TLS] I-D Action: draft-ietf-tls-tlsflags-00.txt
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: Mon, 12 Aug 2019 22:39:48 -0000

On Mon, Aug 12, 2019 at 10:48:55AM -0700, internet-drafts@ietf.org wrote:
> 
> A New Internet-Draft is available from the on-line Internet-Drafts directories.
> This draft is a work item of the Transport Layer Security WG of the IETF.
> 
>         Title           : A Flags Extension for TLS 1.3
>         Author          : Yoav Nir
> 	Filename        : draft-ietf-tls-tlsflags-00.txt
> 	Pages           : 6
> 	Date            : 2019-08-12
> 
> 
> The IETF datatracker status page for this draft is:
> https://datatracker.ietf.org/doc/draft-ietf-tls-tlsflags/
> 
> There are also htmlized versions available at:
> https://tools.ietf.org/html/draft-ietf-tls-tlsflags-00
> https://datatracker.ietf.org/doc/html/draft-ietf-tls-tlsflags-00

Two things:


1) uint8 flags<0..31>;

That adds an extra byte that is not technically necressary (because
extensions have lengths anyway) and limits number of flags to 248
(which might be enough).

And I do not think the length of flags field can be 0 (if it would
be, one could just omit the extension).


2) I think the bit order within octets should be reversed

That is, pack flags so that 0 is LSB of first octet, 7 is MSB of
first octet, 8 is LSB of second octet and so on.

Then one can read status flags by index with code like:

fn read_flag(flags: &[u8], idx: usize) -> bool
{
        *flags.get(idx/8).unwrap_or(&0) >> idx%8 & 1 != 0
}

(That code will also happily handle out-of-array flags by reading
them as false.)



-Ilari