Re: [lamps] struggling with CSRAttrs

David von Oheimb <David.von.Oheimb@siemens.com> Thu, 04 August 2022 12:31 UTC

Return-Path: <david.von.oheimb@siemens.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 E8FCDC13C50C for <spasm@ietfa.amsl.com>; Thu, 4 Aug 2022 05:31:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.391
X-Spam-Level:
X-Spam-Status: No, score=0.391 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SCC_THREE_WORD_MONTY=2.497, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=siemens.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kg15LmfBGco5 for <spasm@ietfa.amsl.com>; Thu, 4 Aug 2022 05:31:32 -0700 (PDT)
Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80079.outbound.protection.outlook.com [40.107.8.79]) (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 3E02DC14CF0A for <spasm@ietf.org>; Thu, 4 Aug 2022 05:31:31 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dtypXVzgGYk9WzZvvRiQhVidDeVCw1UcTV53tDQhb1sYRJISBTE13Zado4RLGwD2Kuo0aIjWvS+s0MGc9zuGPLwQAl4lmNybn7YMV4hdvZU7OeFmGvZFNYukx7d7JuFalgjU/98ULSdadkvwBYypyDj8b4NxE1rJHZAZbx0szbWM9BPd8lOq9jVbaYxEm4VMAdd97ElkwSFLVjUczI29zwDwmduJrRtp11Ka11oTR1W236gCHeHIDMbmi6GvY9DZrqVEWLWvQBLPhgOTi2vit9LYLL1HFmH7BmoFMcmyC4d45ROqjAurWxPwGyBhADDRISW80rgXflme9yWC91kG4A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qOK8lQeTTRS9h/1WZFrbyndN2E8Ie3voqJBWorl19d8=; b=aBsOdi3ZPb8i7dd2Q9wIhKg9SpsXhkGTgc+sxGfnXhJbyoQ8W7pWhUC/1UaSFzzn7Wyu5st1NfyLOXRnv6vhc94rqhw/XlT4RxSEJVzMxF3pUv7OEtotCfdsXx99YOC0b8bwTKhEpMRhTjTTCmNgUGFTwFhKhm3tdu8pD3KthhaLHILSn6Q3gbcWINC4GFt0d7St77h5gq8lNJ/rsyF9AUYRdcIr7l6IhC67VdglnWX3fZ4kBoge/EFPltZVLXxFHHYn7GE3mKBT5vF4Bkvcc6CZRmqBiQzc6kwfpbJoQw8CSfezMVeiOebH5rgtx4r6S7iF3fsL2knmv2sd0LpKEg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qOK8lQeTTRS9h/1WZFrbyndN2E8Ie3voqJBWorl19d8=; b=Broj6P+Ced0RMfyvHgEQVc5f8vOJMNtuYeKvXOL1fiHWnxQDmL9RLBkS5TMacIXJtIjpg0w2SKwVIX08e9OYRKyrbMng7tk6KWZlTnwqleIIQ8jQ/9YtJSIa2lIICk0edOWZ+x20+KFaq8bJgaHgk1KyPLcfCKBL/sLhmKW4rgg5+QVakZfs0ow3QlBTw7uFTg73/N069S10TOafJMuBg7LTRl7T0R+UfbhKSBisDK8OB6E6qyFFt2qXUAoHlXpuYTm7uM3KxaAev1zuOh+parr1fkBTyP4ygquO19KgzF3NnPlJskBKHquxvm+o7qGC82D3zvPkc9Rc16isJssetg==
Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com;
Received: from DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:398::20) by DB9PR10MB4427.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:22f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 12:31:27 +0000
Received: from DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM ([fe80::d812:1924:5b55:5f81]) by DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM ([fe80::d812:1924:5b55:5f81%7]) with mapi id 15.20.5504.014; Thu, 4 Aug 2022 12:31:27 +0000
Content-Type: multipart/alternative; boundary="------------lfrsQNP002WAyi4VsUzvxplf"
Message-ID: <399c3a1e-ee28-cc85-6e6a-cee210e70753@siemens.com>
Date: Thu, 04 Aug 2022 14:31:20 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0
Content-Language: en-US
To: Michael Richardson <mcr+ietf@sandelman.ca>
References: <12352.1657505901@localhost> <ada963a796ca3fafb42a29751020ff4326fd2a1e.camel@von-Oheimb.de> <563732.1659120308@dooku> <36c409c2-ab92-4ec2-6f1e-235652a243d9@siemens.com> <3758.1659557693@localhost>
From: David von Oheimb <David.von.Oheimb@siemens.com>
Cc: LAMPS WG <spasm@ietf.org>
In-Reply-To: <3758.1659557693@localhost>
X-ClientProxiedBy: AS9PR04CA0138.eurprd04.prod.outlook.com (2603:10a6:20b:48a::18) To DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:398::20)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 02e389dd-03f2-4366-e612-08da76154094
X-MS-TrafficTypeDiagnostic: DB9PR10MB4427:EE_
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: gxwXV/JBMoeU+g0mp4Z6mva7JYtCr/JgSOCWtn2qpHl02vQ6s0R3pJM0RM77LJHgwCSNUn6AAKe+/AWDBVQjWeSBa9jOdB5j8jteO6HdjH/US+verh06ii8nuGAw9p4ds13GHNyyNgPs4cnG2RoUR3SN7i1nBk1rqscUp+hVP1ZcIxexgk0tfKUEsUXKLKYmvW+7WV5sb2pb/W59nvYQLd3ucZkbbU2x97aHTz5rFKp/Ty/T8354nT7He5536cIcEOFNG3rWsKVZjMMq9h1bG5ws0m6F6smr68oZ6/3j94qVe4kwJsfizOUEXrZ911ps9Zi4Q/2oaAb3UlGTn8701629EU2+/Yy7R6bdV51wRwdEJ8hi9Wu3Fm/Z2ifuTEoeUpAWIAdc21K84eaeZaDMq3RsGkmlBxy3xN2W4xNQHAypLRYIMVQFF9M+UCLvzJGJ7xu7ptHl1KitgGCe5JybmL2GI8jLRemInV2GPu6zmOlg55MJf4czWWDXczqthW+OxjfA375yYTppdsJyKsdBn2/CVM6gtZH0gVxReqqNR0ZGrJKa2AQdBOEnNqW63AzTLqIjsjouq13/QoH9dbX71N1HBGUTRfJLZFO7PyM5/01ttlCYZJyU9p6I2jVJY9lTR5qJYYe+QoKRgWdJJtSp6qc//c4hzf+2TpQW2ZQTTTq74w2+OU9FdYQ9cg5/+F9UIyMUpRq/YC5mLc0yttq0udaXQaxYHpJqDuV6602HGHQrJNE44CG6eQRnF265hxZVkdq8BZghvkysGrjlyUcf6TwgOzdBp8O3leReIBTPMPRLT6UxEJipvMwrEERVW8KR6INXM93vd3KrFYZTFKRcJxgqet5Qphpj2RZVbXlhRo1f3LhpsdvxuEkm9PqRBFzRjxQ2k7KppCZSrbWpRV5JxA==
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230016)(4636009)(366004)(136003)(376002)(396003)(39860400002)(346002)(4326008)(8676002)(30864003)(66556008)(66476007)(8936002)(36756003)(66946007)(41300700001)(5660300002)(6666004)(33964004)(6506007)(26005)(186003)(53546011)(6512007)(478600001)(2616005)(6486002)(83380400001)(316002)(86362001)(38100700002)(2906002)(31686004)(31696002)(166002)(82960400001)(966005)(43740500002)(45980500001); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: KhZYi43ATnfOd9vRD0c+bu8Kmh/eSe5dO4tkoBrSgciSpbNuUNWca151YDta9CYtqfKW0qZoZtDE7tKrj2lk40V3g/ANsbJsS7ZyOxM58O8WQ50KW99nJt/bHekGJJVh3Z0ejVFnrWFJz95ROTQT+pYXwiLJTHbp2Uz5xk40gw5UTyJ+7+Iih1/54qDNV51sChahGXKYnXq0yoP4iwWMNvRyyDTi7ORABY7tVG8ihIwV/+qd3nFihd+7lBsIydn8dGcDLxVfBByqyPGmlYEMAyaJghMLpDKIn0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mWRto41z7QHD3qMnimHqYUqMNrl04N4rpjMY15WD/Ih5QHdVK7/woNjevYQTXEzyLphMAau1YNJkfiGwoNbrhKqIIRR3hPoTC7HMlBxUnE3iOnVcgIWBojEKmQbj/1C9bpKnIxQa5YDkZKMIYqQP7GDatSyHYepZxvP3JdJWaNuMVZdevh+IIovLCSeUwGDXMww7DC1NmOehsLghee7NoXOGkniNjaxJgEumTab4NzQ7Ji3C5eahCbyVVA18W7c0kR4GM=
X-OriginatorOrg: siemens.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 02e389dd-03f2-4366-e612-08da76154094
X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 12:31:27.7330 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 056i2di3SzMwO/b7SGxLwYeIHQiPWDTfH244k5ldzwA9fBtrIkplA4rkpMmAEQRWmNREcKW77AT3Fe3Zh8Hqq35l5YU8yjcsmi1U59V28Rk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR10MB4427
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/-ymZk94KFzzolZSsJh6HONnypXQ>
Subject: Re: [lamps] struggling with CSRAttrs
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.39
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, 04 Aug 2022 12:31:37 -0000

