Re: [Spasm] certspec work (draft-seantek-certspec-06.txt)

Sean Leonard <dev+ietf@seantek.com> Thu, 23 June 2016 00:40 UTC

Return-Path: <dev+ietf@seantek.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5A8B612DE01 for <spasm@ietfa.amsl.com>; Wed, 22 Jun 2016 17:40:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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 Qvm1JpgBHc9C for <spasm@ietfa.amsl.com>; Wed, 22 Jun 2016 17:40:45 -0700 (PDT)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C0DA912DE29 for <spasm@ietf.org>; Wed, 22 Jun 2016 17:40:43 -0700 (PDT)
Received: from [192.168.123.7] (unknown [75.83.2.34]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 6E2B6509B6; Wed, 22 Jun 2016 20:40:42 -0400 (EDT)
To: Wei Chuang <weihaw@google.com>
References: <20160608161629.19935.86198.idtracker@ietfa.amsl.com> <f7c50b01-9d68-11ac-c343-9ffff7dbf143@seantek.com> <CAAFsWK1C4n-9rx+zCr+ig6of3XA=shE1HnvkTyJ6wfVp=BOJPw@mail.gmail.com> <ad9589bf-1e63-cb93-4ed9-613e7299a53c@seantek.com> <CAAFsWK0btFp4N3q_WYV0_snvWh6CO-HEBhPqDy=tCfJ6WY4ovg@mail.gmail.com>
From: Sean Leonard <dev+ietf@seantek.com>
Message-ID: <74ff1afa-2edf-0868-7d34-e8675be4511b@seantek.com>
Date: Wed, 22 Jun 2016 17:40:37 -0700
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
MIME-Version: 1.0
In-Reply-To: <CAAFsWK0btFp4N3q_WYV0_snvWh6CO-HEBhPqDy=tCfJ6WY4ovg@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------7CEFAAB3FDAD4FF85871C15E"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/ObhHBpyCZ1jE4Wp73q2_DVofQAo>
Cc: spasm@ietf.org
Subject: Re: [Spasm] certspec work (draft-seantek-certspec-06.txt)
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Jun 2016 00:40:47 -0000

On 6/15/2016 2:21 PM, Wei Chuang wrote:
>
>
>
>>     4. Another naming method I'm aware of is CRLSets used in
>>     Chromium: https://dev.chromium.org/Home/chromium-security/crlsets
>>     <https://dev.chromium.org/Home/chromium-security/crlsets>
>>     This might be something to consider and possibly mention in
>>     section 6 "Other Certificate Specifications".
>
>     Wei, can you provide more specifics on what you mean when you say
>     "another naming method": do you want a way to identify CRLSets, or
>     are you asking for documentation on how CRLSets identify certificates?
>
>
> This is another technique for identifying a certificate.  I point it 
> out for completeness in case its useful.  I believe its advantage is 
> that its supposed to be compact, and general.
>
>
>     I am only somewhat familiar with CRLSets, but I was under the
>     impression that an entry in a (the) CRLSet identifies a
>     certificate by one of: SHA-256 fingerprint, SHA-256 hash of the
>     public key (SPKI), or SHA-256 hashes of one of the former two
>     split up into a Merkle tree.
>
>
> I believe its simpler than that.  Its the SHA-256 hash of the issuer 
> SPKI and the certificate serial number.  I don't recall it being tied 
> to Json (but I could be wrong).

Hello Wei, I wanted to follow up on this. I am willing to write in a 
spec that includes the hash of the issuer's SPKI.

It will look like:

ISSUERSN:SPKI/SHA-256:3434ABAB..00DA;04FDBDA0

namely, the issuer part will be of the form "SPKI", a slash, and the 
hash name. This preserves algorithm agility, and is syntactically 
distinguishable from the LDAP string encoding.

Compare with:

ISSUERSN:O=DigiCert,ST=UT,C=US;04FDBDA0


The question I would like to pose is: does Chromium or some other 
implementation actually index certificates based on the issuer's SPKI 
hash, followed by the serial number?

The other certspecs (well, most of them anyway) are intended to be 
indexes or keys in a database or other lookup system. There are known 
systems that index by SHA-1 hash, by issuer + SN, etc. (as has been 
previously discussed). File paths are obviously indexes. Notably, pretty 
much all of the certspecs in draft-06 are based on data in the subject 
certificate, or operatively associated directly with the subject 
certificate (e.g., file path). The issuer DN is present in the subject 
certificate, so it is "direct" (no certificate path building required). 
In contrast, an arbitrary verifier has to perform several steps:
1. hunt for the issuer certificate based on the SPKI (hash)
2. extract the issuer DN(s) (there could be multiple issuer 
certificates, e.g., certificate rollover. Clearly not key rollover)
3. then run the algorithm as if ISSUERSN: is specified with the issuer 
DN(s) rather than the SPKIs.

This seems sub-optimal to me, unless the implementation is truly 
indexing based on the hash of the issuer's SPKI, and has some live or 
precomputed table that keeps the issuer's SPKI and certificate(s) together.

I would appreciate some citation to the Chromium source code or writeup, 
regarding how Chromium keeps track of certificates.

Sean

PS An implementation could index certificates purely based on 
serialNumber, and then sift through all matching certificates by 
comparing issuer DN(s) and/or issuer SPKIs. Assuming that serialNumbers 
are supposed to be relatively large and random, this will be pretty 
efficient.

PPS If I enable this, I will also enable SPKI specification in 
SUBJECTEXP:. However specifying the hash of the subjectPublicKeyInfo is 
"direct" because the SPKI is contained in the subject's own certificate.