Re: [websec] HPKP & different encodings of the same public key

Yoav Nir <ynir.ietf@gmail.com> Sun, 15 May 2016 20:32 UTC

Return-Path: <ynir.ietf@gmail.com>
X-Original-To: websec@ietfa.amsl.com
Delivered-To: websec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AC66B12D1E7 for <websec@ietfa.amsl.com>; Sun, 15 May 2016 13:32:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 WFsWQtIMF_bP for <websec@ietfa.amsl.com>; Sun, 15 May 2016 13:32:16 -0700 (PDT)
Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 38F9A12D11F for <websec@ietf.org>; Sun, 15 May 2016 13:32:16 -0700 (PDT)
Received: by mail-wm0-x234.google.com with SMTP id n129so79563784wmn.1 for <websec@ietf.org>; Sun, 15 May 2016 13:32:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rF+WOOCrLwseu7+/+jO5fRCPA7n8gMFKBwahDv1foZE=; b=xY06pLvjo3PgrLE+1dqtGpja4yHhM0njUNe+gvfWOHoJv+QTFIfHq6feruCb45+skv dtz8aCNPLF9vOu6nKKBHcPmC7xQu211oCRHQyJh4nhaZuLut/zByiDQyFVLqFZ50OzK4 +zFEkpNjhEW3b7B5lSVZaKOOaL0JzuCTWh/X8Co90FEfxgDei/GMoMXg3hRBx2ghw3/5 dXeO5XWPIjBI7SWjphAuUhhetvBSRF41YugoOz6X807mvqp4HyKomZad8mRvNh0bhxVo XA1DXYgM5Uqvap7X41LtjaOoLvio7LrU/Iu0Kqlh6iJVzVa7jdkx6f/7uOP5gg8zwgKJ Kovg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rF+WOOCrLwseu7+/+jO5fRCPA7n8gMFKBwahDv1foZE=; b=P+JAYcwQ0+Qu1U/zlor3GF67tSzvB9Uqlcq0koWE7NVcrSE8M3lM3BsIuYY8MXLFX3 QgHj5ifUdPPDSKU6Q6Jp1tR03Rvf9mHTXny5qI/PmbrG16zMDskI+Gz091LQ/qZaAv5z UvZebcKee7e7wVDqG9Qd8dOPNNVq7mn0B/SGGdS7/ZW2Gnpjz6zhOkObzP+frf1FoLPE 4sDY3BnhkirgMJg0NhjX87VUCKA5sgUVg6bKWy6buZOw0zEEMh83WxA4Gdzg+2br/oz0 WugAg42i/8MLTCOQAzx28qdTWuSg0TPxm8vEvvbdfIUaVtVdqJxEt1uI+Zf+SR3rJQea GkAA==
X-Gm-Message-State: AOPr4FVcTSQcr/JzyKGJD4tQIaznDsG3WcIrP0JPFyqUkJYNovcAWyKyR2VNdNVrN+PBHg==
X-Received: by 10.28.125.138 with SMTP id y132mr14117352wmc.90.1463344334720; Sun, 15 May 2016 13:32:14 -0700 (PDT)
Received: from [192.168.1.12] ([46.120.57.147]) by smtp.gmail.com with ESMTPSA id jp2sm30172603wjc.16.2016.05.15.13.32.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 May 2016 13:32:14 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Yoav Nir <ynir.ietf@gmail.com>
In-Reply-To: <5738D403.5010000@gmail.com>
Date: Sun, 15 May 2016 23:32:11 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <F427E238-A162-4617-9D3F-DC371120F0D8@gmail.com>
References: <CAME=j1=QZTFdxaMQ=_Egy296zhAiL--2hcW0_nc-3BLgz7z9XA@mail.gmail.com> <2133CA94-B702-4A6C-BB79-01B773762168@gmail.com> <5738AD77.6060509@gmail.com> <EB5F3822-264B-4570-B5B4-39E0DB914358@gmail.com> <5738D403.5010000@gmail.com>
To: Yaron Sheffer <yaronf.ietf@gmail.com>
X-Mailer: Apple Mail (2.3124)
Archived-At: <http://mailarchive.ietf.org/arch/msg/websec/iPs1JrnGPVT0YlwgFRrfefoM-Z8>
Cc: websec@ietf.org
Subject: Re: [websec] HPKP & different encodings of the same public key
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Web Application Security Minus Authentication and Transport <websec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/websec>, <mailto:websec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/websec/>
List-Post: <mailto:websec@ietf.org>
List-Help: <mailto:websec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 15 May 2016 20:32:18 -0000

> On 15 May 2016, at 10:54 PM, Yaron Sheffer <yaronf.ietf@gmail.com> wrote:
> 
>>> On 15/05/16 10:22, Yoav Nir wrote:
>>>> That’s interesting. With HPKP you can pin keys from existing certificates, or keys that are not (yet) in certificates.
>>>> 
>>>> One of the early deployment scenarios (which got de-emphasized later on) was that you include two pins: your current production key and a spare key that you will certify if something bad happens to the production key (like the private key leaking out).
>>>> 
>>>> 
>>> Hi Yoav,
>>> 
>>> I had assumed this *is* the main deployment scenario. If it was de-emphasized, what do you consider as the "classic" HPKP usage scenario?
>> 
>> Current certificate plus some CA certificate that you are likely to use to certify your next certificate.
>> 
>> Yoav
>> 
> 
> But this too means that you're guessing how the CA will behave in the future. If your current cert is expiring in a month and you generate the new one, you can be surprised by the CA using a new intermediate cert.
> 
> And of course, some people would never pin to a CA cert. To me, the whole idea of certificate pinning is to reduce the need to trust the PKI industry, and that includes my own friendly CA.

I agree. Appendix B of RFC 7469 recommends to have the backup pin signed by a different CA and ready to use. That solves the issue of not knowing how a CA might encode the SPKI. It used to be a costly solution, but these days a certificate is pretty much free, so you really can have a backup certificate ready to use.

Yoav