On 03.08.22 22:14, Michael Richardson wrote:
> David von Oheimb<David.von.Oheimb@siemens.com>  wrote:
>      > Let's keep the original field names.  Also because this underlines the
>      > important fact that we do not change the ASN.1 syntax at all, which is
>      > critical for bits-on-the-wire compatibility, but we just clarify its
>      > use and interpretation.
>
> I'm okay with that.

Glad to hear.

>      > I've just made a pass on lamps-rfc7030-csrattrs.mkd in the GitHub
>      > repository.  Its new version contains various suggestions for
>      > improvements here and there.  Also updated the subjectAltName example
>      > to be of the more usual form of a dNSName and inserted two
>      > questions/remarks:
>
> Why did you change the RFC8994/ACP example from a real acp example name to domain.example?

I did so because I did not pay attention that this SAN example had 
special relevance,
but also because its ASN.1 encoding was flawed:

  31  59:           [0] {
  33  57:             UTF8String
        : 'rfc8994+fd739fc23c3440112233445500000000+@acp.ex'
        :               'ample.com'
        :             }

and because the dNSName variant is much more common.

So I've just re-added the otherName variant, while correcting its ASN.1 
encoding
and keeping the other SAN that I had added, with a dNSName value:

         SEQUENCE {
           OBJECT IDENTIFIER subjectAltName (2 5 29 17)
           BOOLEAN TRUE
           OCTET STRING, encapsulates {
             SEQUENCE {
               [0] {
                 OBJECT IDENTIFIER '??? TODO'
                 [0] {
                   UTF8String 'fd89b714f3db00000200000064000000'
                              '+area51.research@acp.example.com'
                   }
                 }
               [2] 'domain.example'
               }
             }
           }

