Re: [TLS] ESNI padding the Certificate message

Eric Rescorla <ekr@rtfm.com> Thu, 13 December 2018 15:52 UTC

Return-Path: <ekr@rtfm.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 20ED4128C65 for <tls@ietfa.amsl.com>; Thu, 13 Dec 2018 07:52:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.358
X-Spam-Level:
X-Spam-Status: No, score=-3.358 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-1.459, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.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 jPwE4zS4VBRy for <tls@ietfa.amsl.com>; Thu, 13 Dec 2018 07:52:00 -0800 (PST)
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450: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 6DE2F12896A for <tls@ietf.org>; Thu, 13 Dec 2018 07:51:56 -0800 (PST)
Received: by mail-lj1-x22f.google.com with SMTP id u6-v6so2228649ljd.1 for <tls@ietf.org>; Thu, 13 Dec 2018 07:51:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=5OqgZkHD3XEKL/wRkRPJIFhVYYwjhZkwSYvzuHcrlHU=; b=00zUnJ0Sl99FzA9tqPfaEXiqe0cMCJ1bGv/WwpXPdXnJ1BwLW0+eR7cxPDFwMYRcVO 6QG/x4HgJGDiMfJHBMcWnKtgYCIZwQQp57n9DkR1S0oT0w55jJL70j5/Vlx97Spor26L gfavQx6XAff0VVRgolMq8QvxHeQj1bh3UAheRgIZb9jn3L/8xyaQ2mNAcnrtV5XaR10r nWIxdMlPXnP880dfRfGufhefphc31qHbS1+jS9pVKYLfs+t7X3lntiffMgfffguamKkU R8yaGLOIVmJj5SlLJTo+2fulNwlbEWVdJ9PRuhRqtQ4MYzzeRebMxRvIYLuvUkQ5vDXv 3huA==
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; bh=5OqgZkHD3XEKL/wRkRPJIFhVYYwjhZkwSYvzuHcrlHU=; b=LBPSAam1MCTR5kRRQDe1CbI+68XVWkLP05oM5pGAQuGhWRvcTJ/zsl7pCu4vurCWdr PvEuczhhRZSQHpkZZEIvG3MAmoFE5lrSw5l6JT+R0edMQbJGrGBZxJYoN+nV/mR9g1xv p+wfNhdIUrSmE2AnVBDim1GUmka1OndG5I/aC5fCPAJL4kMysD/I+u6U0M9uKqbogPSA XbC+7ZYm3rIEm+o7FlTpXBoV6rvn+2I0GB6rdEL34i1qOTasNYagMR0YbqprsqOkyxvU 7Z3HFSPFb8ap1xEdsYAl7zFu118hsBorVANLYocbTPz7tjR8aAFRn3FoivsnKBWIMT4v J3Hw==
X-Gm-Message-State: AA+aEWZovqjJsu6v6AG/qF7Vxcs11rURpqNPouO2enSQScuui61Z2zZ+ GkEZJDRV1kO1ODCHXgY33WV3f3MBN7nhQu70G8YPzf+QEo4=
X-Google-Smtp-Source: AFSGD/Xg8paTUYQkYNNt70kzkH3fMZDsVHaTmvOi84N03l0M9NuTmPX3VPg751rAq1gRgxlLJhyKeWnah6XG95knUOk=
X-Received: by 2002:a2e:2d11:: with SMTP id t17-v6mr14894936ljt.159.1544716314260; Thu, 13 Dec 2018 07:51:54 -0800 (PST)
MIME-Version: 1.0
References: <876187a2-df66-2eb0-5a55-b6e67cf668f6@cs.tcd.ie> <B3D20A93-3332-4541-8108-E4EFB08FBF6F@dukhovni.org>
In-Reply-To: <B3D20A93-3332-4541-8108-E4EFB08FBF6F@dukhovni.org>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 13 Dec 2018 07:51:17 -0800
Message-ID: <CABcZeBM+ekw7xSzbz6Kh4aRbWXpy5f1U-iUu8W1fDKjVuUJ+3A@mail.gmail.com>
To: "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000030d6d3057ce94bd0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/R3Xwvly3gCxl5MpbaLF7Xi8byYQ>
Subject: Re: [TLS] ESNI padding the Certificate message
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: Thu, 13 Dec 2018 15:52:03 -0000

On Thu, Dec 13, 2018 at 7:28 AM Viktor Dukhovni <ietf-dane@dukhovni.org>;
wrote:

> > On Dec 13, 2018, at 8:10 AM, Stephen Farrell <stephen.farrell@cs.tcd.ie>;
> 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.


You already need some of this information in order to specify the largest
possible SNI (so you can pad to it), so I don't think this is prohibitive.


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.
>

Random padding does poorly with repeated trials. So, for instance,
if I get to observe a large number of requests from the same client
to the same server, you can gradually infer the length of the cert
chain.

-Ekr




> --
>         Viktor.
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>