Re: [Netconf] PKCS7 --> CMS

Russ Housley <housley@vigilsec.com> Wed, 07 February 2018 13:31 UTC

Return-Path: <housley@vigilsec.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2F7691205F0 for <netconf@ietfa.amsl.com>; Wed, 7 Feb 2018 05:31:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.394
X-Spam-Level:
X-Spam-Status: No, score=-0.394 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SUBJ_ALL_CAPS=1.506] autolearn=no 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 7f9mlfEnKyhU for <netconf@ietfa.amsl.com>; Wed, 7 Feb 2018 05:31:44 -0800 (PST)
Received: from mail.smeinc.net (mail.smeinc.net [209.135.209.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 29ED3126E64 for <netconf@ietf.org>; Wed, 7 Feb 2018 05:31:44 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by mail.smeinc.net (Postfix) with ESMTP id 0CE153005D0 for <netconf@ietf.org>; Wed, 7 Feb 2018 08:31:42 -0500 (EST)
X-Virus-Scanned: amavisd-new at mail.smeinc.net
Received: from mail.smeinc.net ([127.0.0.1]) by localhost (mail.smeinc.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id q_U797Onbp-I for <netconf@ietf.org>; Wed, 7 Feb 2018 08:31:36 -0500 (EST)
Received: from a860b60074bd.home (pool-108-45-101-150.washdc.fios.verizon.net [108.45.101.150]) by mail.smeinc.net (Postfix) with ESMTPSA id 95E043004AA; Wed, 7 Feb 2018 08:31:36 -0500 (EST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Russ Housley <housley@vigilsec.com>
In-Reply-To: <DD42F58C-DC7D-4414-9CE0-6DEA26DC06EA@juniper.net>
Date: Wed, 07 Feb 2018 08:31:37 -0500
Cc: "netconf@ietf.org" <netconf@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <0136053C-DE4C-4588-A06F-0AE1A29BC83D@vigilsec.com>
References: <8616F4BC-65CE-4187-8135-C5DF4C83D924@juniper.net> <DD343969-332F-46AF-8637-3D5B757B5EB1@vigilsec.com> <939B57F5-C38D-4E95-BDC1-FC01FA06DB97@juniper.net> <46D20605-3B0A-4BA9-8186-625D0FDB9D30@vigilsec.com> <DD42F58C-DC7D-4414-9CE0-6DEA26DC06EA@juniper.net>
To: Kent Watsen <kwatsen@juniper.net>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/9rfzOyEi5tQrwz2n1YV7xnH8fVo>
Subject: Re: [Netconf] PKCS7 --> CMS
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Feb 2018 13:31:46 -0000

I think that defining the two content types would be better.  If you use id-data, then you need another way to figure out what content type is embedded.

Russ


> On Feb 6, 2018, at 8:44 PM, Kent Watsen <kwatsen@juniper.net> wrote:
> 
> Hi Russ,
> 
> Drilling down a little, I can imagine us defining a couple content types:
> 
> 	id-ct-zerotouchInformationXML
> 	id-ct-zerotouchInformationJSON
> 
> But, in both cases, the "content" would be just an octet string (i.e.,
> an XML or JSON encoded document).  In particular, we would not define
> an ASN.1 structure to represent the "zerotouch information" structure.
> 
> Is defining two types such as above the expectation or, since it's
> just an octet string, perhaps we should use "id-data"?  RFC 5652
> section 4 says this about the 'data' type (I added the quotes):
> 
>   "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 could have their own ASN.1 definition or other
>   structure)."
> 
> Or, do you think we should look to do something even more generic,
> such as:
> 
> 	id-ct-YangEncodedData
> 
>      YangEncodedData {
>        moduleName           string        // e.g., "ietf-zerotouch-information"
>        moduleRevision       string        // e.g., "2017-12-09"
>        encoding             enum          // XML, JSON, etc.
>        data                 octet string  // the YANG-encoded data
>      }
> 
> Which would allow for the brokering of any YANG data.  Such a type 
> could've, for instance, also been used by the ANIMA voucher draft.
> 
> Thoughts?  - anyone?
> 
> Kent
> 
> 
> 
> ===== original message =====
> 
> Kent:
> 
> Yes.  This is the approach takes for signed firmware packages in RFC 4108.
> 
> Russ
> 
> 
>> On Feb 6, 2018, at 3:40 PM, Kent Watsen <kwatsen@juniper.net> wrote:
>> 
>> Russ,
>> 
>> I like it.  I didn't know that it was possible to set the top-level content
>> type value like that.  Is the net-result still considered a CMS structure?
>> 
>> Thanks,
>> Kent
>> 
>> 
>> ===== original message =====
>> 
>> I suggest that ContentInfo is always present, then for the signed case:
>> 
>>     ContentInfo {
>>       contentType          id-signedData, -- (1.2.840.113549.1.7.2)
>>       content              SignedData
>>     }
>> 
>>     SignedData {
>>       version              CMSVersion, -- always set to 3
>>       digestAlgorithms     DigestAlgorithmIdentifiers, -- Only one
>>       encapContentInfo     EncapsulatedContentInfo,
>>       certificates         CertificateSet, -- Signer cert. path
>>       crls                 CertificateRevocationLists, -- Optional
>>       signerInfos          SET OF SignerInfo -- Only one
>>     }
>> 
>>     SignerInfo {
>>       version              CMSVersion, -- always set to 3
>>       sid                  SignerIdentifier,
>>       digestAlgorithm      DigestAlgorithmIdentifier,
>>       signedAttrs          SignedAttributes, -- Required
>>       signatureAlgorithm   SignatureAlgorithmIdentifier,
>>       signature            SignatureValue,
>>       unsignedAttrs        UnsignedAttributes -- Optional
>>     }
>> 
>>     EncapsulatedContentInfo {
>>       eContentType         <your-netconf-content-type>
>>       eContent             OCTET STRING
>>     }                            -- Contains the content
>> 
>> The unsigned case:
>> 
>>     ContentInfo {
>>       contentType          <your-netconf-content-type>
>>       content              -- Contains the content
>>     }
>> 
>> Russ
>> 
>> 
>>> On Feb 6, 2018, at 11:53 AM, Kent Watsen <kwatsen@juniper.net> wrote:
>>> 
>>> Hi Russ,
>>> 
>>> I'm looking into switching from PKCS7 to CMS change in the NETCONF
>>> zerotouch draft.  This update would be similar to the change to the
>>> ANIMA voucher draft.  However, I noticed that RFC 5652 says in 
>>> Section 5.2:
>>> 
>>> "In the degenerate case where there are no signers, the
>>> EncapsulatedContentInfo value being "signed" is irrelevant.  In this
>>> case, the content type within the EncapsulatedContentInfo value being
>>> "signed" MUST be id-data (as defined in Section 4), and the content
>>> field of the EncapsulatedContentInfo value MUST be omitted."
>>> 
>>> Note, this text is similar to the last paragraph in RFC 2315 Section 
>>> 9.1, though there it is just a "recommendation" that the value be
>>> omitted.
>>> 
>>> This is a problem for the NETCONF zerotouch draft, where we currently
>>> have a PKCS7 object that is sometimes signed.  We choose this approach
>>> because then, in all cases, a PKCS7 object is being communicated.  But
>>> it's no longer allowed in CMS?
>>> 
>>> Questions:
>>> 
>>> 1) Can the zerotouch draft explicitly allow the "eContent" field 
>>> again for the degenerate case?
>>> 
>>> 2) If having a eContent value for the degenerate case is no longer
>>> allowed, can we use it as grounds for not migrating to CMS?
>>> 
>>> 3) Are there any other generic "envelop" structure that can be 
>>> "sometimes signed"?
>>> 
>>> 
>>> Thanks,
>>> Kent
>>> 
>>> 
>>> 
>> 
>> 
>> 
> 
> 
>