Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1506129pxv; Fri, 2 Jul 2021 05:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeNeiwDsSP5pEe3gJ7qcdK0cOPowS4CQ4+6ZM3wAPtPOvT/K4+V+/6Ayl9W5DAsh/mtpsV X-Received: by 2002:a17:907:e8e:: with SMTP id ho14mr4898586ejc.330.1625229351752; Fri, 02 Jul 2021 05:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625229351; cv=none; d=google.com; s=arc-20160816; b=A04P8PnKL/Jxvrzrzdb+kufRG767M113/nQnkshAy87lKO2TxT8lgO2AWllE825HWt /XvZA/TxUrNV6luL3+xWxGltHhX1tjBT/v8hWITFQ20wXYfQDv0pp/nH/RR2mxJB+1ZQ hUhJCYNm2/+tDlDBpg3nLoG/PtODIOyuZvWP0nDnyAM7qu3f09/FlCdwfmMqkBm07w2Z HYVq7NJZrGURaFfhcFF+yOYgPf6P8PPo7u4s7tnZClNbpCDrrM4gl9+86Hyz5f0GA5cl 1CS1gGjzA3Ot2x1ugg0zA1MwCFiDBGtV9C4D60nbAY8KdreglbieLVeyVAlqJ6bQfc0r Hwlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=JOrZ4tLTcHYpvfJ4Y/4EnGni4mjgu93QsEsbJRHZ3aA=; b=xLOS5v9iMZeuVKXXpbYmKLwSXttejnfvC9L/KrepUxhllL3zJMS2rEu5w2GSOEVzmN OUtHPVIvtiXKfmt2U7MFHFRoq0210ouDuETobsyMvULX4aA0RWbwNbnSZOjWt9HwcGFU IukiXm8JQuHHb9SmADgnoPWVyq50WxG3FG2+5jT2XXiXZsREjuXZS89Tfj5KoQQhH/tc +o5y1A23HW4XXzxFSsCJwLds1kBStPQ1PQ7hL915768Shgi2zvrLWQTKg7DeP40Dkoqs xQQMaPgshAKHo2y8IDNGC8yzyFnpxl+ZuRny283jcTbahnf75Ta/KDTkniEpjKiBLVKa mJkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la12si2784507ejc.560.2021.07.02.05.35.19; Fri, 02 Jul 2021 05:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbhGBMgm (ORCPT + 99 others); Fri, 2 Jul 2021 08:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232594AbhGBMgh (ORCPT ); Fri, 2 Jul 2021 08:36:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D96F9C061762 for ; Fri, 2 Jul 2021 05:34:05 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lzIMq-0003K9-Jc; Fri, 02 Jul 2021 14:34:00 +0200 Subject: Re: [PATCH v2 6/6] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys To: Richard Weinberger Cc: Jonathan Corbet , David Howells , Jarkko Sakkinen , James Bottomley , Mimi Zohar , kernel , James Morris , "Serge E. Hallyn" , horia geanta , aymen sghaier , Herbert Xu , davem , Udit Agarwal , Eric Biggers , Jan Luebbe , david , Franck Lenormand , Sumit Garg , "open list, ASYMMETRIC KEYS" , Linux Crypto Mailing List , Linux Doc Mailing List , linux-integrity , linux-kernel , LSM References: <39e6d65ca5d2a0a35fb71d6c1f85add8ee489a19.1624364386.git-series.a.fatoum@pengutronix.de> <1850833581.13438.1625172175436.JavaMail.zimbra@nod.at> <2f608e5a-5a12-6db1-b9bd-a2cd9e3e3671@pengutronix.de> <783613027.15909.1625223222889.JavaMail.zimbra@nod.at> From: Ahmad Fatoum Message-ID: Date: Fri, 2 Jul 2021 14:33:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <783613027.15909.1625223222889.JavaMail.zimbra@nod.at> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 02.07.21 12:53, Richard Weinberger wrote: > Ahmad, > > ----- Ursprüngliche Mail ----- >> Von: "Ahmad Fatoum" >>> I'm still think that hard coding the key modifier is not wise. >>> As I said[0], there are folks out there that want to provide their own modifier, >>> so it is not only about being binary compatible with other CAAM blob patches in >>> the wild. >> >> I don't think the characterization as a salt is accurate. AFAIU it's more >> of a namespace, so blobs being loaded are "type-checked" against the modifier. > > Well, the CAAM programmer's reference manual states that the blob key is a 128 bit modifier > and has two purposes: > 1. It can be used as tag to provide separation between blobs to detect accidental replacement of blobs. > 2. But it can also be treated as secret to provide additional protection. Because the blob encryption > key derivation includes the key modifier. > > While you have case 1 in mind, I care about case 2. :-) Ah, using the key modifier as a passphrase didn't occur to me. >>> I'll happily implement that feature after your patches got merged but IMHO we >>> should first agree on an interface. >>> How about allowing another optional parameter to Opt_new and Opt_load >> >> Sound good to me. pcrlock for TPM trusted keys has the same interface. >> >> I'd prefer the new option to accept strings, not hex though. > > Both is possible. If the string starts with "0x" it needs to be decoded to a > 128 bit key. Otherwise it has to be a up to 16 byte string. Fine by me. Looking forward to your patches. :-) Cheers, Ahmad > > Thanks, > //richard > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |