Re: [TLS] ESNI padding the Certificate message

Viktor Dukhovni <> Thu, 13 December 2018 15:27 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id A5101124408 for <>; Thu, 13 Dec 2018 07:27:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -4.201
X-Spam-Status: No, score=-4.201 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id VGhoBw_w3Tkq for <>; Thu, 13 Dec 2018 07:27:49 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 03C971200B3 for <>; Thu, 13 Dec 2018 07:27:49 -0800 (PST)
Received: from [] (unknown []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 27842AE004 for <>; Thu, 13 Dec 2018 10:27:47 -0500 (EST)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
From: Viktor Dukhovni <>
In-Reply-To: <>
Date: Thu, 13 Dec 2018 10:27:46 -0500
Content-Transfer-Encoding: quoted-printable
Reply-To: IETF TLS WG <>
Message-Id: <>
References: <>
X-Mailer: Apple Mail (2.3445.102.3)
Archived-At: <>
Subject: Re: [TLS] ESNI padding the Certificate message
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." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 13 Dec 2018 15:27:51 -0000

> On Dec 13, 2018, at 8:10 AM, Stephen Farrell <>; wrote:
> Was just adding code for this and I noticed that the draft says
> a server: "SHOULD pad the Certificate message, via padding at
> the record layer, such that its length equals the size of the
> largest possible Certificate (message) covered by the same ESNI
> key."

"Largest possible" is not always a knowable target.  One often does
not know anything about the sizes of the other potential certificate
chains in advance of serving such a chain.  Far more sensible would
be to add random padding whose size is commensurate with the size of
the certificate message.

I would generate a random nibble, and count the first $k$
non-zero bits.  Then $1 + k$ times add independently
random([0, N/2]) bytes of padding to an $N$ byte message,
giving an additional $~N$ bytes on average, but occasionally
up to $2.5N$ additional bytes.