Re: [netconf] FIXMEs in ietf-crypto-types and client/server models

Balázs Kovács <balazs.kovacs@ericsson.com> Tue, 12 November 2019 09:10 UTC

Return-Path: <balazs.kovacs@ericsson.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 CB9431201DE for <netconf@ietfa.amsl.com>; Tue, 12 Nov 2019 01:10:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.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 59RnT0kiNlTb for <netconf@ietfa.amsl.com>; Tue, 12 Nov 2019 01:10:53 -0800 (PST)
Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20062.outbound.protection.outlook.com [40.107.2.62]) (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 84B98120046 for <netconf@ietf.org>; Tue, 12 Nov 2019 01:10:52 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DVFZxIgJjhW43HzyhUfviYkrxJJCU6rq5UH7szIGi85P2Ml0C7fP5BG8arwuY9XNIg8bMYt9cKh17bo/InTCNCzjB1joUK6twGzJjE+fXKJErS0kh3eFGoN7twPjJtn6LHItHygWpeD/BsxUQ6UZc1Wwtry0LeLVTpSzeDZmCWaZ5zNqEmqu/eO+wwxcQSY3NiGQTKQzaPn6C6KKstF6AgW6TNaZa89W5CmneiXPdeCxo5VU1GsMlYeghRZkdbq1a/CjXHK5eM50xK7bBeezaxdSjv10hHZWvJHA+M1jha7HiKWikKQRMxSpLdm5QIhRnigB2aerISiumnYKeOOIvQ==
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=g1nT3XzK6dCDG/RQVjS9tI3uhmqxJGhPFfhwpe8JpXk=; b=jzE/JFGeWrjb6Xkl1NNm344MKN5xBauGUUuVFgXUk89r7vSNkXYEo8B5Vp+hQjWLHE6W4bYM0N7xC5i7dvfU45vbCyRZQzT2ND/hqWWQYro7keJwrUVXBoADidPLUPixgTvAW+5PZfE+9e6OckCyHIYAWbgEhQqfS0ni8GN/Y9/zE20fED/+Ytqgpr59G1l5fQDhgQoI9TCXtTSVaKRIZZG+wh2HV5j6CB00YucF1cB9Q/vsp1XfHXsw/OGwX7aJFF9huv53jMBdgSW1MdYpIZD4V4t/wB89RQfA0XCoW4f8tJ0IqErSgEoFO9cDMSWWNbkSMSH1izALmICzVMZVVA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g1nT3XzK6dCDG/RQVjS9tI3uhmqxJGhPFfhwpe8JpXk=; b=aHwl0G0fPrS8xffwXIkEsF3LV3O3Lj8lYSM1FOXlu2JjsDvkNgkVkm1GpXEPIv/Uo62bi8qsGvOo/MWFHaJoMprt1pf0WExm+Bx8akKH2xZ58cb0MnTu8I/DM5L7pw6BA+5s9oUEHIym2MwIc+GAMemZbNyGB6+dwYMQGBFIxHA=
Received: from AM0PR07MB5187.eurprd07.prod.outlook.com (20.178.20.74) by AM0PR07MB4753.eurprd07.prod.outlook.com (52.135.150.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.19; Tue, 12 Nov 2019 09:10:49 +0000
Received: from AM0PR07MB5187.eurprd07.prod.outlook.com ([fe80::e485:83e7:ee62:53f8]) by AM0PR07MB5187.eurprd07.prod.outlook.com ([fe80::e485:83e7:ee62:53f8%5]) with mapi id 15.20.2451.023; Tue, 12 Nov 2019 09:10:49 +0000
From: Balázs Kovács <balazs.kovacs@ericsson.com>
To: Kent Watsen <kent+ietf@watsen.net>
CC: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: FIXMEs in ietf-crypto-types and client/server models
Thread-Index: AdWT66zB5kr5iNWxQ6yg/MeI8i6GNgAaO58AABS9kxAA5WCRgAA+4dkw
Date: Tue, 12 Nov 2019 09:10:49 +0000
Message-ID: <AM0PR07MB51870B440CA86FD39E0926C883770@AM0PR07MB5187.eurprd07.prod.outlook.com>
References: <AM0PR07MB5187A1438941A29D28CE3486837E0@AM0PR07MB5187.eurprd07.prod.outlook.com> <0100016e3ed10fbb-8a5a44a9-6df6-4ac1-9b56-8dbf61ec64cc-000000@email.amazonses.com> <AM0PR07MB5187296C56CCE38DADE9EA1483790@AM0PR07MB5187.eurprd07.prod.outlook.com> <0100016e586dbe79-24514978-922b-479b-a523-3d2bbcdc56c4-000000@email.amazonses.com>
In-Reply-To: <0100016e586dbe79-24514978-922b-479b-a523-3d2bbcdc56c4-000000@email.amazonses.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=balazs.kovacs@ericsson.com;
x-originating-ip: [89.135.192.225]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 6efbfd76-5b39-49c6-faa5-08d76750360a
x-ms-traffictypediagnostic: AM0PR07MB4753:
x-microsoft-antispam-prvs: <AM0PR07MB47533F5AC48C1F7E13E96C6783770@AM0PR07MB4753.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7691;
x-forefront-prvs: 021975AE46
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(376002)(366004)(396003)(136003)(199004)(189003)(66946007)(25786009)(52536014)(6436002)(6246003)(236005)(476003)(6506007)(76116006)(316002)(11346002)(486006)(53546011)(66574012)(478600001)(446003)(71190400001)(14444005)(256004)(186003)(71200400001)(5660300002)(30864003)(2906002)(561944003)(9326002)(33656002)(99286004)(86362001)(76176011)(606006)(229853002)(4326008)(7696005)(8936002)(81166006)(81156014)(7736002)(85182001)(66066001)(66556008)(66476007)(64756008)(85202003)(66446008)(9686003)(26005)(790700001)(6116002)(3846002)(74316002)(54896002)(14454004)(6306002)(8676002)(55016002)(102836004)(170073001)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR07MB4753; H:AM0PR07MB5187.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Y9ZcLHudPm8lgq25XPLY+cMHsA23oL01TDNXGURZJDwp80U43L0ddCY8/Q/MUX99XvMYwl0C4BEGp5zVAFoPTMyPMxCzOWZelJ2DQkopq9v+erdaBgg6amYWOfabGF01u6m08a+LtDq7qX4QwULFNeaRbhRLA7UIaF2AkWnVzz6O8fua3f4F+hG9p2l+Y0aCx5cYyL2rkzBlIX+ILoxFvRHTIEr0so0jKvn91sIgyvzEYkIc/KDlQ/uUnTlME/qjEU6ENeUS+q2XgzVUw+UGV7QX0utC20bakQBubjpFgLpqR8cPk/sdwJgZAyhtXM5pGT0gfZ5cvdWFtot3qvmoSok5Rohk9TZI492U3iJhpfxPmF7MQ2KZ6BJcbKyDhf6Odc8StdmrkWJ9VRpVvMYdbsRNV3HXcnKwWRqsNx7jVFR7nWUHJUxLwAvABogZv1Ip
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_AM0PR07MB51870B440CA86FD39E0926C883770AM0PR07MB5187eurp_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6efbfd76-5b39-49c6-faa5-08d76750360a
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2019 09:10:49.7008 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: mlbY02nwq2+f/aq1TyJQXT9rcPhb/3E3Sr+Z63GUP07a/L1WlnKDkiQOEcTB0deSOHs/RY5hLgRx86d374yizaGrvc3B2BkegbDyPhS8f5E=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB4753
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/5Zpj8Xxh7bHvAJeQf2Lj0t6h8hg>
Subject: Re: [netconf] FIXMEs in ietf-crypto-types and client/server models
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG 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: Tue, 12 Nov 2019 09:10:57 -0000

Hi Kent,

Regarding this one:

Yes, the previous way (example above) was adequate, but I believe the new way (i.e. using a key-format leaf) is better as:

1) it enables the a key-type (e.g., a symmetric key) do be expressed in different ways as needed (OctetString vs. OneSymmetricKey vs. EncryptedData)
2) it MAY (haven't tried to model it yet) be able to support encoding variations (DER vs PEM, and CMS vs. multi-part PEM)
3) it decouples the part that we are stuck on (i.e., the 'algorithm' node) and it being factored-out may provide more flexibility in that definition.

