Re: [TLS] TLS and hardware security modules - some issues related to PKCS11 (Martin Rex) Tue, 17 September 2013 16:14 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 8CF5411E8129 for <>; Tue, 17 Sep 2013 09:14:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -10.166
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id NzFO70G9nJJZ for <>; Tue, 17 Sep 2013 09:14:54 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 09C8311E829A for <>; Tue, 17 Sep 2013 09:14:50 -0700 (PDT)
Received: from by (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: <>
To: Michael StJohns <>
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: <>
From: (Martin Rex)
X-SAP: out
Subject: Re: [TLS] TLS and hardware security modules - some issues related to PKCS11
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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.