Re: [TLS] TLS and hardware security modules - some issues related to PKCS11

mrex@sap.com (Martin Rex) Tue, 17 September 2013 16:14 UTC

Return-Path: <mrex@sap.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8CF5411E8129 for <tls@ietfa.amsl.com>; Tue, 17 Sep 2013 09:14:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.166
X-Spam-Level:
X-Spam-Status: No, score=-10.166 tagged_above=-999 required=5 tests=[AWL=0.083, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NzFO70G9nJJZ for <tls@ietfa.amsl.com>; Tue, 17 Sep 2013 09:14:54 -0700 (PDT)
Received: from smtpde02.sap-ag.de (smtpde02.sap-ag.de [155.56.68.140]) by ietfa.amsl.com (Postfix) with ESMTP id 09C8311E829A for <tls@ietf.org>; Tue, 17 Sep 2013 09:14:50 -0700 (PDT)
Received: from mail05.wdf.sap.corp by smtpde02.sap-ag.de (26) with ESMTP id r8HGEmqY019765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Sep 2013 18:14:48 +0200 (MEST)
In-Reply-To: <52387927.4030007@nthpermutation.com>
To: Michael StJohns <msj@nthpermutation.com>
Date: Tue, 17 Sep 2013 18:14:48 +0200 (CEST)
X-Mailer: ELM [version 2.4ME+ PL125 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="US-ASCII"
Message-Id: <20130917161448.65E011A974@ld9781.wdf.sap.corp>
From: mrex@sap.com (Martin Rex)
X-SAP: out
Cc: tls@ietf.org
Subject: Re: [TLS] TLS and hardware security modules - some issues related to PKCS11
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: mrex@sap.com
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: Tue, 17 Sep 2013 16:14:59 -0000

Michael StJohns wrote:
> On 9/17/2013 8:49 AM, Martin Rex wrote:
> > I fail to understand what you're trying to protect.
> >
> > The master secret of a session is never a secret that is hidding
> > within the hardware module, instead, it is something known to the
> > calling TLS protocol stack and part of the TLS session cache.
> 
> Um.  No, not if you designed things properly.  It should be possible for 
> any protocol the IETF designs to do all the crypto operation inside a 
> hardware module and not depend on the weak security of a general purpose 
> computer.
> 
> I want to protect inside of the HSM all of the following:
> 
> a) the private keys related to the server or client identity
> b) the pre-master key
> c) the master key
> d) the session keys.
> 
> I want to be able to do all the cryptographic processing inside that 
> module and only allow out true plain text.
> 
> > For vanilla RSA cipher suites, it is deterministically derived
> > from randomness generated by the client and conveyed under
> > RSA encryption, deterministically combined with data known
> > in plain to the TLS protocol stack.
> 
> I think you're talking about the pre-master secret?  If so, yes, but 
> so?  The encrypted pre-master secret goes to the HSM where it's 
> decrypted, run through a KDF and used to produce the master secret. 
> Ideally, that master secret may be retained within the HSM and protected 
> from disclosure.

Typically, the PKCS#11 module will export an RSA PKCS#1 v1.5 decryption
primitive, and the server will typically be able to pass the encrypted
premaster-secret, reference his strongly protected server credentials
and obtain the RSA-decrypted output.  Once that decrypted pre-master
secret is obtained, everything else is deterministic.

-Martin