The WG hasn't discussed key-format yet.  Above is the first foray into it...do these arguments sound compelling?

Yes indeed. So the proposal is ok for me. Is there anything to discuss on the details of this to matter or the have the WG’s commitment?

Br
Balazs


From: Kent Watsen <kent+ietf@watsen.net>
Sent: Monday, November 11, 2019 4:07 AM
To: Balázs Kovács <balazs.kovacs@ericsson.com>
Cc: netconf@ietf.org
Subject: Re: FIXMEs in ietf-crypto-types and client/server models

Hi Balazs,



1.       Key-format (symmetric-key, public-key, asymmetric-key-pair)
I assume the idea here is to make it possible to have choices for the ASN.1 types holding the keys. If this flexibility for formats is necessary I don’t have any objection to them but having a single agreed type for these different use cases would also suffice.

I believe here you're referring to the 3 instances of lines like:

      leaf key {
        nacm:default-deny-all;
        type binary;
        //must "../key-format";  FIXME: remove comment if approach ok
        ...
      }

FWIW, the whole "key-format" leaf is still being sussed out (your opinion would be helpful on that thread as well) but, so far it seems promising.  The reason these lines are commented out is because 1) the WG hasn't committed to this path yet and 2) I didn't want to update all the examples in all the drafts (other than truststore and keystore) to add a "key-format" leaf until the WG had more consensus on the "key-format" leafs.

