Re: [lamps] [CMP Updates] position of hashAlg in certStatus

John Gray <John.Gray@entrust.com> Tue, 31 August 2021 17:37 UTC

Return-Path: <John.Gray@entrust.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 B163C3A1F0D for <spasm@ietfa.amsl.com>; Tue, 31 Aug 2021 10:37:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.996
X-Spam-Level:
X-Spam-Status: No, score=-1.996 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, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=entrust.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 dQTmelk7X8jP for <spasm@ietfa.amsl.com>; Tue, 31 Aug 2021 10:37:52 -0700 (PDT)
Received: from mx07-0015a003.pphosted.com (mx07-0015a003.pphosted.com [185.132.183.227]) (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 7F42C3A1F08 for <spasm@ietf.org>; Tue, 31 Aug 2021 10:37:51 -0700 (PDT)
Received: from pps.filterd (m0242864.ppops.net [127.0.0.1]) by mx08-0015a003.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17VHWxNL012801; Tue, 31 Aug 2021 12:37:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=entrust.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=mail1; bh=uK6/SVDn643+WXNufRAN1vrW5/GCm1BnNyG1SXamJjo=; b=DvHNFvz1BPfyN+kMVFIWDTz9wq9o9W2heNE0l1ABweu3AQsA7jL9bjhz2JWUDNp8EW2w cJ1HEcOWJVNhlbHT/4nWs1GWZ+/zDTX1xhpT1UT/m3WjZnMoC1WPN1fIliczzR9qmWDp CqHa/7PUHAy9kN1wzpiHk3LnkYrchgsq046AIwxeZpk8xzly58fE+FcWzu/RHjGsJ+hn OdF+sTzZxDmvOFlTTVVeZR7lrHLymXK5JEr6TeqzMO8nz5aeIRa4DFjd4SUXcE2z8eFp AZa8UJG0gYth74+yiOSPDzELFcj88MjZbaO3NE3RnWSsFshNH3RZyPfjS0eoZ3f4Je1/ jQ==
Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by mx08-0015a003.pphosted.com with ESMTP id 3as4mhtuh7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Aug 2021 12:37:47 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cd84RTgzJgi7XU8MyRMZq7TkQZeGRVQzF9kZg3pcNSQjOM8JYLpoHLoDekBPyCj0U5ViyqnYWp6II6OludIGwi69poCeRoUJduauqk+zy7hknx3vwlWkt4s6zr7XohyLnX8HkUaqGyjS0IVp+VDUD7An6g0wlzKJ3z5IXj64c2Akr5HSjfoH2qNOP+PM1p0JNprJEKZ51djjdmaO0YkdO9jvRkSU2VZQsQDK0d3TTIgKD0j34wx9G42nTo0GRdFn2ImPH/056DkC5mvaqqvIQlwBfPH2DmflmwYkuI3JQK6B6W7NbfxuxtzBYK5HfdJIOQjbz2ETCr9Wtbx+jZ3X8Q==
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-SenderADCheck; bh=uK6/SVDn643+WXNufRAN1vrW5/GCm1BnNyG1SXamJjo=; b=P2pkxBML83x6MHxdErtydyzt9pRw9USdXcj8RAbuhIn4cEE5nob5O6cIIWweUWkp9n51PR9i+Rhdg0B0ACReSz8JUdf4eZF/rccwvqe7Pge3oPhxXmiLaTsD8bpaxzhvmq2McNAtlI7FtZLrrwPXvstyVEWrhl6itXFW/5AP9p1wpN9qLJvi6lMiYFHu0wynRaYAWZXnG5tBN/SwUjexepWfqf4DyLXFJKGofsvlndpVvEaKNFKuWaQnltaNNbledQ2hr3Kv8d90yeCcNB4YzNXpxVyE+UcRJVoxiPCLVWG1aPQUcmO9rnh/U6Wo4MXLfcHrm8QlaTWjYaUpQFH8dg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=entrust.com; dmarc=pass action=none header.from=entrust.com; dkim=pass header.d=entrust.com; arc=none
Received: from DM6PR11MB2585.namprd11.prod.outlook.com (2603:10b6:5:ce::22) by DM5PR1101MB2140.namprd11.prod.outlook.com (2603:10b6:4:51::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Tue, 31 Aug 2021 17:37:44 +0000
Received: from DM6PR11MB2585.namprd11.prod.outlook.com ([fe80::b9a1:6f57:a0c5:88ad]) by DM6PR11MB2585.namprd11.prod.outlook.com ([fe80::b9a1:6f57:a0c5:88ad%5]) with mapi id 15.20.4478.019; Tue, 31 Aug 2021 17:37:44 +0000
From: John Gray <John.Gray@entrust.com>
To: Carl Wallace <carl@redhoundsoftware.com>, "Blumenthal, Uri - 0553 - MITLL" <uri@ll.mit.edu>, Russ Housley <housley@vigilsec.com>, "Brockhaus, Hendrik" <hendrik.brockhaus@siemens.com>
CC: "spasm@ietf.org" <spasm@ietf.org>, "david.von.oheimb@siemens.com" <david.von.oheimb@siemens.com>
Thread-Topic: [lamps] [CMP Updates] position of hashAlg in certStatus
Thread-Index: AQHXnoaWU0zBU7oYqEeABqHjKC/NaquN3huAgAACoRA=
Date: Tue, 31 Aug 2021 17:37:43 +0000
Message-ID: <DM6PR11MB25859D57C167DA35F47D521EEACC9@DM6PR11MB2585.namprd11.prod.outlook.com>
References: <AM0PR10MB24186D6DC7AF50CCC6576D93FECC9@AM0PR10MB2418.EURPRD10.PROD.OUTLOOK.COM> <B0E72BB3-4744-4DC6-869C-F5A6EAE0AE2B@vigilsec.com> <AM0PR10MB2418CD3F8BD68890B1CA6DE1FECC9@AM0PR10MB2418.EURPRD10.PROD.OUTLOOK.COM> <690E4FC1-7D4E-4FE2-83C1-55DB9A62127C@vigilsec.com> <2C38904D-F103-4089-8CAB-B61B1EC9856A@ll.mit.edu> <87B43068-8F7A-484E-8C7C-7C964F125FF9@redhoundsoftware.com>
In-Reply-To: <87B43068-8F7A-484E-8C7C-7C964F125FF9@redhoundsoftware.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: redhoundsoftware.com; dkim=none (message not signed) header.d=none;redhoundsoftware.com; dmarc=none action=none header.from=entrust.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: af6d0703-7586-4eb3-c722-08d96ca60a37
x-ms-traffictypediagnostic: DM5PR1101MB2140:
x-microsoft-antispam-prvs: <DM5PR1101MB2140B43BEF3CD712FB8D0DF2EACC9@DM5PR1101MB2140.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 6MVyNdCfsUqDwyYfIe7Hh/2/rA3no9UJLXKFVbDu4ULt7YqCB2yX7TPlAh7GmCkkL9ya4PXgn3Dfn4L1P4Bzxfp7l3RGK0I2ZJR3wU21++mvNBavt4LwzcHd5+Tu6PY15rVsHM0RTsNks0CQ8FIRHmNkrPsnwPX29/iXAdwXWwcmJXtpwIzm442BML9V+rC3b61JgSe20SXvOGduGrSJ0vYIZYkV9Upi6p4lKgbQxec/K74h81L2n22Z0AXfQsFGD5BoyGdZeSqHTN6R/L9ObsNj1ktmvoeGZfXuun/U4DgU+wZKqLoEPkCO8XeFAsQHtFgmZ8iW4q0tOcDO03Hm8E5gqLRizBsRJ6SpVT/mN+DfsPG+7O3ej3t9tl2jhl48+T9Nl6irTmHr+ny0xyIeT79DT3zjBMb/UkxRq8SVW9bEKp6XaHzbBopmLkL34Qvq6an3XAt5HsdGJugvtDBSy0S0XjAvFzq7j32AJvQkvHLnkuv/dxMPbvfrST4nDKAaWu3sI+eA6rPRf3iLvTFlItClYelMCDH7DHnE5Kau3nx9ch4CjhGMr6uLPfbgUYcirpIJl22+VhHcORUDRwPTPNYv6nePa0uzNZrYUu1mW20NnSwNNqEsHLZeAejbw/SPgnZODxZ9SXvikq5gUMeVsAbVAFFUHHL9Wj02jJl2RtXz2RHHyZ9WiLVAiT1xx4QMwaH+OoA19VuTaKbW5c219HD+xy1eXJr+j+iHZa+bBkceeOIDs5putYA7Ft0YDS1A5eGSjd3nxRGogGuSiUvzxNuIyUF0x2DfrFNHvtVO1T0=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2585.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(376002)(366004)(346002)(136003)(39860400002)(4326008)(66556008)(478600001)(38100700002)(110136005)(966005)(316002)(2906002)(52536014)(54906003)(122000001)(55016002)(66446008)(9686003)(8936002)(76116006)(53546011)(186003)(6506007)(86362001)(83380400001)(66476007)(38070700005)(5660300002)(71200400001)(8676002)(33656002)(166002)(15650500001)(64756008)(26005)(7696005)(66946007); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: L6alpdq/sS5DUD9VF57uFGPvgEGFcfYdE1xF37hEObAIdUhoI2m+8/WfcwPyvAdRXxnluTrLffxHObiXY167YxHGQYp9EcjwW1c40v5NhYBsUbLYgb8VF9zA8BkpNp9pd3rP6W9kiSEWaG+yxaUjbjsPZV9B6JceNHe5fmGkWnDSY+SvrUKoIQX9nPi0CmNk6v9zQL6//s2hOu8YMS9qUhI+Q36yTr+3q90FwbFWnjIc3VNlgMPnxjQRWk94gF13UdnakrhSvKyfHRNertv6Xk3WhV6Rh7RUD5HlYiG05cZO8HfzqODuWuXMxWN65t75iirYZaLiPEkAmrZwA5Yvs+sRsSGYDK6qahwjIyNAkWpVzOVcfo2frKXKWnQ3yfs/qAV0aUNIRdhIEze/T0I0M7VccPrOp3kNQsuQ3P0t23Xl75mYcISVfzLOyaaFpaYnwix3A6AoMRAZCPiLChvKNq97uY+Aie38fyCVKfudIuwEEfIwHeiWOMvNz2hgvjK4VPandZ0V6QHesNmGvakoZTXntKKY8ajD6f1C2/qAux1YJCFweOTYbuhtwui6vDkD4QtS7OGp7xCNr6CRr05bVOAvbpWvDfvE1WzpXKkW3iBhrRKIalg2VTVklOPiNr0oaiE5C1tZWRDCFPmY5F+7vvm9EunvBA5bMU0L94CZRqONWFMPGDf+zctoeNYjzdaqP+nLEpKMUOo3g5aab0KE4vYAjbzS03wOG0DzrZTVm7kggkjTZ6tjoqOU2nXPQEvrsBs6Ht0GUwfGqFPjvUhsAGe82MOolaUN2QFqWSoovtQviTG5+457coupKbeXVJ/nTcKDYI6O/qFrugb1Sw8/mOEvEZhQyIzDwBpo6euknrwSrUukE7eWtYtYr0wX4SCOAJAyy4QUcsu+iwqF/+lgnkoaVKor9Wm+6KAhrF7UtejqTLHMiH6M4oMx4Um0jmFpgEIp/w2ZaZGmNAyx7J/seEFnUMqc3g1u086UywiLFG8B5Hh332WMDOM9OWlk8t4BmQ1NptLq7tsTHj85ya9xECTCjrksasVXr8Q/daU4t59J3Mf7qscl3jR+dmlHplA+udmnzJNRQlQhlrRcutR8Mo2Q6HfQ6ui1XQZtI+fbh2NPIjI7Jj7p+VOYRNUh3UBQ4Hh2nnkqyoIV/3j8v5PMrxqzIPqbzMuazzfHxaK4KQUolspC0nkWFjafvfs66TP1r9GFVPC4eBEYHs2yDNzVYkScWN95r01/W1m+N4R/PofPWUZyakrAOuTPctZw8nh7vNteXL1dgf/NpXk2AS9P+Z0hzHolZCsuz/ww20S60jGIWPrVaR95SzpFQu0bxPxr
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_DM6PR11MB25859D57C167DA35F47D521EEACC9DM6PR11MB2585namp_"
MIME-Version: 1.0
X-OriginatorOrg: entrust.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2585.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: af6d0703-7586-4eb3-c722-08d96ca60a37
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Aug 2021 17:37:44.0994 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f46cf439-27ef-4acf-a800-15072bb7ddc1
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: rLjDiEwSnkGHHLXNibEFY5ueb7apxSd1+9PuJLruLWk9ybVXJIn2ZsyWX/AjpWPs3kBFHgVvS7E+ACznp9bR5Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2140
X-Proofpoint-GUID: 3bNm4-exj6Rh5UJkubuufWqrK17a7h1X
X-Proofpoint-ORIG-GUID: 3bNm4-exj6Rh5UJkubuufWqrK17a7h1X
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-08-31_08,2021-08-31_01,2020-04-07_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 clxscore=1011 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108310096
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/s5JfpdFLoWP_seJmfLTRgS4o7x8>
X-Mailman-Approved-At: Fri, 03 Sep 2021 09:53:10 -0700
Subject: Re: [lamps] [CMP Updates] position of hashAlg in certStatus
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, 31 Aug 2021 18:03:14 -0000

When I made the proposal, I was thinking in terms of backwards compatibility and making it easier for an existing CMP implementation to add the v3 functionality.   I recognize that either way will technically work, and since the tagging is optional in Hendrik’s proposal that would be bit identical to CMPv2 when the hashAlg is not present.   The same is true if it goes at the end since it is tagged and is optional.  CertConf was a new message in CMPv2, so a pure CMPv1 implementation would always fail.  However, it is possible an implementation may have modified a CMPv1 implementation to accept the CertConf which may continue working if hashAlg is at the end if they encounter a v3 server (which may be more desirable that failing and requiring the implementation to be updated).     Also, I was thinking as a CMP implementer, I would only need to append to the end of the parsing logic rather than muddling up the existing logic which may make it a bit simpler to implement (for existing implementations).

So that was my rational for asking the question, but as I mentioned above, either way will work.

Cheers,

John Gray


From: Carl Wallace <carl@redhoundsoftware.com>
Sent: Tuesday, August 31, 2021 1:28 PM
To: Blumenthal, Uri - 0553 - MITLL <uri@ll.mit.edu>; Russ Housley <housley@vigilsec.com>; Brockhaus, Hendrik <hendrik.brockhaus@siemens.com>
Cc: spasm@ietf.org; david.von.oheimb@siemens.com; John Gray <John.Gray@entrust.com>
Subject: [EXTERNAL] Re: [lamps] [CMP Updates] position of hashAlg in certStatus

WARNING: This email originated outside of Entrust.
DO NOT CLICK links or attachments unless you trust the sender and know the content is safe.
________________________________
I apologize for maybe having missing some bit of rationale in this thread, but what is the advantage of moving the hash alg field to the end? It definitely breaks backwards compatibility. What does it add?

From: Spasm <spasm-bounces@ietf.org<mailto:spasm-bounces@ietf.org>> on behalf of "Blumenthal, Uri - 0553 - MITLL" <uri@ll.mit.edu<mailto:uri@ll.mit.edu>>
Date: Tuesday, August 31, 2021 at 12:38 PM
To: Russ Housley <housley@vigilsec.com<mailto:housley@vigilsec.com>>, "Brockhaus, Hendrik" <hendrik.brockhaus@siemens.com<mailto:hendrik.brockhaus@siemens.com>>
Cc: "spasm@ietf.org<mailto:spasm@ietf.org>" <spasm@ietf.org<mailto:spasm@ietf.org>>, "david.von.oheimb@siemens.com<mailto:david.von.oheimb@siemens.com>" <david.von.oheimb@siemens.com<mailto:david.von.oheimb@siemens.com>>, John Gray <John.Gray@entrust.com<mailto:John.Gray@entrust.com>>
Subject: Re: [lamps] [CMP Updates] position of hashAlg in certStatus

Hendrik:

John's proposal compiles.  Your new one does too.

I have a mild preference for John's proposal because the bit on the wire are the same as CMPv1 when the hashAlg field is absent.

For the sake of purity, I would prefer Hendrik’s variant.

Also, I’m not sure it’s good if some of CMPv2 messages parse OK by CMPv1 decoder, and others fail. That’s another argument in favor of Hendrik’s.

On Aug 31, 2021, at 12:25 PM, Brockhaus, Hendrik <hendrik.brockhaus@siemens.com<mailto:hendrik.brockhaus@siemens.com>> wrote:

Russ

Thank you for this explanation.

Would this mean, that Johns proposal should look like this?

   CertStatus ::= SEQUENCE {

      certHash        OCTET STRING,

      certReqId       INTEGER,

      statusInfo [0]  PKIStatusInfo OPTIONAL,

      hashAlg    [1]  AlgorithmIdentifier OPTIONAL

   }

Do you have any preference for the current test or for Johns proposal?

- Hendrik

Gesendet: Dienstag, 31. August 2021 17:12
An: Brockhaus, Hendrik (T RDA CST SEA-DE) <hendrik.brockhaus@siemens.com<mailto:hendrik.brockhaus@siemens.com>>

Hendrik:

David's proposal will not compile.  The OSS compiler produces this error with that syntax:

   line 62 (TestModule): A0100E: Duplicate tag in type CertStatus: element 'statusInfo' (line 61) and element 'hashAlg' (line 62).

   C0043I: 1 error message, 0 warning messages and 0 informatory messages issued.

The reason for this error is that the two optional elements are both SEQUENCEs.  So, when decoding, if only one of the optional SEQUENCEs is present, it cannot figure out which one it is.

The use of the [0] allows the decoder to tell the two SEQUENCEs apart.

Russ



On Aug 31, 2021, at 8:21 AM, Brockhaus, Hendrik <hendrik.brockhaus@siemens.com<mailto:hendrik.brockhaus@siemens.com>> wrote:

Russ

Currently we receive valuable feedback from John Gray on the CMP Updates draft.

One proposal from John is on moving the hashAlg field in the certStatus sequence from the first to the last position. Please see his arguments in this email tread below.

Current syntax:

   CertStatus ::= SEQUENCE {

      hashAlg [0] AlgorithmIdentifier OPTIONAL

      certHash    OCTET STRING,

      certReqId   INTEGER,

      statusInfo  PKIStatusInfo OPTIONAL,

   }

Johns proposal:

   CertStatus ::= SEQUENCE {

      certHash    OCTET STRING,

      certReqId   INTEGER,

      statusInfo  PKIStatusInfo OPTIONAL,

      hashAlg [0] AlgorithmIdentifier OPTIONAL

   }

Davids proposal:

   CertStatus ::= SEQUENCE {

      certHash    OCTET STRING,

      certReqId   INTEGER,

      statusInfo  PKIStatusInfo OPTIONAL,

      hashAlg     AlgorithmIdentifier OPTIONAL

   }

We are uncertain what the best approach from an ASN.1 syntax parsing perspective is. What is your opinion?

Hendrik


Von: Brockhaus, Hendrik (T RDA CST SEA-DE)
Gesendet: Dienstag, 31. August 2021 14:07
An: John Gray <John.Gray@entrust.com<mailto:John.Gray@entrust.com>>

Von: David von Oheimb <David.von.Oheimb@siemens.com<mailto:David.von.Oheimb@siemens.com>>
Gesendet: Donnerstag, 26. August 2021 22:43
An: John Gray <John.Gray@entrust.com<mailto:John.Gray@entrust.com>>

On 26.08.21 11:26, Brockhaus, Hendrik (T RDA CST SEA-DE) wrote:

Von: John Gray <John.Gray@entrust.com><mailto:John.Gray@entrust.com>
Gesendet: Mittwoch, 25. August 2021 18:35
An: von Oheimb, David (T RDA CST SEA-DE) <david.von.oheimb@siemens.com><mailto:david.von.oheimb@siemens.com>; Brockhaus, Hendrik (T RDA CST SEA-DE) <hendrik.brockhaus@siemens.com><mailto:hendrik.brockhaus@siemens.com>
Cc: ietf-hendrikb@h.mailbouncer.info<mailto:ietf-hendrikb@h.mailbouncer.info>; Kretschmer, Andreas (T RDA CST SEA-DE) <andreas.kretschmer@siemens.com><mailto:andreas.kretschmer@siemens.com>
Betreff: RE: [EXTERNAL] Re: CMP Updates and Lightweight CMP Profile

Thanks for the updates.

I continued to review the document today as well.   Here are some more comments:

Section 2.10 -  CertStatus update.  I was wondering if adding the optional tagged element as the last element *might* make a difference:

For now it is defined as:

Replace the ASN.1 Syntax of CertStatus with the following text:

      CertStatus ::= SEQUENCE {
         hashAlg [0] AlgorithmIdentifier OPTIONAL,
         certHash    OCTET STRING,
         certReqId   INTEGER,
         statusInfo  PKIStatusInfo OPTIONAL
      }


I would have expected that adding something new would be added like this:


Replace the ASN.1 Syntax of CertStatus with the following text:



      CertStatus ::= SEQUENCE {

         certHash    OCTET STRING,

         certReqId   INTEGER,

         statusInfo  PKIStatusInfo OPTIONAL,

         hashAlg [0] AlgorithmIdentifier OPTIONAL

      }

If a CMPv2 server received the hashAlg as the last element, it might still work, but would fail in the first case.   However, I know you say if the hashAlg is included then it must use the pvno of version 3, so the order doesn’t really matter.   I just thought that for someone implementing it, it might be a bit easier to check if the tag exists after the existing parsing (at the end), rather than checking if it exists on the first element.  It would mean no parsing logic has to change until it reaches the last element.   However, I suppose the counter argument would be that if hashAlg is included first, but it isn’t supported then an older server would fail faster which is probably a desirable property.

[Bro] This is a interesting point we also thought about. Here are some thoughts we had.
First of all, we think the binary ASN.1 of a certConf message produced by a client only knowing the original cmp2000 without hashAlg does not differ between from a client knowing the hashAlg field, but not using it.
This should be the case when placing the hashAlg field at the first as well as at the last position of the sequence.
Second, we took the OOBCertHash type as an example and therefore decided for placing the hashAlg field also at the first position.
        OOBCertHash ::= SEQUENCE {
            hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
            certId      [1] CertId                  OPTIONAL,
            hashVal         BIT STRING
        }
Third, the hash algorithm OID is required before calculating the hash value. Therefore, it is the logical order to have hashAlg first.
Theses were the thoughts we had for placing hashAlg in the first position, but they are no strict reasons to do it this way round.
I cannot say, if your arguments still hold true from an implementation perspective. @David, maybe you can comment on the more implementation related issues.
I am not an ASN.1 expert, but as far as I understand from using its OpenSSL implementation, it should not make much difference whether to fail earlier or later in case the bits do not fit with the expected structure.
At least for the CMP implementation, which simply uses the ASN.1 parser, there would be no noticeable difference since either the parsing of the whole structure (including its total sequence length) succeeds or not.
If a receiver expects a structure encoded as in CMPv2 but gets an encoding for CMPv3, I think due to the presence of the "[0]" tag, parsing will fail even if the hashAlg fields is at the end with not value being present.
A backward-compatible definition might look like this:

      CertStatus ::= SEQUENCE {

         certHash    OCTET STRING,

         certReqId   INTEGER,

         statusInfo  PKIStatusInfo OPTIONAL,

         hashAlg     AlgorithmIdentifier OPTIONAL

      }
but supposedly we cannot do this because it would be ambiguous whether the optional statusInfo or hashAlg field is present.
To me, the main point is a conceptual one: the hashAlg needs to "seen" before the certHash, so it is logical to have them in this order.
[Bro] I am also no ASN.1 expert, but Russ is. Therefore, I will forward the question to him to get his advice. As statusInfo and hashAlg have different types, it may also work without tagging.

_______________________________________________
Spasm mailing list
Spasm@ietf.org<mailto:Spasm@ietf.org>
https://www.ietf.org/mailman/listinfo/spasm<https://urldefense.com/v3/__https:/eur01.safelinks.protection.outlook.com/?url=https*3A*2F*2Fwww.ietf.org*2Fmailman*2Flistinfo*2Fspasm&data=04*7C01*7Chendrik.brockhaus*40siemens.com*7C143aeb858f18456f4ef008d96c91b913*7C38ae3bcd95794fd4addab42e1495d55a*7C1*7C0*7C637660195485199311*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C1000&sdata=0zVGASW8q0wKP6L3y*2FDbArvhPZfu7N1dddePGJbIfHU*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSU!!FJ-Y8qCqXTj2!LoXbEbIyNev6LwqxU8VE7vr48hf8P9r65NL7ritq1xGlhzX0ww9Z6Z8rGDYc9yQx$>

_______________________________________________ Spasm mailing list Spasm@ietf.org<mailto:Spasm@ietf.org> https://www.ietf.org/mailman/listinfo/spasm<https://urldefense.com/v3/__https:/www.ietf.org/mailman/listinfo/spasm__;!!FJ-Y8qCqXTj2!LoXbEbIyNev6LwqxU8VE7vr48hf8P9r65NL7ritq1xGlhzX0ww9Z6Z8rGOpMzia-$>
Any email and files/attachments transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If this message has been sent to you in error, you must not copy, distribute or disclose of the information it contains. Please notify Entrust immediately and delete the message from your system.