Re: [pkix] [Technical Errata Reported] RFC5272 (4186)

"Leonberger, Pierce (US SSA)" <pierce.leonberger@baesystems.com> Wed, 19 November 2014 15:11 UTC

Return-Path: <pierce.leonberger@baesystems.com>
X-Original-To: pkix@ietfa.amsl.com
Delivered-To: pkix@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 200861A0687 for <pkix@ietfa.amsl.com>; Wed, 19 Nov 2014 07:11:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.997
X-Spam-Level:
X-Spam-Status: No, score=-6.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, MISSING_MID=0.497, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.594] autolearn=ham
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 ejqIc9yFaTlc for <pkix@ietfa.amsl.com>; Wed, 19 Nov 2014 07:11:34 -0800 (PST)
Received: from dmzms99801.na.baesystems.com (dmzsmtprelay.us.baesystems.com [149.32.232.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B1D621A0A6A for <pkix@ietf.org>; Wed, 19 Nov 2014 07:11:27 -0800 (PST)
X-IronPort-AV: E=Sophos;i="5.07,417,1413244800"; d="scan'208";a="139558038"
X-IronPort-AV: E=Sophos;i="5.07,417,1413244800"; d="scan'208";a="388919994"
From: "Leonberger, Pierce (US SSA)" <pierce.leonberger@baesystems.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>, RFC Errata System <rfc-editor@rfc-editor.org>, "jimsch@nwlink.com" <jimsch@nwlink.com>, "mmyers@fastq.com" <mmyers@fastq.com>, "stephen.farrell@cs.tcd.ie" <stephen.farrell@cs.tcd.ie>, "Kathleen.Moriarty.ietf@gmail.com" <Kathleen.Moriarty.ietf@gmail.com>, "kent@bbn.com" <kent@bbn.com>, "stefan@aaa-sec.com" <stefan@aaa-sec.com>
Thread-Topic: [pkix] [Technical Errata Reported] RFC5272 (4186)
Thread-Index: AQHQAzw4//YkaEepiE2y4lGTG78ZHZxnViKAgACVdS0=
Date: Wed, 19 Nov 2014 15:11:20 +0000
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E127D2A37BFE@WSMSG3153V.srv.dir.telstra.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.60.93.1]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/pkix/Om3LVRY901trFVd_ncb45h-kjIY
X-Mailman-Approved-At: Wed, 19 Nov 2014 12:21:56 -0800
Cc: "pkix@ietf.org" <pkix@ietf.org>
Subject: Re: [pkix] [Technical Errata Reported] RFC5272 (4186)
X-BeenThere: pkix@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: PKIX Working Group <pkix.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/pkix>, <mailto:pkix-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/pkix/>
List-Post: <mailto:pkix@ietf.org>
List-Help: <mailto:pkix-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/pkix>, <mailto:pkix-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Nov 2014 19:43:58 -0000
X-Message-ID:
Message-ID: <20141119202158.9451.45260.ARCHIVE@ietfa.amsl.com>

James,

Thanks for the reply.   

I didn't fully make my argument and should have submitted this against RFC 6268 and/or 5911.

You are correct the content of "Data" Conent Type can be unstructured; however as you point out the "Data" content type is an OCTET STRING in PKCS #7.    In PKCS#7 SignedData is defined as:

9.1 SignedData type

   The signed-data content type shall have ASN.1 type SignedData:
   SignedData ::= SEQUENCE {
     version Version,
     digestAlgorithms DigestAlgorithmIdentifiers,
     contentInfo ContentInfo,
     certificates
        [0] IMPLICIT ExtendedCertificatesAndCertificates
          OPTIONAL,
     crls
       [1] IMPLICIT CertificateRevocationLists OPTIONAL,
     signerInfos SignerInfos }

   ContentInfo ::= SEQUENCE {
     contentType ContentType,
     content
       [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }

For me the problem starts way back in RFC 3369 when SignedData was redefined as:

SignedData ::= SEQUENCE {
     version CMSVersion,
     digestAlgorithms DigestAlgorithmIdentifiers,
     encapContentInfo EncapsulatedContentInfo,
     certificates [0] IMPLICIT CertificateSet OPTIONAL,
     crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
     signerInfos SignerInfos }

EncapsulatedContentInfo ::= SEQUENCE {
     eContentType ContentType,
     eContent [0] EXPLICIT OCTET STRING OPTIONAL }

In retrospect it probably would have been better to keep the ContentInfo definition from PKCS#7 but use an OpenType in place of the ANY.

In the latest syntax specified in RFC 6268 SignedData is defined as follows:

SignedData ::= SEQUENCE {
     version CMSVersion,
     digestAlgorithms SET OF DigestAlgorithmIdentifier,
     encapContentInfo EncapsulatedContentInfo,
     certificates [0] IMPLICIT CertificateSet OPTIONAL,
     crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
     signerInfos SignerInfos }
 
  EncapsulatedContentInfo ::= SEQUENCE {
     eContentType       CONTENT-TYPE.&id({ContentSet}),
     eContent           [0] EXPLICIT OCTET STRING
             ( CONTAINING CONTENT-TYPE.
                 &Type({ContentSet}{@eContentType})) OPTIONAL }

Within the ContentSet the "ct-Data" object is defined as (note the absence of the TYPE):

ct-Data CONTENT-TYPE ::= { IDENTIFIED BY id-data }

This is really what caused me to question the "Data" content type.  The TYPE for "ct-Data" was probably omitted knowing it would result in an extra OCTET STRING tag for eContent when the "Data" content type is present.  However, omitting the TYPE violates encoding rules for an OpenType.

There may be a clever way to define CONTENT-TYPE and use an OpenType for eContent such that each object determines whether the outer OCTET STRING is tag is to be used.   I'll give that try with our toolkit.

--
Pierce

________________________________________
From: Manger, James [James.H.Manger@team.telstra.com]
Sent: Tuesday, November 18, 2014 6:07 PM
To: RFC Errata System; jimsch@nwlink.com; mmyers@fastq.com; stephen.farrell@cs.tcd.ie; Kathleen.Moriarty.ietf@gmail.com; kent@bbn.com; stefan@aaa-sec.com
Cc: pkix@ietf.org; Leonberger, Pierce (US SSA)
Subject: RE: [pkix] [Technical Errata Reported] RFC5272 (4186)

This errata should be rejected.
When eContentType (or contentType) is id-data, eContent (or content) is an (explicitly [0] tagged) OCTET STRING. The content of the OCTET STRING is the "unstructured data".

The text in the original PKCS#7 spec (eg RFC 2315 section 8 "Data content type") was quite clear:

   8. Data content type

      The data content type is just an octet string. It shall have ASN.1
      type Data:

      Data ::= OCTET STRING

      The data content type is intended to refer to arbitrary octet
      strings, such as ASCII text files; the interpretation is left to the
      application. Such strings need not have any internal structure
      (although they may; they could even be DER encodings).


The subsequent text in CMC [RFC5272] and CMS [RFC3852, RFC5652] is less clear because it does not mention OCTET STRING when defining id-data. Sections 5.2 "EncapsulatedContentInfo" and 5.2.1 "Compatibility with PKCS#7" go to some effort to explain this.

--
James Manger


-----Original Message-----
From: pkix [mailto:pkix-bounces@ietf.org] On Behalf Of RFC Errata System
Sent: Wednesday, 19 November 2014 1:30 AM
To: jimsch@nwlink.com; mmyers@fastq.com; stephen.farrell@cs.tcd.ie; Kathleen.Moriarty.ietf@gmail.com; kent@bbn.com; stefan@aaa-sec.com
Cc: pkix@ietf.org; pierce.leonberger@baesystems.com; rfc-editor@rfc-editor.org
Subject: [pkix] [Technical Errata Reported] RFC5272 (4186)

The following errata report has been submitted for RFC5272, "Certificate Management over CMS (CMC)".

--------------------------------------
You may review the report below and at:
http://www.rfc-editor.org/errata_search.php?rfc=5272&eid=4186

--------------------------------------
Type: Technical
Reported by: Pierce Leonberger <pierce.leonberger@baesystems.com>

Section: 3.2.1.3.2

Original Text
-------------
The Data content type allows for general transport of unstructured
   data.

   The Data content type is used by this document for:

      Holding the encrypted random value y for POP proof in the
      encrypted POP control (see Section 6.7).

Corrected Text
--------------
See Notes

Notes
-----
It's invalid for the encoding of an ANY or OpenType to have "unstructured" data.  See X.690 section 8.15:

8.15 Encoding of an open type
The value of an open type is also a value of some (other) ASN.1 type. The encoding of such a value shall be the complete encoding herein specified for the value considered as being of that other type.

Note there's similar wording in X.209 section 21 for ANY:

21 Encoding of a value of the ANY type
The encoding of an ANY type shall be the complete encoding specified in this Recommendation for the type of the value of the ANY type.

Instructions:
-------------
This erratum is currently posted as "Reported". If necessary, please use "Reply All" to discuss whether it should be verified or rejected. When a decision is reached, the verifying party (IESG) can log in to change the status and edit the report, if necessary.

--------------------------------------
RFC5272 (draft-ietf-pkix-2797-bis-07)
--------------------------------------
Title               : Certificate Management over CMS (CMC)
Publication Date    : June 2008
Author(s)           : J. Schaad, M. Myers
Category            : PROPOSED STANDARD
Source              : Public-Key Infrastructure (X.509)
Area                : Security
Stream              : IETF
Verifying Party     : IESG

_______________________________________________
pkix mailing list
pkix@ietf.org
https://www.ietf.org/mailman/listinfo/pkix