Re: [lamps] is the CSRattr ASN.1 broken or not ... Re: New Version Notification for draft-richardson-lamps-rfc7030-csrattrs-02.txt

David von Oheimb <David.von.Oheimb@siemens.com> Tue, 05 April 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 967EF3A2131 for <spasm@ietfa.amsl.com>; Tue, 5 Apr 2022 05:31:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=siemens.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 Ya-0y4EJZ5Bg for <spasm@ietfa.amsl.com>; Tue, 5 Apr 2022 05:31:01 -0700 (PDT)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::62c]) (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 915AC3A2129 for <spasm@ietf.org>; Tue, 5 Apr 2022 05:31:01 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NRN2tAbjCstB5rdMzKwbMljPnIIQpDbSUvjafk8+Xab9xs6CEEON3ivvVNm39DQiC+MUeRd+rR319pIAozmZpZNa68sn2FvAa6c0IOF9236JqLfiRTDvxQ7m66wsGgBMVEodMtGiqgtPuBLldgwxnrbivFipY5r89qz3WYckWVz4w93UX8pCpn+b2uoLRdKjNf9L0S2YsNrn39ujbqCZ0wWNF/jX86KEsmjGCs9L6eD1y7l4g9aepl/PI3TzFP9KkMLPFuwLzWo3DfHOKhKihA398ZyhlOrhmpA0fxBxlNh8tQmT1c/VbZ9GpA7nq3UcqEVBuaZUN6IyvmBhOiIMWQ==
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=oLAAazIUiT4d1gCHAJQgtSgkF8+44rzB58oVysLxUnY=; b=e7+R+9+almUKHyrzbSVZ+myY5ycXjOMwhpXSl6NsLlswkjCYrbImTWPmd+vyokKkMXgR+Hhap3nwTvdcGEZMYv2aFcp6y3y49ScCj61r+aPmG213+boameqrgwXkODF3Z87Nfw4SY01PgzkUTApWwIVl9V2VB9LLijQ9uDeBP/FbeBSmMWNTeCkP6+ScKsoKOQixWPkRGcqBNzRNFNLJVADYw/ES1AqfTTziElNaHaOAEv7lG34O32WKP0jJmUz7pUyJMqbnIeFB57y4T/T5nrwylxY4g3rRSsOpbagnUm6d5m5EcSI9ZxhzA+JJjtYOxSmY/JONg+MOmwIqzMlhHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.71) smtp.rcpttodomain=sn3rd.com smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); 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=oLAAazIUiT4d1gCHAJQgtSgkF8+44rzB58oVysLxUnY=; b=s3KnGe9tvniYp9lPpusc+7UZAOG6WrmV5Wkgk4fTrdbluftvWD1gQ887P8K5CRsMXNmJ5Sdwp423k9InMMyemiOmxuhCENOTIzlB95h+TJkBL86eNUmFlNdy5FKf49YG5ZVOrgLSsm/rubZfkuPKKU/rwzuTtLqy0qj2k865CFo8PPRhgnsUH4eNlgG+3ONGOxJ0eDc/PqDd46eTPoPCFixI+2inG3fC7AlIH2/oP6wDtYpHuk897fZagvxP4AzLqG3VHw2yj5Ow1yPwyfy8maUpe3q5mSeENZLPU59SkdpPeIU5Kr90jb2FfvMXeW/oBYS8/ofmgoJuPyimBBn8+g==
Received: from AM5PR1001CA0023.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::36) by AS1PR10MB5165.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:4ad::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.30; Tue, 5 Apr 2022 12:30:52 +0000
Received: from VE1EUR01FT075.eop-EUR01.prod.protection.outlook.com (2603:10a6:206:2:cafe::f) by AM5PR1001CA0023.outlook.office365.com (2603:10a6:206:2::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31 via Frontend Transport; Tue, 5 Apr 2022 12:30:52 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.71) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com;
Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.71 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.71; helo=hybrid.siemens.com;
Received: from hybrid.siemens.com (194.138.21.71) by VE1EUR01FT075.mail.protection.outlook.com (10.152.3.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5123.19 via Frontend Transport; Tue, 5 Apr 2022 12:30:51 +0000
Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SKA.ad011.siemens.net (194.138.21.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 5 Apr 2022 14:30:51 +0200
Received: from [139.22.40.199] (139.22.40.199) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 5 Apr 2022 14:30:50 +0200
Message-ID: <5cfb6e20b225da072695a4f13088a8065203ca4e.camel@siemens.com>
From: David von Oheimb <David.von.Oheimb@siemens.com>
To: Sean Turner <sean@sn3rd.com>, Michael Richardson <mcr+ietf@sandelman.ca>, Dan Harkins <dharkins@lounge.org>
CC: LAMPS WG <spasm@ietf.org>, Owen Friel <ofriel@cisco.com>
Date: Tue, 5 Apr 2022 14:30:49 +0200
In-Reply-To: <D095D84D-9633-44BB-AA6F-440B8BC00F68@sn3rd.com>
References: <164667410940.12091.15394112688281514126@ietfa.amsl.com> <15416.1646681868@localhost> <D095D84D-9633-44BB-AA6F-440B8BC00F68@sn3rd.com>
Content-Type: multipart/alternative; boundary="=-IED1HPDopObtvRJL4L4w"
User-Agent: Evolution 3.38.3-1
MIME-Version: 1.0
X-Originating-IP: [139.22.40.199]
X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 8ea45465-1770-4d2d-4258-08da17001f3e
X-MS-TrafficTypeDiagnostic: AS1PR10MB5165:EE_
X-Microsoft-Antispam-PRVS: <AS1PR10MB5165CF1F435261675C690D16D2E49@AS1PR10MB5165.EURPRD10.PROD.OUTLOOK.COM>
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: lq8OT//TytAbr2hmUq4Q0/fauMtpS4vCNOvl9sR7Y86K7M8wx7WTE/Bgqub2i9rNYVIJNx5/1TfQo/y8ppGsIlXndOlcVcqVIMEvrT/xZ0dVw8rF3vXpD7BCgBMASmW2E1ICUbB0U/qophq3Nnfftcn7afvGn8L7CEQ3A5Qb3i1QF/qTT2fQCz9AJSMETbfHt76GqGVLcpwAwtJJoO8xzVn/4M9t+QvChf+w/mmsG5Kmj8rZRYNHRGQ6LLGFaETl0gAbVJk4YOw3hf4XdrhyOwHAUcKzOLwm7x2xpT+dEWcpRGgOqPaDKfxNwjemtgv8EJBgUEjCFLkB4Hz9xm4CUVO35B9kMHEeXXupMGUfHFNiWXv4rlBfh2aDMJDbtwO3bJ757MHV4w9GfZ8CzlygAwLpK9aAOLxhzvNkHMLx7lB61irgcHY+OkjTOSQ1xLMBsYRs7HdB27A+3F7kJSKO03O78LKzmIqLsU3xbspzU6W4FBnsqqHHVM2TScJ3PvZA6b4mknZyKzTuBCYVvkyoG/f8lf8WK3s9jFI0yLMEholO/aLGG6acwq+SACfY6wSZzufQD9IhttiR+BG/vd+lg3msoB+rZWUi2MeGrGOqIWf6sSnOtTYLcbwUQOwG0XKTG20nWqnHjFVqsWV8rmxRF0ejIeYXoU09yGycvvpINOnOUyx4pWIhbaySlxj72RTJu1G2iFpQHJQ8g+weI+02u4DTopGW8jVQ9Q7QH8g955wb644ycyK64ffBVyKXFlmtDDDiQgO9gzPgBVVmme/noVH/59ipQ28PWsJ8Y11xGD/QGL8pzEBy3DIQpBubnR6e
X-Forefront-Antispam-Report: CIP:194.138.21.71; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(966005)(8676002)(4326008)(70206006)(70586007)(5660300002)(2906002)(83380400001)(30864003)(82310400005)(8936002)(33964004)(86362001)(40460700003)(16526019)(2616005)(336012)(26005)(186003)(508600001)(956004)(356005)(82960400001)(81166007)(316002)(16576012)(6706004)(54906003)(19627235002)(36860700001)(166002)(110136005)(36756003)(47076005)(3940600001)(36900700001); DIR:OUT; SFP:1101;
X-OriginatorOrg: siemens.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2022 12:30:51.7334 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8ea45465-1770-4d2d-4258-08da17001f3e
X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.71]; Helo=[hybrid.siemens.com]
X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT075.eop-EUR01.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR10MB5165
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/PqCEDBk_Vd59bDDxb7hVDg41PKM>
Subject: Re: [lamps] is the CSRattr ASN.1 broken or not ... Re: New Version Notification for draft-richardson-lamps-rfc7030-csrattrs-02.txt
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: Tue, 05 Apr 2022 12:31:08 -0000

As I wrote earlier, the way CSRattrs are defined for EST in RFC
7030 section 4.5.2:

CsrAttrs ::= SEQUENCE SIZE (0..MAX) OF AttrOrOID

AttrOrOID ::= CHOICE (oid OBJECT IDENTIFIER, attribute Attribute }

Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE {
type ATTRIBUTE.&id({IOSet}),
values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type}) }

is 

* pretty incomprehensible, at least for ASN.1 non-experts
* very ambiguous: how to interpret bare OIDs and attribute type OIDs
that the server my throw in is not really defined, apart from a few
hints and examples,
  and it is left entirely open which values are allowed for which
attribute type OIDs
* not fully expressive: at least subject DNs (or parts of them) cannot
be specified

Moreover, as recently discussed here again, the example given in RFC
7030 for the macAddress extension was pretty unfortunate in the sense
that
it seemed to preclude the case that an actual extension value is given
by the server, while I agree with Sean that the above weird ASN.1 syntax
should allow for that.


On Tue, 2022-03-29 at 13:31 -0400, Sean Turner wrote:
> 
> So that base64 blob turns into the following (this is not actual
> ASN.1. I trimmed SEQUENCE -> SEQ, OBJECT IDENTIFIER -> OID, etc. to
> make it prettier)
> 
> SEQ (4 elem)
>   OID 1.2.840.113549.1.9.7 challengePassword (PKCS #9)
>   SEQ (2 elem)
>     OID 1.2.840.10045.2.1 ecPublicKey (ANSI X9.62 public key type)
>     SEQ OF (1 elem)
>       OID 1.3.132.0.34 secp384r1 (SECG (Certicom) named elliptic
> curve)
>   SEQ (2 elem)
>     OID 1.2.840.113549.1.9.14 extensionRequest (PKCS #9 via CRMF)
>     SEQ OF (1 elem)
>       OID 1.3.6.1.1.1.1.22
>   OID 1.2.840.10045.4.3.3 ecdsaWithSHA384 (ANSI X9.62 ECDSA algorithm
> with SHA384)
> 
> What I am saying is either:
> 
> a) The PKCS #9 via CRMF extensionRequest attribute should have had a
> properly encoded attribute when it was sent to the client. I mean
> strictly speaking the extensionRequest does include a type/value where
> type=extensionRequest and value=OID for macAdddress. BUT, the
> macAddress attribute also has a type/value that should have been
> included. This is how the attribute is defined (loosely):
> 
>         ( nisSchema.1.22 NAME 'macAddress'
>           DESC 'MAC address in maximal, colon separated hex
>                 notation, eg. 00:00:92:90:ee:e2'
>           EQUALITY caseIgnoreIA5Match
>           SYNTAX 'IA5String{128}' )
> 
> We really shouldn’t have just dropped the value part of the
> attribute/extension carried in extensionRequest.  We could have said
> set the macAddress to “00" and then the client could include their
> actual mac address. But alas, we didn’t.

The question is which kind of values (of type
ATTRIBUTE.&Type({IOSet}{@type}) ) should be given
in case the OID  (of type  ATTRIBUTE.&id({IOSet})) is
1.2.840.113549.1.9.14 extensionRequest:
Is each such value supposed to be 
1. an OID of an X.509 extension, such as 1.3.6.1.1.1.1.22 (macAddress),
without a value, or
2. an actual X.509 extension of the existing type Extension (or
Extensions) as defined in RFC 5280 section 4.1,
    for example the OID 1.3.6.1.1.1.1.22 followed by the 'critical' flag
and its actual value encoded as an OCTET STRING

Note that for syntactic and semantics reasons you cannot have both -
either 
1. the example given in RFC 7030 was correct, then no X.509 extension
value can be given by the server, or
2. the example was wrong, and a value must be given by the server. 
    Yet the OCTET STRING could be the empty string to indicate that the
client should fill in the real value.
    The Lightweight CMP Profile also employs this trick of using an
empty extnValue
    in its section 4.3.3. (Get certificate request template):
 
  https://datatracker.ietf.org/doc/html/draft-ietf-lamps-lightweight-cmp-profile#section-4.3.3

The latter option is obviously more expressive, but note that this
contradicts the example of RFC 7030, 
and thus chances are high that (most) existing EST implementations chose
the first option, which is not compatible with the second.


> b) We picked the wrong kind attribute to request macAddress from the
> client. I cannot remember if it’s supposed to be naming component or
> an actual extension?

