Re: [DNSOP] Specification of DNSKEY "Private-key-format"

Mukund Sivaraman <muks@mukund.org> Thu, 29 August 2019 13:57 UTC

Return-Path: <muks@mukund.org>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BF74C12007C for <dnsop@ietfa.amsl.com>; Thu, 29 Aug 2019 06:57:24 -0700 (PDT)
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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mukund.org
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 198hNjcJ9osc for <dnsop@ietfa.amsl.com>; Thu, 29 Aug 2019 06:57:22 -0700 (PDT)
Received: from mail.akira.org (mail.akira.org [IPv6:2a01:4f8:13b:607::228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9C57912004A for <dnsop@ietf.org>; Thu, 29 Aug 2019 06:57:22 -0700 (PDT)
Received: from jurassic.lan.banu.com (unknown [60.243.81.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.akira.org (Postfix) with ESMTPSA id 6857179000BD; Thu, 29 Aug 2019 13:57:20 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mukund.org; s=mail; t=1567087041; bh=R+5KdCUpTsckEf97CNIe2yhsX13yRMA2wxWZQU/BjsA=; h=Date:From:To:Subject:References:In-Reply-To:From; b=ls3rRZAV0QH0KoTizuGWddp+FkcUFmIIo5ifPgs5OTxEGU4EfgKslxNmjkwBdOoKc xCRvqZAyJfrrmji+z+rSxMyHe0JZB1kLrtqx2NhIIjU24Is0xJuMb9xWUZzScR9z7N OsoiW6E46yeV5gTWZfRHsBy7KQZy6MI+x6A5qV5Y=
Date: Thu, 29 Aug 2019 19:25:54 +0530
From: Mukund Sivaraman <muks@mukund.org>
To: dnsop@ietf.org
Message-ID: <20190829135554.GA3616@jurassic.lan.banu.com>
References: <20190829125502.GA2048@jurassic.lan.banu.com> <20190829134831.GC90696@straasha.imrryr.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20190829134831.GC90696@straasha.imrryr.org>
User-Agent: Mutt/1.12.0 (2019-05-25)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/55qZF_kZIaivXexWuaqA9BxNUy8>
Subject: Re: [DNSOP] Specification of DNSKEY "Private-key-format"
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Aug 2019 13:57:25 -0000

Hi Viktor

On Thu, Aug 29, 2019 at 09:48:31AM -0400, Viktor Dukhovni wrote:
> On Thu, Aug 29, 2019 at 06:25:02PM +0530, Mukund Sivaraman wrote:
> > A tool such as BIND's dnssec-keygen generates the following formatted
> > private keys:
> > 
> > [muks@naina ~]$ cat Kexample.org.+008+10638.private
> > Private-key-format: v1.3
> > Algorithm: 8 (RSASHA256)
> > Modulus: [...]
> > PublicExponent: [...]
> > PrivateExponent: [...]
> > Prime1: [...]
> > Prime2: [...]
> > Exponent1: [...]
> > Exponent2: [...]
> > Coefficient: [...]
> 
> Compare the above with:
> 
>     $ openssl genrsa 512 2>/dev/null | openssl rsa -text -noout | egrep -v ':..:'
>     RSA Private-Key: (512 bit, 2 primes)
>     modulus:
>     publicExponent: 65537 (0x10001)
>     privateExponent:
>     prime1:
>     prime2:
>     exponent1:
>     exponent2:
>     coefficient:
> 
> And it becomes clear that what you're seeing is a sequence of tagged
> base64 encodings of the BIGNUM elements of the CRT form of an RSA
> private key.

I am initimately familiar with what these fields mean and the code that
generates it. The question is not about what the meaning of these fields
are.

I am asking about where this key format is specified - I want to extend
it.

> 
> > Created: [...]
> > Publish: 20190829125147
> > Activate: 20190829125147
> 
> Plus some additional metadata.
> 
> > I have looked around for a specification for this format, but I fail to
> > find one. Where is this specified? Has it ever been described in some
> > document?
> 
> This looks like an ad-hoc format, specific to dnssec-keygen and
> friends.  In particular "Publish:" and "Activate:" are not part of
> the key per-se and are rather related to the DNSSEC key lifecycle.
> 
> -- 
> 	Viktor.
> 
> _______________________________________________
> DNSOP mailing list
> DNSOP@ietf.org
> https://www.ietf.org/mailman/listinfo/dnsop
> 

		Mukund

--

Loop DNS nameserver: https://akira.org/loop/