I don't understand your last comment/sentence.  Can you provide an example?

Balazs> Ok, then let’s wait for WG decision. Well, I just say that the earlier ways of communicating the key formats were adequate from my point of view, which was that in documentation it was said that for RSA use RSAPrivateKey and for EC use ECPrivateKey, and similarly for other types. I’m also ok with the key-format approach if preferred by the WG.

In earlier versions:

           description
             "The value of the binary key.  The key's value is
              interpreted by the 'algorithm'.  For example, a DSA key
              is an integer, an RSA key is represented as RSAPrivateKey
              as defined in RFC 8017<https://tools.ietf.org/html/rfc8017>, and an ECC key is represented as
              ECPrivateKey as defined in RFC 5915<https://tools.ietf.org/html/rfc5915>."

Yes, the previous way (example above) was adequate, but I believe the new way (i.e. using a key-format leaf) is better as:

1) it enables the a key-type (e.g., a symmetric key) do be expressed in different ways as needed (OctetString vs. OneSymmetricKey vs. EncryptedData)
2) it MAY (haven't tried to model it yet) be able to support encoding variations (DER vs PEM, and CMS vs. multi-part PEM)
3) it decouples the part that we are stuck on (i.e., the 'algorithm' node) and it being factored-out may provide more flexibility in that definition.

The WG hasn't discussed key-format yet.  Above is the first foray into it...do these arguments sound compelling?





2.       attributes in asymmetric-key-pair-with-cert(s)-grouping
I think attributes should be kept optional. If there is anything else besides subject seen mandatory maybe it should be extracted out from attributes and be spelled out a separate leaf, but I don’t think there is.

I believe here you're referring to the 2 instances of lines like:

        leaf attributes {
          type binary; // FIXME: does this need to be mandatory?
          ...
        }

These are in the "generate-certificate-signing-request" actions found inside the asymmetric-key-pair-with-cert(s)-grouping.

Hmmm, are you claiming that "attributes" are not required in order to generate a CSR?  I think the CSR itself MUST have attributes (right?) so, if not specified, what default values are used?

Balazs> In RFC2986<https://tools.ietf.org/html/rfc2986#section-3> the attributes are said to be optional. We just need the subject DN as mandatory, don’t we?




        1. A CertificationRequestInfo value containing a subject

           distinguished name, a subject public key, and optionally a

           set of attributes is constructed by an entity requesting

           certification.

Thank you.  I've removed these to comments, thus leaving the "attrubtute" nodes as NOT mandatory.





3.       PSK and raw public keys
The use case of PSK and raw public keys are not the most urgent in my opinion which now slows a bit the progress of these drafts, but let’s make an attempt to finalize them.

Agreed, but they are legal for TLS and a WG member stated that they were needed in order to support another IETF WG's efforts.  A quick resolution would be best!



