Re: [TLS] HSM-friendly Key Computation

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Thu, 23 April 2015 17:53 UTC

Return-Path: <ilari.liusvaara@elisanet.fi>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 254821B2CEC for <tls@ietfa.amsl.com>; Thu, 23 Apr 2015 10:53:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham
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 tqaO69GxV7lh for <tls@ietfa.amsl.com>; Thu, 23 Apr 2015 10:53:10 -0700 (PDT)
Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 86B9F1B30DD for <tls@ietf.org>; Thu, 23 Apr 2015 10:52:46 -0700 (PDT)
Received: from LK-Perkele-VII (a88-112-44-140.elisa-laajakaista.fi [88.112.44.140]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 4342A69968; Thu, 23 Apr 2015 20:52:44 +0300 (EEST)
Date: Thu, 23 Apr 2015 20:52:44 +0300
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
To: Michael StJohns <msj@nthpermutation.com>
Message-ID: <20150423175244.GA26942@LK-Perkele-VII>
References: <5533F8D6.9070500@nthpermutation.com> <20150420064243.GA7322@LK-Perkele-VII> <CANeU+ZAL6oT6tP7OcL_8j6kp4oZB9V89R-0PrCdv-N27qVb0HQ@mail.gmail.com> <20150420163755.GA15511@LK-Perkele-VII> <5537D43A.9080802@REDHAT.COM> <20150422173526.GA14496@LK-Perkele-VII> <CABcZeBPN33DM_C0sAmCTFCTdNrcQ7y7eEBcZgPe+2f1EaxtXzA@mail.gmail.com> <55381302.5030307@nthpermutation.com> <20150423084201.GA21246@LK-Perkele-VII> <55392D3D.1020101@nthpermutation.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <55392D3D.1020101@nthpermutation.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Sender: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/kS7lQ0kQ6uZYe8XK_j_neXv3oKM>
Cc: tls@ietf.org
Subject: Re: [TLS] HSM-friendly Key Computation
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Apr 2015 17:53:12 -0000

On Thu, Apr 23, 2015 at 01:34:53PM -0400, Michael StJohns wrote:
> On 4/23/2015 4:42 AM, Ilari Liusvaara wrote:
> >On Wed, Apr 22, 2015 at 05:30:42PM -0400, Michael StJohns wrote:
> >
> >One possible structure in TLS notation:
> >
> >struct prf_output
> >{
> >      /*
> >      0x0000 => For key derivation
> >      0x0001 => For AEAD keying
> >      0x8002 => For AEAD IV
> >      0x8003 => For octet string (exporters, unique)
> >      */
> >      uint16 type;
> >      uint16 length;  /* In bytes. */
> >};
> 
> I ended up with a bit larger set of key types:
> 
> Master Secret (can only be used with KDFs)

Right.

> AES-CMAC

Not used anywhere (insufficient security).

> AES-AEAD

Is there ment to be XXX-AEAD for different encryption algorithms?
Do AES-CCM and AES-GCM share a key type? What about AES-CCM8?

> AES-ENCRYPT

Not used. Encryption always pairs with authentication (AEAD).

> HMAC-SHA1

A NULL cipher key? That one wouldn't be directly used for anything else.

> HMAC-SHA2

NULL cipher keys are per algorithm?

> GENERIC-DATA (different that PKCS11 generic secret - could be IV material
> for example).

This is "octet string" above (except IVs are "AEAD IV").

> as a starting point.

Depending on view, you also need special type for exporter secret, since
it behaves somewhat unlike others.

> It turns out that you want to subdivide AES AEAD uses from non AEAD AES
> functions because you don't want to be able to use AES-CTR to get around the
> AES-CCM and GCM "don't let the data come out unless its been verified"
> policy.

As said, encryption always pairs with authentication.



-Ilari