Apart from the two possibilities I just gave, I do not see how else,
given given the CsrAttrs syntax, 
one should have requested a macAddress X.509 extension where the value
is to be filled by the client.


> 
> >   As an aside, why can't the RA just rewrite the CSR and include the
> > particular name it wants to impose on the EE? Yes, signature will be
> > wrong but the CA shouldn't care because the RA is vouching for it.
> > Right? Why won't that also fix this problem?
> 
> In most instances, the RA could amend the CSR by adding/changing
> values. The CA would trust a valid sig from the RA to vouch for the
> changes.

As I commented earlier,
PKCS#10 requires a self-signature within the CSR structure, which that
RA cannot provide, so there are basically two options:
* cheat and give a bogus signature to be ignored by the CA, or 
* switch to a more expressive CSR syntax like CRMF, which supports
popo=raVerified
   (i.e., the RA vouches for having checked the original proof of
possession by the client and does not provide a new one) 


On Fri, 2022-03-25 at 07:35 -0400, Sean Turner wrote:
> Sorry if I wasn’t clearer before about a “fix”. I think the examples
> in RFC 7030 could be fixed and maybe make it clear that you either
> send the “oid” if the server is saying hey send me a request with a
> value that you (the client) supply or “attribute” if the server is
> saying he send me a request with a value that I (the server) supply.
> Right now, RFC 7030 s4.5.2 includes an ASN.1 blob for the following
> examples:
> 
>        OID:        challengePassword (1.2.840.113549.1.9.7)
> 
>          Attribute:  type = extensionRequest (1.2.840.113549.1.9.14)
>                      value = macAddress (1.3.6.1.1.1.1.22)
> 
>          Attribute:  type = id-ecPublicKey (1.2.840.10045.2.1)
>                      value = secp384r1 (1.3.132.0.34)
> 
>          OID:        ecdsaWithSHA384 (1.2.840.10045.4.3.3)
> 
> We can expand the examples to:
> 
> 1. Include a challengePassword with a value (caveats included about
> making sure it is protected when in transit) using the Attribute
> option.

It would make little sense for the server to provide a challengePassword
value - this is to be given by the client in order to authenticate
itself.


> 2. Modify the extensionRequest example to include the right attribute
> value:
> 
> ExtensionRequest ::= Extensions
> 
> Extensions  ::=  SEQUENCE SIZE (1..MAX) OF Extension
> 
>    Extension  ::=  SEQUENCE  {
>         extnID      OBJECT IDENTIFIER,
>         critical    BOOLEAN DEFAULT FALSE,
>         extnValue   OCTET STRING
>                     -- contains the DER encoding of an ASN.1 value
>                     -- corresponding to the extension type identified
>                     -- by extnID
>         }
> 
> Where:
> 
> extnID: 1.3.6.1.1.1.1.22
> critical: FALSE and not encoded.
> extnValue’s OCTET STRING is an IA5String.
> 
> This making sense?

Yes - using the existing (Extensions or) Extension datatype does make
sense.
This is one of the two options I also describe above.

 David