Re: [netconf] crypto-types fallback strategy

Kent Watsen <> Fri, 27 September 2019 14:35 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 55AEC12010C for <>; Fri, 27 Sep 2019 07:35:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.897
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: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id TEHVwfHBv1QD for <>; Fri, 27 Sep 2019 07:35:31 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id E2D2E1200C4 for <>; Fri, 27 Sep 2019 07:35:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw;; t=1569594929; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=h4DuHNIhoa5iuEySIqjsSfpSyxmDHw5B8z67w/cv+PI=; b=Qq9xgIlI72dzL0Fn5ZCQxMgfnQDxi5tSeUQL7uSLORLQS9hlyli3xG4m/30B4x/M I/ukmIwrHeZOT1Vo5vUCit3gBCkamwXC961BCLf+/qhwNamezBVYC0cvR/loEv1NEl6 RrFEjUohGwqZ32AiR15B9TYsIhsbCQjkJHt1clxQ=
From: Kent Watsen <>
Message-ID: <>
Content-Type: multipart/alternative; boundary="Apple-Mail=_D543F5E4-CD06-4117-A859-F3E4B994B336"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Fri, 27 Sep 2019 14:35:29 +0000
In-Reply-To: <>
Cc: Juergen Schoenwaelder <>, "" <>, Rifaat Shekh-Yusef <>, Wang Haiguang <>, Frank Xialiang <>
To: "Rob Wilton (rwilton)" <>
References: <> <> <> <> <> <> <> <> <> <> <> <> <>
X-Mailer: Apple Mail (2.3445.104.11)
X-SES-Outgoing: 2019.09.27-
Archived-At: <>
Subject: Re: [netconf] crypto-types fallback strategy
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 27 Sep 2019 14:35:34 -0000

[cc-ing my co-authors, as they're beginning to convert crypto-types back to identities again]

Rob et. al.,

> I tend to agree that sometimes less modules is more. For me, the
> problem is likely more that I am not entirely sure what the proper
> base types would be, which may depend on what exactly they are used
> for. I guess I wait until I see the description text...
> Okay, we'll keep just the one YANG module.
> [RW]
> Do you mean one module for all the identities of just the base identities?


Identities provide the desirable benefit of hierarchy and extensibility, but they come with the weight of the module needing to be implemented (not just imported) in order for the identity to be defined.  This is how YANG works; it would've been better if, e.g., identities could be defined by "implemented" via YANG-library...

The thing with crypto algorithms, the algorithms a server supports is a matter of importance, e.g., because the algorithm isn't approved for use on the network.  The ability to configure algorithms supported is not currently present in the ssh-client-server and tls-client-server drafts, as I was hoping it could be added later as a -bis extension or an update, but perhaps it should be, in order to drive this problem, to ensure a proper crypto-types solution.

Working within the current YANG construct, one possible solution would be to define every algorithm identity in its own module, thus enabling servers maximum flexibility to describe which are supported.  The ostensible negative is that doing so would produce many modules.  While not a computer problem, it could become onerous.

Another idea is to not use identities either (in addition to enumerations), but instead define a data model that preserves the extensibility of identities without needing to implement modules.  For instance, instead of assuming the "algorithm" field is an 'identityref', perhaps a "leafref" is used.

ietf-crypto-types.yang snippet:

	// protocol accesible nodes  (note: config false)
	list algorithms {
	  config false;
	  key name;
	  leaf name {
	    type string;
	    description "The name of a collection of algorithms.  Suitable values are defined in the TBD IANA registry...";
	  list algorithm {
	    key name;
	    leaf name {
	      type string;
	      description "The name of an algorithm.   Suitable values are defined in the TBD IANA registry...";

	grouping public-key {
          leaf algorithm-type {
	    type leafref {
	      path "/ct:algorithms/ct:name";
	      require-instance false;
	    must '../algorithm';
	  leaf algorithm {
	      type leafref {
	        path "/ct:algorithms[ct:name = current()/../algorithm-type]/ct:algorithm/ct:name";
	        require-instance false;
	    must '../algorithm-type';

  - allows a server to advertise (in <operational>) which algorithms it supports without any need to implement a module, other than crypto-types.
  - supports extensibility via IANA registries.  Sequence:  RFC updates registry --> server supports --> client configures to use.
  - "require-instance false" enables YANG-based config validations to succeed w/o presence config false data.

  - only one level of hierarchy (would more every be needed?)
  - "require-instance false" enables YANG-based config validations to succeed even when misconfigured (though commit should fail).


Kent // contributor