Re: [netconf] crypto-types fallback strategy

Per Hedeland <per@hedeland.org> Wed, 18 September 2019 20:53 UTC

Return-Path: <per@hedeland.org>
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 8BC84120858 for <netconf@ietfa.amsl.com>; Wed, 18 Sep 2019 13:53:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.597
X-Spam-Level:
X-Spam-Status: No, score=-2.597 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 7_4TQnRTDS4i for <netconf@ietfa.amsl.com>; Wed, 18 Sep 2019 13:53:17 -0700 (PDT)
Received: from mailout.easydns.com (mailout.easydns.com [64.68.202.10]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6D5C5120112 for <netconf@ietf.org>; Wed, 18 Sep 2019 13:53:17 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mailout.easydns.com (Postfix) with ESMTP id 7CE0DA014A; Wed, 18 Sep 2019 20:53:16 +0000 (UTC)
Received: from mailout.easydns.com ([127.0.0.1]) by localhost (emo13-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x48P8GJgrIjQ; Wed, 18 Sep 2019 20:53:16 +0000 (UTC)
Received: from hedeland.org (81-228-157-209-no289.tbcn.telia.com [81.228.157.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easydns.com (Postfix) with ESMTPSA id 36858A00C8; Wed, 18 Sep 2019 20:53:11 +0000 (UTC)
Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id x8IKr9UV009547 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 18 Sep 2019 22:53:09 +0200 (CEST) (envelope-from per@hedeland.org)
To: "Schönwälder, Jürgen" <J.Schoenwaelder@jacobs-university.de>
Cc: Martin Bjorklund <mbj@tail-f.com>, "netconf@ietf.org" <netconf@ietf.org>, "rifaat.ietf@gmail.com" <rifaat.ietf@gmail.com>
References: <0100016d44bda220-51590a9a-0a15-4b63-a49d-47efe712e82e-000000@email.amazonses.com> <MN2PR11MB436617082A8308A7A8928DDFB58E0@MN2PR11MB4366.namprd11.prod.outlook.com> <0100016d4553e645-9c5796b8-15da-4a51-b820-5ecef6575eff-000000@email.amazonses.com> <20190918.220638.1382892184185166890.mbj@tail-f.com> <20190918202928.mqxdsuh3by3c4usl@anna.jacobs.jacobs-university.de>
From: Per Hedeland <per@hedeland.org>
Message-ID: <7ec3f404-9070-b0f7-7673-10093437121e@hedeland.org>
Date: Wed, 18 Sep 2019 22:53:09 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <20190918202928.mqxdsuh3by3c4usl@anna.jacobs.jacobs-university.de>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/fWJ_a0zlp9YAJNr7bObFoD8usI8>
Subject: Re: [netconf] crypto-types fallback strategy
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: Wed, 18 Sep 2019 20:53:20 -0000

On 2019-09-18 22:29, Schönwälder, Jürgen wrote:
> On Wed, Sep 18, 2019 at 10:06:38PM +0200, Martin Bjorklund wrote:
>> Kent Watsen <kent+ietf@watsen.net> wrote:
>>> [moving Russ and Sean to BCC, per Rich's action]
>>>
>>>
>>>
>>>> Minor: Does the string in the description above mean ASCII string
>>>> or binary string, RFC 4251 seemingly uses both definitions?
>>>
>>> I don't know, but this is the language found for the "key-data" leaf
>>> in RFC 7317 (i.e., we've been living with this definition for awhile)
>>
>> So the definition is:
>>
>>               leaf key-data {
>>                 type binary;
>>                 mandatory true;
>>                 description
>>                   "The binary public key data for this SSH key, as
>>                    specified by RFC 4253, Section 6.6, i.e.:
>>
>>                      string    certificate or public key format
>>                                identifier
>>                      byte[n]   key/certificate data.";
>>
>> The textual representation of a binary in YANG is base64 encoded.  As
>> it happens, this is exactly the same as OpenSSH uses for its keys.  So
>> the open ssh key can be copy/pasted into the NC/RC XML/JSON.
>>
> 
> My public ssh keys usually start like this:
> 
>    ssh-rsa AAAA...
> 
> Looking at RFC 4251, it seems to me that 'string' is encoded with a
> length prefix, followed by n bytes of key data. This means the start
> in hex would be something like this:
> 
>    00 00 00 07 73 73 68 2d 72 73 61
> 
> If I base64 encode this, I won't get what I quoted above.

Are you sure? I don't have a handy base64 encoder for "space-separated
octets represented as hex numbers", but going in the other direction
with the initial part of my public ssh key (ssh-rsa), using the Linux
'base64' command and converting the result to "space-separated octets
represented as hex numbers" gives:

$ echo AAAAB3NzaC1yc2EA | base64 -d | od -t x1
0000000 00 00 00 07 73 73 68 2d 72 73 61 00

Seems to agree with what you have.

--Per