Note that the otherName choice is defined (e.g., in 5280) as

    OtherName ::= SEQUENCE {
         type-id    OBJECT IDENTIFIER,
         value      [0] EXPLICIT ANY DEFINED BY type-id }

so you need to include an OID in the 'type-id' sub-field that gives the 
specific SAN sub-type,
governing the interpretation and type of the 'value' sub-field.
I could not find any such OID in 
https://datatracker.ietf.org/doc/html/rfc8994#section-6.2.2
which says (among others):

>     Example:
>
>     Given an ACP address of fd89:b714:f3db:0:200:0:6400:0000, an ACP
>     domain name of acp.example.com, and an rsub extension of
>     area51.research, then this results in the following:
>
>       acp-node-name      = fd89b714f3db00000200000064000000
>                            +area51.research@acp.example.com
>       acp-domain-name    = acp.example.com
>       routing-subdomain  = area51.research.acp.example.com
>
>     The acp-node-name in Figure 2 is the ABNF definition ("Augmented BNF
>     for Syntax Specifications: ABNF" [RFC5234  <https://datatracker.ietf.org/doc/html/rfc5234>]) of the ACP Node Name.  An
>     ACP certificate MUST carry this information.  It MUST contain an
>     otherName field in the X.509 Subject Alternative Name extension, and
>     the otherName MUST contain an AcpNodeName as described in
>     Section 6.2.2  <https://datatracker.ietf.org/doc/html/rfc8994#section-6.2.2>.
(BTW, there is an erroneous self-reference to Section 6.2.2 within itself.)
In this section I miss a definition which OID(s) to use for 
acp-node-name etc.

> Is there a reason not to include the line numbers from dumpasn1?
Actually there are two reasons:

  * those numbers are byte offsets and lengths, which are not important
    here and just add clutter
  * the numbers would be very cumbersome to keep consistent when
    adapting the example

> In the actual content, it goes from having the critical value shown, to
> having:
>
> +        OCTET STRING, encapsulates {
> +          SEQUENCE {
> +            [2] 'domain.example'
> +            }
> +          }
> +        }
>
> which I don't understand at all.  Is this a different dumpasn1 version?
No, the 'critical' bit is before the 'value' field,
thus it is shown just above the "OCTET STRING, encapsulates {"


