From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19992C43460 for ; Thu, 1 Apr 2021 10:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0ACB610CA for ; Thu, 1 Apr 2021 10:06:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233969AbhDAKGS (ORCPT ); Thu, 1 Apr 2021 06:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233852AbhDAKGP (ORCPT ); Thu, 1 Apr 2021 06:06:15 -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 6A1E7C061788 for ; Thu, 1 Apr 2021 03:06:15 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lRuDN-00013V-QC; Thu, 01 Apr 2021 12:06:13 +0200 Subject: Re: [PATCH v1 0/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys To: Richard Weinberger , James Bottomley Cc: Jarkko Sakkinen , horia geanta , Mimi Zohar , aymen sghaier , Herbert Xu , davem , kernel , David Howells , James Morris , "Serge E. Hallyn" , Steffen Trumtrar , Udit Agarwal , Jan Luebbe , david , Franck Lenormand , Sumit Garg , linux-integrity , "open list, ASYMMETRIC KEYS" , Linux Crypto Mailing List , linux-kernel , LSM References: <1777909690.136833.1617215767704.JavaMail.zimbra@nod.at> <2034693332.137003.1617219379831.JavaMail.zimbra@nod.at> From: Ahmad Fatoum Message-ID: Date: Thu, 1 Apr 2021 12:06:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <2034693332.137003.1617219379831.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-security-module@vger.kernel.org Precedence: bulk List-ID: Hello Richard, On 31.03.21 21:36, Richard Weinberger wrote: > James, > > ----- Ursprüngliche Mail ----- >> Von: "James Bottomley" >> Well, yes. For the TPM, there's a defined ASN.1 format for the keys: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/jejb/openssl_tpm2_engine.git/tree/tpm2-asn.h >> >> and part of the design of the file is that it's distinguishable either >> in DER or PEM (by the guards) format so any crypto application can know >> it's dealing with a TPM key simply by inspecting the file. I think you >> need the same thing for CAAM and any other format. >> >> We're encouraging new ASN.1 formats to be of the form >> >> SEQUENCE { >> type OBJECT IDENTIFIER >> ... key specific fields ... >> } >> >> Where you choose a defined OID to represent the key and that means >> every key even in DER form begins with a unique binary signature. > > I like this idea. > Ahmad, what do you think? > > That way we could also get rid off the kernel parameter and all the fall back logic, > given that we find a way to reliable detect TEE blobs too... Sounds good to me. Sumit, your thoughts on doing this for TEE as well? > > 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 |