[lamps] EST CSR attrs discussion

Dan Harkins <dharkins@lounge.org> Thu, 29 July 2021 18:31 UTC

Return-Path: <dharkins@lounge.org>
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 3AF843A1465 for <spasm@ietfa.amsl.com>; Thu, 29 Jul 2021 11:31:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_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 59EE-w5qbd_h for <spasm@ietfa.amsl.com>; Thu, 29 Jul 2021 11:31:20 -0700 (PDT)
Received: from www.goatley.com (www.goatley.com [198.137.202.94]) (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 705E13A145F for <spasm@ietf.org>; Thu, 29 Jul 2021 11:31:20 -0700 (PDT)
Received: from trixy.bergandi.net (cpe-76-176-14-122.san.res.rr.com [76.176.14.122]) by wwwlocal.goatley.com (PMDF V6.8 #2433) with ESMTP id <0QX00UGUYRG8G7@wwwlocal.goatley.com> for spasm@ietf.org; Thu, 29 Jul 2021 13:31:20 -0500 (CDT)
Received: from blockhead.local ([69.12.173.8]) by trixy.bergandi.net (PMDF V6.7-x01 #2433) with ESMTPSA id <0QX00066NRDV9J@trixy.bergandi.net> for spasm@ietf.org; Thu, 29 Jul 2021 11:29:56 -0700 (PDT)
Received: from 69-12-173-8.static.dsltransport.net ([69.12.173.8] EXTERNAL) (EHLO blockhead.local) with TLS/SSL by trixy.bergandi.net ([10.0.42.18]) (PreciseMail V3.3); Thu, 29 Jul 2021 11:29:56 -0700
Date: Thu, 29 Jul 2021 11:31:17 -0700
From: Dan Harkins <dharkins@lounge.org>
To: spasm@ietf.org
Message-id: <e87a9fef-9e8c-d470-a6dc-77684cac0005@lounge.org>
MIME-version: 1.0
Content-type: text/plain; charset="utf-8"; format="flowed"
Content-language: en-US
Content-transfer-encoding: 8bit
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0
X-PMAS-SPF: SPF check skipped for authenticated session (recv=trixy.bergandi.net, send-ip=69.12.173.8)
X-PMAS-External-Auth: 69-12-173-8.static.dsltransport.net [69.12.173.8] (EHLO blockhead.local)
X-PMAS-Software: PreciseMail V3.3 [210725] (trixy.bergandi.net)
X-PMAS-Allowed: system rule (rule allow header:X-PMAS-External noexists)
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/Rr2H6WNEKeRphQ065sEoQ0rGTac>
Subject: [lamps] EST CSR attrs discussion
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
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, 29 Jul 2021 18:31:26 -0000

   Hi,

   Sorry, I wasn't aware that this issue was being discussed and I wasn't
on the lamps/spasm list. But I'm largely responsible-- i.e. to blame-- for
the CSR Attrs text in RFC 7030 so perhaps I can try and explain.

   The intent of the CSR Attrs request is for the RA to ask the client
to construct the CSR in some particular way, not to impose values on
particular fields.

   As a for-instance, the RA could ask the client to:

    1. generate a public key in the NIST p384 curve;
    2. use ECDSA w/SHA384 to sign
    3. include the challengePassword
    4. include an extension with the device's serial number, a subject alt
       name, and its favorite drink

by sending the following base64-encoded blob:

ME4GCSqGSIb3DQEJBzASBgcqhkjOPQIBMQcGBSuBBAAiMCMGCSqGSIb3DQEJDjEWBgNVBAUGA1UdEQYKCZImiZPyLGQBBQYIKoZIzj0EAwM

That gets ASN.1 decoded as:

SEQUENCE (4 elem)
   OBJECT IDENTIFIER 1.2.840.113549.1.9.7 challengePassword (PKCS #9)
   SEQUENCE (2 elem)
     OBJECT IDENTIFIER 1.2.840.10045.2.1 ecPublicKey (ANSI X9.62 public 
key type)
     SET (1 elem)
       OBJECT IDENTIFIER 1.3.132.0.34 secp384r1 (SECG (Certicom) named 
elliptic curve)
   SEQUENCE (2 elem)
     OBJECT IDENTIFIER 1.2.840.113549.1.9.14 extensionRequest (PKCS #9 
via CRMF)
     SET (3 elem)
       OBJECT IDENTIFIER 2.5.4.5 serialNumber (X.520 DN component)
       OBJECT IDENTIFIER 2.5.29.17 subjectAltName (X.509 extension)
       OBJECT IDENTIFIER 0.9.2342.19200300.100.1.5 (favorite drink)
   OBJECT IDENTIFIER 1.2.840.10045.4.3.3 ecdsaWithSHA384 (ANSI X9.62 
ECDSA algorithm with SHA384)

And the client produces a CSR with an extension that gives its serial 
number,
some alternative name, and whatever drink it prefers. The idea isn't 
that the
RA would say, "your serial number is 279372 and you like scotch", it's "what
is your serial number and favorite drink?".

   If the RA wanted a particular length of RSA key, let's say of 3072 
bits, to
sign with a hash function appropriate for that bit length, and include the
challengePassword it would ask thusly:

MCkGCSqGSIb3DQEJBzARBgkqhkiG9w0BAQExBAICDAAGCSqGSIb3DQEBCw==

which gets decoded as:

SEQUENCE (3 elem)
   OBJECT IDENTIFIER 1.2.840.113549.1.9.7 challengePassword (PKCS #9)
   SEQUENCE (2 elem)
     OBJECT IDENTIFIER 1.2.840.113549.1.1.1 rsaEncryption (PKCS #1)
     SET (1 elem)
       INTEGER 3072
   OBJECT IDENTIFIER 1.2.840.113549.1.1.11 sha256WithRSAEncryption (PKCS #1)

   The idea is, this is a request to the client on how to generate a CSR in
the form that the CA expects/wants. One asks what a subject alternative name
would be, it doesn't impose one on the client.

   That was the intent anyway. And that's how I implemented it in my EST
reference implementation.

   regards,

   Dan.

-- 
"The object of life is not to be on the side of the majority, but to
escape finding oneself in the ranks of the insane." -- Marcus Aurelius