Re: [TLS] A flags extension

Nikos Mavrogiannopoulos <nmav@redhat.com> Tue, 26 March 2019 09:36 UTC

Return-Path: <nmav@redhat.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 1043F1202A1 for <tls@ietfa.amsl.com>; Tue, 26 Mar 2019 02:36:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 mWjHSwebf_xB for <tls@ietfa.amsl.com>; Tue, 26 Mar 2019 02:35:58 -0700 (PDT)
Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 BB06B120295 for <tls@ietf.org>; Tue, 26 Mar 2019 02:35:57 -0700 (PDT)
Received: by mail-wr1-f42.google.com with SMTP id j9so13440624wrn.6 for <tls@ietf.org>; Tue, 26 Mar 2019 02:35:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=itC57Rawowc0uCGDcvkcuaD7k1g+AiaYiwbFO/DGQeo=; b=QFlqYwEQZs3UfcpM/upx4+14pr6vjO4a68DcQWvthJTcEF+Z1IYvUTZBpKn3lCQHhO aHJuNnXe8Mc4cahOSm4UrSYXXbyxOhuChco8/CKNz81oWeYcvd58fyg3a20EK6+lGjWs CK9TGSKzG1e3EH0bfMHKEDgPxE2z6CIlYy5eT/eB+1JO0Yy2ob74EU7Z3k++u2ZpJFNP AF2d5QY7OpcZJMLn/1qhCtEAWW8siNAaawf/y5R+9rNgOkzMB35ZI1DrMBaNkCuntnVm H1dN119Ks+hprmV6hCKMxjeUPKjjRQFuxCQefO9Tc04cKsgx8FfQrSRxcFo/2sjx62Ed bdNQ==
X-Gm-Message-State: APjAAAWianQWhDZAbX0muztPTYPDxqMt634CwL3OK1MpFF+pDwxQ2EYq K6IrEDyviBnGbuvvzSlXz6S6Og==
X-Google-Smtp-Source: APXvYqy6ZXfwblXfTgPbO9npGiV66d3yDu3QjXJSGv/1Hc4aG5IIbmHhn+89vO4OhXTher7RZfLddg==
X-Received: by 2002:a5d:66c2:: with SMTP id k2mr18008815wrw.312.1553592956238; Tue, 26 Mar 2019 02:35:56 -0700 (PDT)
Received: from localhost.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id e9sm14409318wrp.35.2019.03.26.02.35.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 26 Mar 2019 02:35:55 -0700 (PDT)
Message-ID: <be8f455bf446d6db3ba81a8ac98ed9d485cc43de.camel@redhat.com>
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
To: Yoav Nir <ynir.ietf@gmail.com>
Cc: tls@ietf.org
Date: Tue, 26 Mar 2019 10:35:54 +0100
In-Reply-To: <F5AD3A62-C0D1-49F7-8D10-27A7DA92DCCC@gmail.com>
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>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.30.5 (3.30.5-1.fc29)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/h_ZSaOWPOICDDie92EVfLciCAAY>
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:36:00 -0000

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.

regards,
Nikos