From patchwork Sun Feb 7 18:26:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Foundries" X-Patchwork-Id: 1437235 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=N/VS5Ky4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DYd0Y6R5Dz9sVF for ; Mon, 8 Feb 2021 05:26:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0916D826F6; Sun, 7 Feb 2021 19:26:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.b="N/VS5Ky4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AADDC8278B; Sun, 7 Feb 2021 19:26:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E35F6826E1 for ; Sun, 7 Feb 2021 19:26:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jorge@foundries.io Received: by mail-wr1-x432.google.com with SMTP id v15so14617591wrx.4 for ; Sun, 07 Feb 2021 10:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pHRrh1tPahAkgFfCUGdFDrBz35bNVJp943ZzqZMWyFw=; b=N/VS5Ky4I7AXlmgnF2JXZm78+RbDs89LuLe/h0WuTFSnEW4OqUhaaS7j9XSanolBKD QYKz9vzwEnFJaEI57LywFRxrbAVXRn34YKao3OpdsRnqSGI2HX5HjTOjSUSkdumYk/R0 53T3d2kLpiea4ZU6SZCqOvKsRiWtRJr20MOXwNbchnKJnqykKGVntImZCFQeegJRW28I z9XTHOMHN1qagYR4I+c0Bebdg5N5SY+ATR2hnGY+x79QautdsDE8u4EO+Bawsy18nkF/ EuiUlIU9e1wwBOvVocZKkV3Sj3VbOZieK9qYeJR9myoBgZgyC2OJk+jpRomFXkYXy7gf nPMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pHRrh1tPahAkgFfCUGdFDrBz35bNVJp943ZzqZMWyFw=; b=HisWWfcVvbhmft8+z/IAgOZ58Gtvk6u5gMxZ+zbioVVYm88aU3rzEqy31XVbc3frEl bhedzlm80fiRMjQMQfWhPFxh0YBwHGGiiGznzmnUPgkHGnJfWyga15/79WloOt7/LT28 YB8qCeSCJPXPHdNGlYRhzSmtFKg0wMd46d+fVNy2aJbN2S/FtEVtY4oEbg2XtWex7ndN 1w/SeuLDyhQEJGHRDQ7aNV2boV7uoVJyWYPnekcSTBMwBsaDKG9ThXJrxfsqAACb2032 AtO941iuPtnW1Sj7Gx60VZ5gvAjg7Cl7UO4Q4wC7LKa/VZypfQEVDh4hHWsrG2UYrJPV BgAw== X-Gm-Message-State: AOAM531Ja/q46Yz0ytn/c+Njx0r6XxQFktNhQGP3Q10BzYOlDQD23mqf R3QHlkkHSLB0MqrgicI7QQaTUw== X-Google-Smtp-Source: ABdhPJzGpO5vc3qgJXS9JsQidwWdq+houkijCDV0iCCeqI6PXjeyJ4fzMQp7imt0tA7s3GLd/MWFIQ== X-Received: by 2002:adf:ce10:: with SMTP id p16mr16520617wrn.97.1612722402447; Sun, 07 Feb 2021 10:26:42 -0800 (PST) Received: from localhost.localdomain (182.red-79-146-86.dynamicip.rima-tde.net. [79.146.86.182]) by smtp.gmail.com with ESMTPSA id i3sm5173360wrr.19.2021.02.07.10.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 10:26:41 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, sjg@chromium.org, jens.wiklander@linaro.org Cc: igor.opaniuk@foundries.io, u-boot@lists.denx.de Subject: [PATCHv3 0/4] SCP03 control Date: Sun, 7 Feb 2021 19:26:28 +0100 Message-Id: <20210207182632.24252-1-jorge@foundries.io> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The following patchset allows U-Boot to enable the Secure Channel Protocol 03 implemented in a TEE and executed between the processor and the secure element. It also allows U-Boot to request the rotation of the encryption keys defined as part of the protocol; when this is request is made, the TEE will derive new keys program them in the secure element so all communications with the secure element remains secured. Changes v3: common: SCP03 control (enable and provision of keys) Simon Glass: document Kconfig include common.h return -ENXIO on TA not available cmd: SCP03: enable and provision command Simon Glass: requested .rst docs printf on error use U_BOOT_CMD_WITH_SUBCMDS drivers: tee: sandbox: SCP03 control emulator Simon Glass: expand Kconfig information Changes v2: remove obsolete patch (wasnt part of the set) Jorge Ramirez-Ortiz (4): common: SCP03 control (enable and provision of keys) cmd: SCP03: enable and provision command drivers: tee: sandbox: SCP03 control emulator doc: describe the scp03 command cmd/Kconfig | 8 +++++ cmd/Makefile | 3 ++ cmd/scp03.c | 48 +++++++++++++++++++++++++++++ common/Kconfig | 8 +++++ common/Makefile | 1 + common/scp03.c | 53 +++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + doc/usage/scp03.rst | 33 ++++++++++++++++++++ drivers/tee/optee/Kconfig | 6 ++++ drivers/tee/sandbox.c | 60 ++++++++++++++++++++++++++++++++++-- include/scp03.h | 21 +++++++++++++ include/tee/optee_ta_scp03.h | 21 +++++++++++++ 12 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 cmd/scp03.c create mode 100644 common/scp03.c create mode 100644 doc/usage/scp03.rst create mode 100644 include/scp03.h create mode 100644 include/tee/optee_ta_scp03.h