raw-public-keys: I see these were added due to RFC 7250 and 8446. I guess in truststore this is a separate container to distinguish from SSH host keys. For configuring the private part I think keystore already gives support for this case with the asymmetric key (w/o cert) and in the client/server drafts Kent’s proposal could be used (I replaced raw public key with existing type, shouldn’t that be useable straight away?)

                    container <client-identity or server-identity> {
                      choice auth-type {
                         uses ks:local-or-keystore-end-entity-cert-with-key-grouping;
                         uses ks:local-or-keystore-asymmetric-key-grouping;



I would also prefer if these choices are in features, so that an implementation can choose.

To your first sentence, yes, "psk" (and "raw-public-key") are top-level nodes in truststore, as can be seen here (https://tools.ietf.org/html/draft-ietf-netconf-trust-anchors-07#section-2.1).   Note, the trust-anchors draft accidentally doesn't include the ietf-truststore.yang module.

The body of your comment above seems to be about supporting the secret-half of the PSK and RPK within the Keystore.  I've raise this question a couple times previously to Henk (who's asking for the PSK/RPK add), but he's not responded yet as to if doing so is important (though I can only imagine that it does).   With that said, I think your YANG snippet is meant to be in ietf-tls-server and ietf-tls-client modules (right?).  I'm having a hard time following the "I replaced raw public key with existing type, shouldn’t that be useable straight away?" comment.

Balazs: You had an example earlier in an email from 10/8/2019, which is about the TLS client/server models. Below, you are referring to some possibly new groupings that you wanted to propose. I don’t understand though why you mentioned these new groupings since ‘ks:local-or-keystore-asymmetric-key-grouping’ (RPK) and something new that just refers to a keystore symmetric key, such as ‘ks:local-or-keystore-symmetric-key-grouping’ (PSK) should be good. This latter I think would be a new grouping, but with existing terminology.

All, looking at ietf-tls-client.yang and ietf-tls-server.yang, adding the ability to configure the "private" half of a PSK or raw public key would be something like:

                OLD
                    container <client-identity or server-identity> {
                      uses ks:local-or-keystore-end-entity-cert-with-key-grouping;
                NEW
                    container <client-identity or server-identity> {
                      choice auth-type {
                         uses ks:local-or-keystore-end-entity-cert-with-key-grouping;
                         uses ks:local-or-keystore-raw-public-key-grouping;
                         uses ks:local-or-keystore-pre-shared-key-grouping;


Ah, now I understand, I and agree that this seems like the right way to do it, but see below...



To your last sentence regarding features, could you provide an example of what you mean?


container <client-identity or server-identity> {
    choice auth-type {
        mandatory true;
        case certificate {
            if-feature x509-certificate-auth;
           uses ks:local-or-keystore-end-entity-cert-with-key-grouping;
       }
        case raw-public-key {
            if-feature raw-public-key-auth;
           uses ks:local-or-keystore-asymmetric-key-grouping;
       }
        case psk {
            if-feature psk-auth;
           uses ks:local-or-keystore-symmetric-key-grouping;
       }

Better!  This uses the existing groupings (e.g., ks:local-or-keystore-asymmetric-key-grouping) whereas the above proposal defined new ones.  (see GitHub for latest files, though the commit is larger than it should be)

Henk, what do you think?


I assume these features would then need to be defined in the TLS client/server draft.

Yes.



PS: none of this goes to the FIXME in the ietf-crypto-types.  I had previously asked Henk to provide some text here as well but, apparently, like all of us at this time, he's been busy!

 psk: given that the asymmetric keys without certs were covered by host keys and raw public keys, I think psk should only be symmetric keys. Symmetric keys are then sensitive/secret data and as such I believe they should only be referenced from keystore. Seeing them in truststore was unexpected for me. When it comes to their use, clients and servers should be extended with following configuration (and I assume we talk of TLS clients and servers only):

                    container <client-identity or server-identity> {
                      choice auth-type {
                         uses ks:local-or-keystore-end-entity-cert-with-key-grouping;
                         uses ks:local-or-keystore-asymmetric-key-grouping;
                       uses ks:local-or-keystore-symmetric-key-grouping;

Latter grouping would be a new one, but it would use existing constructs and terms from keystore. I don’t think we need new ones. Selected cipher suites will need to have PSK in them for using symmetric key (similar match needed for the others). Note that symmetric keys can be used for other cases than TLS PSK, for example SNMPv3 USM. Again, features would be necessary (those could be saying x.509 or raw-public-key or psk).


Correct, I said the same (that PSKs are essentially symmetric keys) before as well.  Regarding only being referenced to keystore, why not also support them being local-definitions too?  Certainly not a problem if encrypted and, even when not encrypted, then they can be "protected" by NACM-like mechanisms, right?

Balazs> Local definitions are ok too that’s why I used a hypothetical grouping name  ks:local-or-keystore-symmetric-key-grouping.

Sorry, I glossed over the "local-" prefix in your earlier statement.

I agree that PSKs should be in Keystore when used for client-identity/server-identity nodes... (more below)


  Why was/is seeing them in truststore a surprise, perhaps because they're not encryptable there?

Balazs> When PSKs are used then both communicating ends use the shared key for signing and verifying messages. Then one configuration seems enough that is either local or from keystore, why would it be necessary to set it up yet another time for verification from local or truststore? This would mean there is no need for a PSK option when configuring how to  verify the peer.

container <client-authentication or server-authentication> {
    choice auth-type {
        mandatory true;
        case certificate {
            if-feature x509-certificate-auth;
            container ca-certs {

                uses ts:local-or-truststore-certs-grouping
            }
            container server-certs {

                uses ts:local-or-truststore-certs-grouping
            }
       }
        case raw-public-key {
            if-feature raw-public-key-auth;
                uses ks: local-or-truststore-raw-pub-keys-grouping
       }


No need for PSK config since it is already configured in client/server-identity.

Ack.   (see GitHub for latest files, though the commit is larger than it should be)

And, as a bonus, Keystore already defines support for encryption (unlike Truststore).



 Or what is the reasoning why it is necessary to configure a PSK from truststore?

Somehow I thought that were being used in conceptually different ways, but I see now that's not really the case...


Thank you, Balazs, this message was most helpful!

Kent // contributor