> if not, what are the actual bits on the wire changes?

The tag "[0]"  that had been placed with the 'critical' bit was wrong:

           [0] {
             BOOLEAN TRUE
             }

so I corrected this to

             BOOLEAN TRUE

See also the emails by Corey and me in this thread of Aug 2nd.


>      >    (TODO: Do we want to allow an empty extnValue (which is of type
>      > OCTET STRING), which would mean that the client is told to include
>      > an X.509 extension of the given type and fill in the concrete value
>      > itself?)
>
> Yes, I thought we allowed exactly that before, as:
>
>           Attribute:  type = extensionRequest (1.2.840.113549.1.9.14)
>                       value = macAddress (1.3.6.1.1.1.1.22)
>
> in RFC7030.

Good point that this effect could already be achieved by such a type of 
CSR attribute
that is different from the "new" approach using a CSR attribute of type 
extensionRequest.
Yet IMO the new approach is more adequate because there the (request for 
an) extension
is in the context of the extensionRequest attribute, rather than "out of 
place" in some other attr,
where its OID is harder to understand and to process without this context.
So I'd suggest stating that any such to-be-filled-in extensions SHOULD 
be placed inside
the CSR attribute of type extensionRequest with an empty OCTET STRING as 
the extnValue.

>
>      >    (TODO: Note that this mechanism does not support telling the client
>      >    to include in the CSR a specific subject DN, simply because there is
>      >    no OID for this.  I think we should better make this clear, or we
>      > have to define such an OID if setting a subject name should be
>      > supported.)
>
> I don't understand.
> Telling the client to include a specific subject is exactly the problem we
> are dealing with... or are you making a distinction here between subject DN
> and subjectAltName?
>
There is a clear distinction between

  * a cert/CSR subject, which is (essentially) mandatory and is a
    (Distinguished) Name and
  * the Subject Alternative Names (SANs) optionally given as X.509
    extension values.

as can be deduced also from the following declaration from RFC 2986 
(PKCS#10)

    CertificationRequestInfo ::= SEQUENCE {
         version       INTEGER { v1(0) } (v1,...),
         subject       Name,
         subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
         attributes    [0] Attributes{{ CRIAttributes }}
    }

noting that any SANs are (indirectly) part of the 'attributes' field value.

As I wrote on March 9th 
<https://mailarchive.ietf.org/arch/msg/spasm/KSBlnRVVTcgpEAM8eA_uEssHY2I/> 
and April 5th 
<https://mailarchive.ietf.org/arch/msg/spasm/PqCEDBk_Vd59bDDxb7hVDg41PKM/> 
and likely already before,
while SANs can be expressed as part of an extensionRequest CSR attribute,
a regular subject field so far cannot be expressed in a CsrAttrs structure.
This is because no OID has been defined that could be used, e.g., in the 
'type' field of a CSR attribute
and the CsrAttrs structure does not have any other field where a subject 
Name could be placed.

     David