Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10229C678D5 for ; Wed, 8 Mar 2023 13:20:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BC2D85D45; Wed, 8 Mar 2023 14:20:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="ICyuQtQz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0686F84EC7; Tue, 7 Mar 2023 23:13:52 +0100 (CET) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (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 7629F85C45 for ; Tue, 7 Mar 2023 23:13:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=fr0st61te@gmail.com Received: by mail-lf1-x135.google.com with SMTP id i28so19098085lfv.0 for ; Tue, 07 Mar 2023 14:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678227228; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GMW/IQ7dezHSNV5z8yQnrR1e2LHzgCJB8GY102zoF0w=; b=ICyuQtQzRWaC3PWzwNKWAk75xMu1rNN5U/B80AgR9sEIZlb9E9syDpv0B3YYf+CnZv E4jNFmukosRsEzUjY+pdq4aaBHBrraXprcS5FIlzM5QAwdSbYGlz5GbA9wyOWQ9bc75D AZeAVK88jIrgTI/0fN7sRJUrdleOSzREmHMtJV1MZO5mqmtzeeHnVkvZx3RHHO4sBUfC xYMTlDhuGtoDJBx4zMjedXhkMErZ8SrlMyaAOCalhop3KxQhLobL/uqTxnLAVd8dfeRJ Yl2ZYlaBjG9oBeQ/TNY3g9iFdzNsFnpuh1wr+RFCjuutOZgMWggp6hSV/LIgA4Zwq0rx veww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678227228; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GMW/IQ7dezHSNV5z8yQnrR1e2LHzgCJB8GY102zoF0w=; b=X23xZW7ryMxijAIy5JB3XyU86q6fgcGEUoxELUpSFX8Gpv+CGqUTVDrRxkpY+RvUM6 ot2ebS9JvMZWvIhhg6iE0Ugyksur2bYy0jOXMMWcP3Kqqm30GmrSXs66BkQV6o+IxcWh wwjSarXPt6hX0jKneWMg4NcYOl48u8YStLbxAPSsSMqKfnuSqX1YMdmVNFTImOF2fTGI wDklE4PT7eFlO3a2fCiZ+ZKrbEe4K1aaBz7xnp5xM28fk1zFURzypW+/rzNTQnSw+W6h VrHfN8sDgy8PWwhmK9UmQTU5bXWHnre5jd2dL7gBbdodITrTy5FBObEEtsS5OYmHnzx8 O5gw== X-Gm-Message-State: AO0yUKV7Bm63Wsyr9BdcbuIXtMMuOyVfat6DBE6IPgMe8g63ouauekO9 S09gllLqx/s6pcPDh/9t5N8= X-Google-Smtp-Source: AK7set/6AkUQyYI1l/P/3+ShyoDoc4klkINwnrKxQfJCciUo6emapeX6mS9GSU8rhglBo41aFoXKYw== X-Received: by 2002:ac2:559a:0:b0:4dc:8129:2700 with SMTP id v26-20020ac2559a000000b004dc81292700mr4373059lfg.54.1678227228556; Tue, 07 Mar 2023 14:13:48 -0800 (PST) Received: from localhost.localdomain (95-31-185-99.broadband.corbina.ru. [95.31.185.99]) by smtp.googlemail.com with ESMTPSA id l8-20020a19c208000000b004db3890cb53sm2159726lfc.223.2023.03.07.14.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 14:13:48 -0800 (PST) From: Ivan Mikhaylov To: Simon Glass , Jan Kiszka Cc: u-boot@lists.denx.de, Ivan Mikhaylov Subject: [PATCH v2 0/5] Introduce new sign binman's option Date: Wed, 8 Mar 2023 01:13:37 +0000 Message-Id: <20230308011342.21992-1-fr0st61te@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 08 Mar 2023 14:20:15 +0100 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 This patch introduces prototype of new sign binman's option. Enhancing the sign procedure, as example: mkimage -G privateky -r -o sha256,rsa4096 -F fit.fit binman replace -i flash.bin -f fit.fit fit into: binman sign -i flash.bin -k privatekey -a sha256,rsa4096 -f fit.fit fit It works with extracted FIT container and image, which provides key signing of FIT container and replacing of it in directed image. Also it is possible to sign exact FIT container in place. As example: binman sign -i flash.bin -k privatekey -a sha256,rsa4096 -f fit Add fdt_add_pubkey utility which provides possibility of add pub keys into DTB. This one needed mostly for test coverage of binman sign option but could be useful when private and pub keys are separated. Depends on "binman: Support updating section contents". Ivan Mikhaylov (3): binman: add documentation for binman sign option binman: add sign option for binman binman: add tests for sign option Roman Kopytin (2): tools: add fdt_add_pubkey test_vboot.py: include test of fdt_add_pubkey tool test/py/tests/test_vboot.py | 8 ++ tools/.gitignore | 1 + tools/Makefile | 3 + tools/binman/binman.rst | 18 ++++ tools/binman/cmdline.py | 13 +++ tools/binman/control.py | 29 +++++- tools/binman/etype/fit.py | 18 ++++ tools/binman/etype/section.py | 3 + tools/binman/ftest.py | 61 +++++++++++++ tools/binman/test/277_fit_sign.dts | 63 +++++++++++++ tools/fdt_add_pubkey.c | 138 +++++++++++++++++++++++++++++ 11 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/277_fit_sign.dts create mode 100644 tools/fdt_add_pubkey.c -- 2.39.1