Re: [netconf] draft-ietf-keystore - certificate leafref

Kent Watsen <kent@watsen.net> Mon, 17 June 2019 16:46 UTC

Return-Path: <0100016b66556694-56a6a8b2-d9b7-4d5c-958a-82fad5d86745-000000@amazonses.watsen.net>
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 77F371201CE for <netconf@ietfa.amsl.com>; Mon, 17 Jun 2019 09:46:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.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 ma1gswxa7-Ap for <netconf@ietfa.amsl.com>; Mon, 17 Jun 2019 09:46:42 -0700 (PDT)
Received: from a8-64.smtp-out.amazonses.com (a8-64.smtp-out.amazonses.com [54.240.8.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A59FC120092 for <netconf@ietf.org>; Mon, 17 Jun 2019 09:46:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1560790001; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=Ywo3tADBzDG4s7um+wferNHensk4fABKGeRsSfGk2IU=; b=M10htdFKhSBtAxIUtvGr4DcEjP5BmHSrkJNyF3gbr8gAE9RfBXCQkAymCM5ivwi9 p9btAuX+txYtVZORq/ADZbI/24hhKlrHFUGo5r33EzYfuO295o8g1ykzE9nzs5HcA8Z KbGOTsgJ8AiVedrNZzCN0mywy0Uq0Vf3BNFm33WE=
From: Kent Watsen <kent@watsen.net>
Message-ID: <0100016b66556694-56a6a8b2-d9b7-4d5c-958a-82fad5d86745-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_BB26EBCF-9424-409F-83A9-A09A0EB4A603"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Mon, 17 Jun 2019 16:46:41 +0000
In-Reply-To: <VI1PR07MB47354FC9864D17493A0359E983EE0@VI1PR07MB4735.eurprd07.prod.outlook.com>
Cc: "netconf@ietf.org" <netconf@ietf.org>
To: Balázs Kovács <balazs.kovacs@ericsson.com>
References: <VI1PR07MB4735046FD5C54DF0763BA80583EC0@VI1PR07MB4735.eurprd07.prod.outlook.com> <0100016b4b459a4b-58d12364-7b0d-4f73-8fb4-66a9d8595079-000000@email.amazonses.com> <VI1PR07MB47354FC9864D17493A0359E983EE0@VI1PR07MB4735.eurprd07.prod.outlook.com>
X-Mailer: Apple Mail (2.3445.104.11)
X-SES-Outgoing: 2019.06.17-54.240.8.64
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/KqHIgqfYW8smDfc75v6OUNyRgyE>
Subject: Re: [netconf] draft-ietf-keystore - certificate leafref
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: Mon, 17 Jun 2019 16:46:46 -0000

Hi Balazs,

I decided to replaced typedef asymmetric-key-certificate-ref with new "asymmetric-key-certificate-ref-grouping".  Effectively the same, but allow use elsewhere.  Here's the diff:

	https://github.com/netconf-wg/keystore/commit/2f59e8d91709a87d0ff98efafac2a36f420a1882 <https://github.com/netconf-wg/keystore/commit/2f59e8d91709a87d0ff98efafac2a36f420a1882>

I also fixed a typo in the 'path' statement: s/name/ks:name.   Some light testing suggests it's working as expected.

Thanks,
Kent // contributor



> On Jun 14, 2019, at 4:02 AM, Balázs Kovács <balazs.kovacs@ericsson.com> wrote:
> 
> Hi Kent,
>  
> I hope it is ok this way.
>  
> I changed local-or-keystore-end-entity-cert-with-key-grouping (see container ‘keystore-reference’).
>  
>   grouping local-or-keystore-end-entity-cert-with-key-grouping {
>     description
>       "A grouping that expands to allow an end-entity certificate
>        (and its associated private key) to be either stored locally,
>        within the using data model, or be a reference to a specific
>        certificate in the keystore.";
>     choice local-or-keystore {
>       mandatory true;
>       case local {
>         if-feature "local-keys-supported";
>         container local-definition {
>           must '(algorithm and public-key and private-key)
>                 or not (algorithm or public-key or private-key)' {
>             description
>               "These descendent nodes are not mandatory because they
>                MAY be defined in <operational>.  Implementations MUST
>                assert that these values are either configured or that
>                they exist in <operational>.";
>           }
>           description
>             "Container to hold the local key definition.";
>           uses ct:asymmetric-key-pair-grouping;
>           uses ct:end-entity-cert-grouping;
>         }
>       }
>       case keystore {
>         if-feature "keystore-supported";
>         container keystore-reference {
>           description
>             "A reference to a specific certificate, and its
>              associated private key, stored in the keystore.";
>           leaf asymmetric-key {
>             type ks:asymmetric-key-ref;
>             description
>               "A reference to an asymmetric key that exists in
>                the keystore.";
>           }
>           leaf certificate {
>             type leafref {
>                 path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key[name = current()/../asymmetric-key]/ks:certificates/ks:certificate/ks:name";
>             }
>             description
>               "A reference to a specific certificate of the 
>                asymmetric key in the keystore.";    
>           }
>         }
>       }
>       description
>         "A choice between an inlined definition and a definition
>          that exists in the keystore.";
>     }
>   }
>  
> I would recommend to remove ks:asymmetric-key-certificate-ref
> The client server model examples would need to be updated, but those I have not touched.
>  
> Br,
> Balazs
>  
> From: Kent Watsen <kent@watsen.net <mailto:kent@watsen.net>> 
> Sent: Wednesday, June 12, 2019 12:40 PM
> To: Balázs Kovács <balazs.kovacs@ericsson.com <mailto:balazs.kovacs@ericsson.com>>
> Cc: netconf@ietf.org <mailto:netconf@ietf.org>
> Subject: Re: draft-ietf-keystore - certificate leafref
>  
>  
> Hi Balazs,
>  
> Yes, that would be better.  Please provide the NEW text needed. 
> 
> Kent 
>  
> Sent from my iPhone
> 
> On Jun 12, 2019, at 5:14 AM, Balázs Kovács <balazs.kovacs@ericsson.com <mailto:balazs.kovacs@ericsson.com>> wrote:
> 
> Hi Kent,
>  
> Ietf-keystore model contains this leafref:
>  
>      typedef asymmetric-key-certificate-ref {
>        type leafref {
>          path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key"
>             + "/ks:certificates/ks:certificate/ks:name";
>        }
>        description
>          "This typedef enables modules to easily define a reference
>           to a specific certificate associated with an asymmetric key
>           stored in the keystore.";
>      }
>  
> Shouldn’t the leafref be constrained to point to a certificate within a specific asymmetric-key list element?
>  
> Example:
> https://mailarchive.ietf.org/arch/msg/netmod/m0s9xAcDpJVm1a0-eWyTDvpXtZ0 <https://mailarchive.ietf.org/arch/msg/netmod/m0s9xAcDpJVm1a0-eWyTDvpXtZ0>
>  
> Best Regards,
> Balazs
>  
>  
> _______________________________________________
> netconf mailing list
> netconf@ietf.org <mailto:netconf@ietf.org>
> https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>