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 8D054C64EC4 for ; Wed, 8 Mar 2023 13:21:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A6D0085DCF; Wed, 8 Mar 2023 14:20:41 +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="YOsUTdS7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 88E3085C47; Tue, 7 Mar 2023 23:13:56 +0100 (CET) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (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 E1A4885C31 for ; Tue, 7 Mar 2023 23:13:52 +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-x12c.google.com with SMTP id g17so19026600lfv.4 for ; Tue, 07 Mar 2023 14:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678227232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mw1Mt4U5oieR31aMwtJW2H3w0J7F0uJeiLCmSBUfuG4=; b=YOsUTdS70biiE9PSEU7YpUOk4eB2aypYyTMtilTmYHAnCAtIUGxdyVaSrtideNaLIG F8Q6yD/jLnxT91RzLA5WZBquOmCGcfQaX+EKeo3oT4KCmG63YrTm19HOpinZ/zJzfgM0 LH6PlwTGYbzMKIkb5AdqR9y594BsuJ+f+4wgpn0K0SKAuE2Zv5k7IyFvqDAEk80mt2gR qg1xU+Yhnti3lni6kG7xgQERucikY4yG+qZ5JQoGARLNcA1+1bi/++GOW2fSvr7y5tWY MjN/hgzNQNue+Xb88AnaCKOjnUnEacgo/j/zZj0ga/k3/5mg++y+uAc0JKbApsAoEB6d lgMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678227232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mw1Mt4U5oieR31aMwtJW2H3w0J7F0uJeiLCmSBUfuG4=; b=F73nK2cQwaf2sEs4RxMMfv5TIuXBMkwwyHLtWPM8gc8Mji9ovIfm1rSXxXoGuSD22B ntxOOOSp3wlZNsLP12p8ZCY8b3ZScYAO33xzmiAgNAroPQLAEevxl6umgtsc++sEmO2y ZiINHgXw+gV/32UYwUusGmK68FLIolZyCz6ciKEImCeuL/k/boWYGcb42+BjQ82phBNz 0Go2wi+UmIZo2gRdm7f9Twjdd1BQC48aQeEji8PYkgzWsYAkSBdVIK/0pxD4Waxp30yg Bf20IZGbgrT7hDfdNNOWlqMS81Gn09BdlgR/KJCvFfkxX+iqk11aEh9o0GDwrmI4vN/K j05g== X-Gm-Message-State: AO0yUKVkkvbC7hk4KKXbKou12F3/g874eM+8VWTYu2gpw/+Tao2G3ZlF YD9I4T17y9Vem+UR0wPtmb0= X-Google-Smtp-Source: AK7set/c45rHolXOeYZWEotrXXAqowVIavyYLzbTPceALYxfH43QN4hYRdovOMNz84iZPyJ0lLQuMA== X-Received: by 2002:ac2:5637:0:b0:4d5:716a:1c05 with SMTP id b23-20020ac25637000000b004d5716a1c05mr4100753lff.12.1678227232324; Tue, 07 Mar 2023 14:13:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 14:13:52 -0800 (PST) From: Ivan Mikhaylov To: Simon Glass , Jan Kiszka Cc: u-boot@lists.denx.de, Roman Kopytin , Rasmus Villemoes Subject: [PATCH v2 5/5] test_vboot.py: include test of fdt_add_pubkey tool Date: Wed, 8 Mar 2023 01:13:42 +0000 Message-Id: <20230308011342.21992-6-fr0st61te@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230308011342.21992-1-fr0st61te@gmail.com> References: <20230308011342.21992-1-fr0st61te@gmail.com> 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 From: Roman Kopytin Signed-off-by: Roman Kopytin Cc: Rasmus Villemoes --- test/py/tests/test_vboot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py index e3e7ca4b21..956b8fcd43 100644 --- a/test/py/tests/test_vboot.py +++ b/test/py/tests/test_vboot.py @@ -313,6 +313,13 @@ def test_vboot(u_boot_console, name, sha_algo, padding, sign_options, required, util.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', dtb]) + # Create a fresh .dtb without the public keys + dtc('sandbox-u-boot.dts') + # Then add the dev key via the fdt_add_pubkey tool + util.run_and_log(cons, [fdt_add_pubkey, '-a', '%s,rsa2048' % sha_algo, + '-k', tmpdir, '-n', 'dev', '-r', 'conf', dtb]) + util.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', dtb]) + if full_test: # Make sure that U-Boot checks that the config is in the list of # hashed nodes. If it isn't, a security bypass is possible. @@ -500,6 +507,7 @@ def test_vboot(u_boot_console, name, sha_algo, padding, sign_options, required, mkimage = cons.config.build_dir + '/tools/mkimage' binman = cons.config.source_dir + '/tools/binman/binman' fit_check_sign = cons.config.build_dir + '/tools/fit_check_sign' + fdt_add_pubkey = cons.config.build_dir + '/tools/fdt_add_pubkey' dtc_args = '-I dts -O dtb -i %s' % tmpdir dtb = '%ssandbox-u-boot.dtb' % tmpdir sig_node = '/configurations/conf-1/signature' -- 2.39.1