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

Nico Williams <> Mon, 23 September 2013 20:27 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 350AA21F9D2E for <>; Mon, 23 Sep 2013 13:27:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[AWL=0.075, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id CLX9U6GPswNu for <>; Mon, 23 Sep 2013 13:27:22 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 618C121F9D3B for <>; Mon, 23 Sep 2013 13:27:22 -0700 (PDT)
Received: from (localhost []) by (Postfix) with ESMTP id B0FF11DE155 for <>; Mon, 23 Sep 2013 13:23:29 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 510F11DE192 for <>; Mon, 23 Sep 2013 13:00:36 -0700 (PDT)
Received: by with SMTP id tp5so7325075ieb.14 for <>; Mon, 23 Sep 2013 13:00:35 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=e48CPQ4SirGJ8sw8mlgfClM7wcs/+dNdupIZamoLdcE=; b=Bapktvn3f/AXnZblNYkn05ewxuZFp5+M/YLHJ1g+7WEtcgdhQdfYDlfMweaL7qH2Zw Bt6ueH1B2pWiIcztVnl0b0cDT7/AivDwokcftwV6bGlqtnxl/A+gR4bMk42QxS4DGSs4 JCGeUalw5lsbynXTcl4cHzwSFE+OF7K6Y1Frkbvg3ysy7mOs9XKbo2Ln4CefloR1grrH V1k2QIM/WamV2s4IU9XT4Kj9CMvjvj/RtWDBAatD4ezZxHdXksfiRlnbxzdmQYffgdqj Z/q/WHI7pMFAJNfuDbkZjo8+XBRot4ZKFzFuS8RYGoTlT4DS9APVAF3BJinLiRTMGJNz jugQ==
MIME-Version: 1.0
X-Received: by with SMTP id mp9mr15172827icb.0.1379966435436; Mon, 23 Sep 2013 13:00:35 -0700 (PDT)
Received: by with HTTP; Mon, 23 Sep 2013 13:00:35 -0700 (PDT)
In-Reply-To: <>
References: <> <>
Date: Mon, 23 Sep 2013 15:00:35 -0500
Message-ID: <>
From: Nico Williams <>
To: Michael StJohns <>
Content-Type: text/plain; charset=UTF-8
Cc: "" <>
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: Mon, 23 Sep 2013 20:27:28 -0000

On Tue, Sep 17, 2013 at 10:45 AM, 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.

But evidently you must care about the application plaintext.  Why not
move the application into the HSM as well then?

That deserves a tongue-in-cheek smiley, of course :^)

> 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.

Why?  The HSM will become a cryptographic decelerator if you do that,
unless it's a fantastically expensive HSM anyways, and even then there
will be latency costs.  Meanwhile the session keys are of little or no
additional value to the application plaintext, and you're leaving the
application outside the HSM (of course, for obvious reasons).

So why do this?  The one answer that comes to mind is: to make sure
you get the crypto right, without possibility of screwups/backdoors in
various OS components (e.g., RNG).  But the performance cost more than
outweighs that answer in most of the use cases I can think of.