Re: [TLS] ESNI PEM files

Eric Rescorla <ekr@rtfm.com> Fri, 25 October 2019 13:46 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 249E012080E for <tls@ietfa.amsl.com>; Fri, 25 Oct 2019 06:46:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] 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 dFpljyGmzDwn for <tls@ietfa.amsl.com>; Fri, 25 Oct 2019 06:46:07 -0700 (PDT)
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 9A8B3120882 for <tls@ietf.org>; Fri, 25 Oct 2019 06:46:06 -0700 (PDT)
Received: by mail-lf1-x130.google.com with SMTP id x4so1806386lfn.8 for <tls@ietf.org>; Fri, 25 Oct 2019 06:46:06 -0700 (PDT)
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 :cc; bh=8S2ZeBYI58lQRdyjhuleYh9tMuVTH76TU8ROziRTqRY=; b=CrgJ/ux/icgHc/ZJh+XRDEUC/mzXJJzKHm0qjo+/dgCSVu5zhi99p5c9POWuZCfNR9 WGuFM3tnSL5Qz8XMvUjZtQGk6a8cuKaou4ifumA1/aDhH80pnanwt6IxbJRVAkIKOHWb iHcsQ80PkLJQaLJ5T0Xl1WG1QmZb7CEsWFOEd5Krw6Uxphjp3AXaNhZRIPMhZG7W/AVN g9RcSZG7bSgAJE5uOiMVqES24kMbBBioWW+CGh5s7IOxWG6wAmq/n9/mqIXRse+Lg3Ga V47CPAzsqgs7UyojgEKzKaDCu9YVxCML7AK13O7wVW6k9SqoLhHSNaYt+uPBZcX0Lv5Z AtIw==
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=8S2ZeBYI58lQRdyjhuleYh9tMuVTH76TU8ROziRTqRY=; b=OkzE6jEgybqojUD6RtfPHLXXnvK+4XiwrO46abX9/GhUiIWYB+UZyMHtoAsa+WwQa9 NPsfC8cNNWtMY7TMddCPMwBaj9YARQC+pIyMSf2Ap5D0qplzC4kGByZye6XfWDt3rN3v 6fqt4a7V109loqozj3rMsjOXDqzTYibE7npQxeNwDEmE6WQRVg0eLo84m2g90r5gUck9 lu7CBcLhAppm0H4/Q+skZl2Ll1oLQ9K8vufbRzNQoEMSvOTbcfDBfpYNGDzZlHhQLE+3 MJJqEydmBlcP1XJhmRAjRTV8B6D57SmCzeut4hrN5ArQfL9gw3yv275rQxd6SVClPsEE 1dYA==
X-Gm-Message-State: APjAAAWSzMNZqfL/JEbbsAe0sGLWxCl+DAhujED5QhYAYiI3aqdZ/ayO xiJrbtv+yiDlelwgKLgx/nCOvmxJyXxcCOPJz2J7hg==
X-Google-Smtp-Source: APXvYqxeCw/wF/BKe8MmOKlJltHEecKEmocaYv3MNQGtHSBnDU2LorRPGVMhClsvrc3SomNiwnGkX4Pj2+rkbcqD1U0=
X-Received: by 2002:ac2:4847:: with SMTP id 7mr2816864lfy.180.1572011164732; Fri, 25 Oct 2019 06:46:04 -0700 (PDT)
MIME-Version: 1.0
References: <f5229a83-2724-681f-8593-ccfad8732ed6@cs.tcd.ie>
In-Reply-To: <f5229a83-2724-681f-8593-ccfad8732ed6@cs.tcd.ie>
From: Eric Rescorla <ekr@rtfm.com>
Date: Fri, 25 Oct 2019 06:45:28 -0700
Message-ID: <CABcZeBM2-XboBEXgPgP+RtaFECb4rSaM2uUHJbkCm3=9j2xKFA@mail.gmail.com>
To: Stephen Farrell <stephen.farrell@cs.tcd.ie>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000000ea3d70595bc5fe8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/OFl7wz7X9K8uByoMOCWhsay8fJQ>
Subject: Re: [TLS] ESNI PEM files
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: Fri, 25 Oct 2019 13:46:09 -0000

Are you suggesting that these strings appear on the wire in DNS? Or is this
just an internal implementation covnenience?

-Ekr


On Fri, Oct 25, 2019 at 3:55 AM Stephen Farrell <stephen.farrell@cs.tcd.ie>
wrote:

>
> Hiya,
>
> To date, my ESNI code [1] has been dealing with files containing
> the binary encoding of ESNIKeys and a separate PEM file containing
> the related private key.
>
> As part of getting nginx to work with ESNI [2], it'd be easier
> for me to deal with a single file containing both private key
> and the ESNIKeys (or ESNIConfig) value. (One of the upstream
> maintainers didn't like how I handled configuring ESNI, so the
> change is really to make him happier, but I think it's likely
> a generally useful thing:-)
>
> Since mixing binary and PEM encoding in one file would be ickky,
> it'd be nice if we had a PEM file convention for the public keys
> used in ESNI. And of course, it'd be much nicer if everyone did
> the same thing here.
>
> What I'm coding up now would handle files like:
>
> "
> -----BEGIN ESNIKEY-----
>
> /wGeNLTKACQAHQAg/JLBUtPE5wp4CU2bbTihSPeP3113kz1J80X/Iy1Y2EYAAhMBAQQAAAAAXO6j
> /gAAAABc995+AAA=
> -----END ENSIKEY-----
> "
>
> ...where the content is (unsurprisingly:-) a base64 encoded ESNIKeys.
>
> And if both the private and public components are in one file,
> it'd look like:
>
> "
> ----BEGIN PRIVATE KEY-----
> MC4CAQAwBQYDK2VuBCIEICAHxXknil9tI2qZ+USRouNwXp0LxlUB85l0/xbhZ4Va
> -----END PRIVATE KEY-----
> -----BEGIN ESNIKEY-----
>
> /wGeNLTKACQAHQAg/JLBUtPE5wp4CU2bbTihSPeP3113kz1J80X/Iy1Y2EYAAhMBAQQAAAAAXO6j
> /gAAAABc995+AAA=
> -----END ENSIKEY-----
> "
>
> I'd be happy to change that however increases the probability
> that other code bases do the same thing.
>
> If this is useful, I could do up a PR with a bit of text saying
> to use "ESNIKEY" (or whatever) as the label when storing these
> things in PEM files. Given RFC7468 documents other PEM file
> things, it seems reasonable to do the same for ESNI.
>
> Cheers,
> S.
>
> [1] https://github.com/sftcd/openssl/tree/master/esnistuff
> [2] https://github.com/sftcd/nginx
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>