From patchwork Tue Nov 21 07:00:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 745683 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1726055wrt; Mon, 20 Nov 2023 23:01:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IECoztIlX34UyWFQDgpSFH6nL5YB86182Utmhcr22C35YvHwJpAKDtIrmfgjvcSYh92nmst X-Received: by 2002:a17:906:5185:b0:9e6:da40:50bf with SMTP id y5-20020a170906518500b009e6da4050bfmr6510622ejk.8.1700550103423; Mon, 20 Nov 2023 23:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700550103; cv=none; d=google.com; s=arc-20160816; b=JEF+m/VUpgOhSpoEzAqrAspclHqoHYapAcfmXKcZDA7A89jzk+xRmv6wXcmf69xI4T s8YD1cvnkmS/wrKCicuWOMlycNYn0pTshL/lYtrvgZyoYCx5Inbz2SVu/a4nb5rEOFQ/ Nu6vLuGU0c/lnZuuQ3Z2bId+dmUdA5ydTgxjmK/D5z4TazGe8v/KEUHzhqomhToIsvAO YbU67EXAoVeuQYlhNTQ/G6x6pJvgVlO7AtvuCR4R82a/46xDRvd22pUO11ajI/KT4iaX gO4C7rZj2vibsmUldn32ZvgcDiGHPm2un/dZqTjwafhcVeLR7qhgpMOXKTVjWKnpyS9N Xx/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Noz5fuD30GZ5Uh1ze9AhpUw8lK+AApdt60YhO26r3V4=; fh=OiwEO3ecU/ysFuwJ4p/ZzPF8Vl0eoEBcm4GPxH0hI7s=; b=OkdS39KUY0nvj/ma6KnSgMfPkzrt0UK5W3orIVQC2oXo418f24TDJT+i/zMbdOVLj3 cnEIhDrjzMErxcVPwbGlY29EfyeO/z9XLUcs/fJkw8Y+Qtf2kkhuDiSs3XHtJMaYa0Xr 6PKefCTGFHJAV1g9r0Cs8sPa9A5Ew5SrJ4D6uxAup+sKuw7luEVGWMdgh8zZd2Yy+lz+ nCElJvywJ2sdened7haA8gGxr/2cE9vrBBo55eho8IDScaDHQCw3Kro/Lry6+225hB8q FSRNw60ErKVuFultYm2YIpD7DQi7L6WQ4Zdu0DpbQoh7vBiVi9P5VYa74J8PnyPFKLNi ALEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id w10-20020a170906b18a00b009e65813118dsi5123185ejy.241.2023.11.20.23.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 23:01:43 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E57DB87579; Tue, 21 Nov 2023 08:01:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id CB375867E2; Tue, 21 Nov 2023 08:00:58 +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=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 6255787440 for ; Tue, 21 Nov 2023 08:00:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B7361042; Mon, 20 Nov 2023 23:01:42 -0800 (PST) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F2073F7CE; Mon, 20 Nov 2023 23:00:53 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , Masahisa Kojima , Sughosh Ganu Subject: [PATCH 3/4] sandbox: capsule: Add a config file for generating capsules Date: Tue, 21 Nov 2023 12:30:27 +0530 Message-Id: <20231121070028.2614095-4-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231121070028.2614095-1-sughosh.ganu@linaro.org> References: <20231121070028.2614095-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Support has been added to the mkeficapsule tool to generate capsules by parsing the capsule parameters through a config file. Add a config file for generating capsules. These capsules will be used for testing the capsule update feature on sandbox platform. Enable generation of capsules through the config file on the sandbox variant. Signed-off-by: Sughosh Ganu --- configs/sandbox_defconfig | 2 + .../test_efi_capsule/sandbox_capsule_cfg.txt | 162 ++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index bc5bcb2a62..f42e01e100 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -344,6 +344,8 @@ CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y CONFIG_EFI_CAPSULE_AUTHENTICATE=y CONFIG_EFI_CAPSULE_ESL_FILE="board/sandbox/capsule_pub_esl_good.esl" +CONFIG_EFI_CAPSULE_CFG_FILE="test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt" +CONFIG_EFI_USE_CAPSULE_CFG_FILE=y CONFIG_EFI_SECURE_BOOT=y CONFIG_TEST_FDTDEC=y CONFIG_UNIT_TEST=y diff --git a/test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt b/test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt new file mode 100644 index 0000000000..2897c1904e --- /dev/null +++ b/test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt @@ -0,0 +1,162 @@ +{ + image-index: 1 + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test01 +} +{ + image-index: 2 + image-guid: 5A7021F5-FEF2-48B4-AABA-832E777418C0 + payload: u-boot.env.new + capsule: Test02 +} +{ + image-index: 1 + image-guid: 058B7D83-50D5-4C47-A195-60D86AD341C4 + payload: u-boot.bin.new + capsule: Test03 + +} +{ + image-index: 1 + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test04 + +} +{ + image-index: 1 + image-guid: 058B7D83-50D5-4C47-A195-60D86AD341C4 + payload: u-boot_bin_env.itb + capsule: Test05 + +} +{ + image-index: 1 + image-guid: 058B7D83-50D5-4C47-A195-60D86AD341C4 + payload: u-boot_bin_env.itb + capsule: Test05 +} +{ + image-index: 1 + monotonic-count: 1 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test11 +} +{ + image-index: 1 + monotonic-count: 1 + private-key: SIGNER2.key + pub-key-cert: SIGNER2.crt + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test12 +} +{ + image-index: 1 + monotonic-count: 1 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test13 +} +{ + image-index: 1 + monotonic-count: 1 + private-key: SIGNER2.key + pub-key-cert: SIGNER2.crt + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test14 +} +{ + image-index: 1 + fw-version: 5 + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test101 +} +{ + image-index: 2 + fw-version: 10 + image-guid: 5A7021F5-FEF2-48B4-AABA-832E777418C0 + payload: u-boot.env.new + capsule: Test102 +} +{ + image-index: 1 + fw-version: 2 + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test103 + +} +{ + image-index: 1 + fw-version: 5 + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test104 +} +{ + image-index: 1 + fw-version: 2 + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test105 + +} +{ + image-index: 1 + monotonic-count: 1 + fw-version: 5 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test111 +} +{ + image-index: 2 + monotonic-count: 1 + fw-version: 10 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 5A7021F5-FEF2-48B4-AABA-832E777418C0 + payload: u-boot.env.new + capsule: Test112 +} +{ + image-index: 1 + monotonic-count: 1 + fw-version: 2 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 09D7CF52-0720-4710-91D1-08469B7FE9C8 + payload: u-boot.bin.new + capsule: Test113 +} +{ + image-index: 1 + fw-version: 5 + monotonic-count: 1 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test114 +} +{ + image-index: 1 + fw-version: 2 + monotonic-count: 1 + private-key: SIGNER.key + pub-key-cert: SIGNER.crt + image-guid: 3673B45D-6A7C-46F3-9E60-ADABB03F7937 + payload: u-boot_bin_env.itb + capsule: Test115 +}