Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2417410rdh; Wed, 27 Sep 2023 01:48:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEK/xx8oGtwgH+M8kVj5JAokMTaL3nP6rh03FLmj9M8bGsvB0Kk1hDPJ54xRUm0XXL9aFp X-Received: by 2002:a17:902:f2d4:b0:1c6:de6:5eb4 with SMTP id h20-20020a170902f2d400b001c60de65eb4mr6012010plc.13.1695804524281; Wed, 27 Sep 2023 01:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695804524; cv=none; d=google.com; s=arc-20160816; b=DQLigkTVR0T4G1pGKSRjZnFYKm3vu9J/FnLrbrzy1nIv6p381sjHsBlQ/F+M6dMwJA VrommV/AXJI+QGWk6flPFCvgK4mCohv7MVV/82UOD1hq/0Ikpl8o21RUoSSWpbUjE7O4 yYe0RHZLadZwWq+b/RLCJOUhIZyfG6cLGc8nM1RkAhDKoU1NfL8Bz1mnv1fKMXW4i2XB OLZ80sUXPq4jKaRNV/H/xwSWvniH2zQzIrcnUCej8n5PB9T+OGLKKfvJ25Y6L3JF4oKr q3lbNxHZHNf2XrZ1u0Sx8rom2FFhWe7c7eSZHNEM6MQeiNB5Eka1LpsDe+vRsUldIXIF fI2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=T708F5QyhTdSRBo0vkbwGJcJTd2q8jjeOwZduLQ6af4=; fh=skGkSKAiziMWcDgxnrG4majkPUa+1f46BTRluEnim3g=; b=kKaWWR98hRRkapvgKhsh8eB0D6Q1YQnvVE93OllQSh98kQWD18tRvlS56zrp480cNC o0tSEpRw/XCBfAYUIchxwkc9MiKlV10GlDUpin/MZfneCekwvBY7MunXLpIgBEywQ2rm ArHf4yY9RagtRrHMxHQJWD1sjKrjptAcoNUKFkjyKBv3UEpLV4yozYL2dZ3qsjJcVoTU awO0AR2ptKD9YQlq2Jxu1CYoulZQwXRYnBvyiXJcNBt4qfR4Xy5fOUdHckYsBqwbCLm+ W1SBG1cLkWW1xyBIWHCpQQgQPQm4zc6f7Qf0s6fe1PolHMzRAGUrXweJKCFOBY2N9osM BOmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sigma-star.at header.s=google header.b=OxYooSxZ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sigma-star.at Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b10-20020a170902650a00b001b8b4330585si14612141plk.510.2023.09.27.01.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 01:48:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@sigma-star.at header.s=google header.b=OxYooSxZ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sigma-star.at Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 551A98051174; Tue, 26 Sep 2023 23:33:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229555AbjI0GdV (ORCPT + 99 others); Wed, 27 Sep 2023 02:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjI0GdT (ORCPT ); Wed, 27 Sep 2023 02:33:19 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEF17F5 for ; Tue, 26 Sep 2023 23:33:16 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9b2a3fd5764so358653866b.3 for ; Tue, 26 Sep 2023 23:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigma-star.at; s=google; t=1695796395; x=1696401195; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T708F5QyhTdSRBo0vkbwGJcJTd2q8jjeOwZduLQ6af4=; b=OxYooSxZ/WhtvBZWVgJBfx9u+BDCWlewHJqOvmrZLqfysuCUmFsca26/TBKNArOmdI 9JLqTqlteiqUa7M/Qfg24OvO0TW5UaYES4k0W+XhWGhXSYEcPgOdjKIhBS+IEB/Uhtdk +O2KyOkb1YGGLJ8KaSPIPO7WjSmmuV8IqVc5C5yPXQFi1fJEysMffGNcKdV+FfSmBAzQ we+lZh503R05Azi+Kigz86jx/u8YWmpH1odxhZGjYxHSPeH7uGh+m6n+JM4+ZAvxJghQ Fm9JOd/Kktw/EpKCQCOrVVTGFgwXWDXHYzcmaPQbdyFIG5A1dQHVFDb/HztsFUfbkyBx pR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695796395; x=1696401195; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T708F5QyhTdSRBo0vkbwGJcJTd2q8jjeOwZduLQ6af4=; b=SWAqu7p4tQol5NaS4c7wjeB0y37j+QM6KK9bgnqBnN6t9MwmzIxwqfHv3BC8cN89vX 2Jn+QNgcXQ3JT6hexftVrAxxsKMP6DblhB62155UqQqyhxPAEImAjxICzHeetI0KXRtX Ju3wCqVoe7x9XcdsQmApAxPLdz7T42VftEsUI69vs3M1m+cn9M2v/zcD59dEjQBnAiEd 6TPnWLU3NtTAgdSV1Ji6HVGh7yo+7A3FfribdIOVx8pkFkg7wh8g5BzuErRb/dNiT+L2 cElYW88YdiSoatt2NQQr4Bil6MGBLqX8vzRb6paQUTqSeAtPN9SkYEe29a6d2hB+/QE8 sasQ== X-Gm-Message-State: AOJu0Yx11JQWM9VB7d7Ya+vcvyP/m+O+G3J8EggSy4AGSVkBd5h9Gx8C Y4vubHQIovb28Jnhww91EKfP3Q== X-Received: by 2002:a17:906:5390:b0:9aa:25f5:8d95 with SMTP id g16-20020a170906539000b009aa25f58d95mr858687ejo.59.1695796394622; Tue, 26 Sep 2023 23:33:14 -0700 (PDT) Received: from smtpclient.apple (213-225-13-130.nat.highway.a1.net. [213.225.13.130]) by smtp.gmail.com with ESMTPSA id p7-20020a170906140700b009829d2e892csm8988478ejc.15.2023.09.26.23.33.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2023 23:33:14 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: [PATCH v3 2/3] KEYS: trusted: Introduce support for NXP DCP-based trusted keys From: David Gstir In-Reply-To: Date: Wed, 27 Sep 2023 08:33:01 +0200 Cc: Mimi Zohar , James Bottomley , Herbert Xu , "David S. Miller" , Shawn Guo , Jonathan Corbet , Sascha Hauer , "kernel@pengutronix.de" , Fabio Estevam , NXP Linux Team , Ahmad Fatoum , sigma star Kernel Team , David Howells , Li Yang , Paul Moore , James Morris , "Serge E. Hallyn" , "Paul E. McKenney" , Randy Dunlap , Catalin Marinas , "Rafael J. Wysocki" , Tejun Heo , "Steven Rostedt (Google)" , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" , "linux-integrity@vger.kernel.org" , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, "linux-security-module@vger.kernel.org" , Richard Weinberger , David Oberhollenzer Content-Transfer-Encoding: quoted-printable Message-Id: <085CABBD-1EA1-44A9-AA9C-C04039A627AB@sigma-star.at> References: <20230918141826.8139-1-david@sigma-star.at> <20230918141826.8139-3-david@sigma-star.at> To: Jarkko Sakkinen X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 26 Sep 2023 23:33:23 -0700 (PDT) Jarkko, > On 25.09.2023, at 17:34, Jarkko Sakkinen wrote: >=20 > On Mon Sep 18, 2023 at 5:18 PM EEST, David Gstir wrote: >> DCP (Data Co-Processor) is the little brother of NXP's CAAM IP. >>=20 >> Beside of accelerated crypto operations, it also offers support for >> hardware-bound keys. Using this feature it is possible to implement a = blob >> mechanism just like CAAM offers. Unlike on CAAM, constructing and >> parsing the blob has to happen in software. >>=20 >> We chose the following format for the blob: >=20 > Who is we? The authors of this patch. But I=E2=80=99ll rephrase that to get rid of the academic paper style. > And there is no choosing anything if the below structure if hardware > defined (not software defined): The below structure is actually software-defined by this patch. Contrary to CAAM, DCP does not have a key blob feature. DCP=E2=80=99s hardware-bound UNIQUE or OTP key is used to bind these key blobs to a specific DCP chip. >=20 >> /* >> * struct dcp_blob_fmt - DCP BLOB format. >> * >> * @fmt_version: Format version, currently being %1 >> * @blob_key: Random AES 128 key which is used to encrypt @payload, >> * @blob_key itself is encrypted with OTP or UNIQUE device = key in >> * AES-128-ECB mode by DCP. >> * @nonce: Random nonce used for @payload encryption. >> * @payload_len: Length of the plain text @payload. >> * @payload: The payload itself, encrypted using AES-128-GCM and = @blob_key, >> * GCM auth tag of size AES_BLOCK_SIZE is attached at the = end of it. >> * >> * The total size of a DCP BLOB is sizeof(struct dcp_blob_fmt) + = @payload_len + >> * AES_BLOCK_SIZE. >> */ >> struct dcp_blob_fmt { >> __u8 fmt_version; >> __u8 blob_key[AES_KEYSIZE_128]; >> __u8 nonce[AES_KEYSIZE_128]; >> __le32 payload_len; >> __u8 payload[]; >> } __packed; >>=20 >> @payload is the key provided by trusted_key_ops->seal(). >>=20 >> By default the UNIQUE device key is used, it is also possible to use >> the OTP key. While the UNIQUE device key should be unique it is not >> entirely clear whether this is the case due to unclear documentation. >> If someone wants to be sure they can burn their own unique key >> into the OTP fuse and set the use_otp_key module parameter. >>=20 >> Co-developed-by: Richard Weinberger >> Signed-off-by: Richard Weinberger >> Co-developed-by: David Oberhollenzer = >> Signed-off-by: David Oberhollenzer = >> Signed-off-by: David Gstir >> --- >> .../admin-guide/kernel-parameters.txt | 13 + >=20 > Separate commit for this. >=20 >> MAINTAINERS | 9 + >=20 > Ditto (i.e. total two additional patches). Will do for v4!=20 Thanks, - David=