From mboxrd@z Thu Jan 1 00:00:00 1970 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 73AF7C433EF for ; Wed, 16 Feb 2022 02:20:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6CADB83845; Wed, 16 Feb 2022 03:20:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="tqQ3vyJ3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7A4518388F; Wed, 16 Feb 2022 03:20:49 +0100 (CET) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 D2CCE8349B for ; Wed, 16 Feb 2022 03:20:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x431.google.com with SMTP id l19so943902pfu.2 for ; Tue, 15 Feb 2022 18:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Xz30sgY2FKQWrnZUFgmVP6zoRqbyZNMyS6SMpTrHJAY=; b=tqQ3vyJ31CnwFgY0ty9fg85pUn0LD5Y6jdjutK7eWCKCYBNX6qt7ihGO++RcYE6F73 M0Qupdah/YFuiTsvDx6HgFXTFClYF+MR2McanjUJj1wsRVqvuF7s2LKm9TN8+AAcsiX+ l7SmFi+fcEJICDftmfBqYyKFaoIM4gEkgee9NabE6ZOaUZWmAHFEd+ikJ41BtYbUKwCR HXv5CMImLiERES83WxVNqnTO1BxcPlSVkef2joLEihE2QCl3ZGSgdJTYaU9YqzdAuzh8 1W9t+B/rP7gWoA85v1EYDVowZFY6WK6ctaSya9DMdvNc3zrOUqktSgWPk5WUaAD5ylog 53BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Xz30sgY2FKQWrnZUFgmVP6zoRqbyZNMyS6SMpTrHJAY=; b=h39ZLUCYF61OKU+K/j75xXK3jCwjYdV6FvB9pZjnJrJqpmeCsXlQeHjL2VA4ay77Nq JUuCtccj5OjVo5IjmoGo9/5ycLLz+MX+TaehF1Q6nS2av0DP7SVCpETS+0p831Vl12ng XOMUrOikq/sqIHbGdAn1QVZn+L95Fm9GHOahrNIpoFP/hRWIt+0JX0v23AGvaJdDbGUu oUY7v61z9Ly3UFBqpL71pVg3ADSuIfhg8u59H4JVbnwTxKjyFqVLMeKn5ASb+yp2JuiN IMXYXXVhEoYBrhplwPsKpLYe0mgz45x90hBGmGjWCKRiZJYyFSCRqDPN3wRpNhtthnMQ Gn9g== X-Gm-Message-State: AOAM530OhOJS99Se7M6qWxYCZzAgB5itRJu7II6EFxFBoJ1ZQo7+IPds /WcZl4VI1/t6DtWqFGiC48VFJA== X-Google-Smtp-Source: ABdhPJxK9fKSzt8ECyKa5bBhTvwsBYkW8GzSqIKiGvtvEv6jbfMl+4LQMxfGY+a4HU1bbUWv+7KvJA== X-Received: by 2002:aa7:8256:0:b0:4e0:78ad:eb81 with SMTP id e22-20020aa78256000000b004e078adeb81mr701324pfn.30.1644978044160; Tue, 15 Feb 2022 18:20:44 -0800 (PST) Received: from laputa ([2400:4050:c3e1:100:21fe:bed8:d751:b2c0]) by smtp.gmail.com with ESMTPSA id nl8sm10334915pjb.18.2022.02.15.18.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 18:20:43 -0800 (PST) Date: Wed, 16 Feb 2022 11:20:40 +0900 From: AKASHI Takahiro To: Ilias Apalodimas Cc: xypron.glpk@gmx.de, u-boot@lists.denx.de Subject: Re: [PATCH 2/2] test/py: efi_secboot: adjust secure boot tests to code changes Message-ID: <20220216022040.GB42868@laputa> Mail-Followup-To: AKASHI Takahiro , Ilias Apalodimas , xypron.glpk@gmx.de, u-boot@lists.denx.de References: <20220211073750.733348-1-ilias.apalodimas@linaro.org> <20220211073750.733348-2-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211073750.733348-2-ilias.apalodimas@linaro.org> 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.5 at phobos.denx.de X-Virus-Status: Clean Heinrich, We (I and Ilias) are still discussing on this patch. I don't think it appropriate to merge it (in -rc2) at this point. -Takahiro Akashi On Fri, Feb 11, 2022 at 09:37:50AM +0200, Ilias Apalodimas wrote: > The previous patch is changing U-Boot's behavior wrt certificate based > binary authentication. Specifically an image who's digest of a > certificate is found in dbx is now rejected. Fix the test accordingly > and add another one testing signatures in reverse order > > Signed-off-by: Ilias Apalodimas > --- > changes since RFC: > - Added another test cases checking signature hashes in reverse order > test/py/tests/test_efi_secboot/test_signed.py | 30 +++++++++++++++++-- > 1 file changed, 28 insertions(+), 2 deletions(-) > > diff --git a/test/py/tests/test_efi_secboot/test_signed.py b/test/py/tests/test_efi_secboot/test_signed.py > index 0aee34479f55..cc9396a11d48 100644 > --- a/test/py/tests/test_efi_secboot/test_signed.py > +++ b/test/py/tests/test_efi_secboot/test_signed.py > @@ -186,7 +186,7 @@ class TestEfiSignedImage(object): > assert 'Hello, world!' in ''.join(output) > > with u_boot_console.log.section('Test Case 5c'): > - # Test Case 5c, not rejected if one of signatures (digest of > + # Test Case 5c, rejected if one of signatures (digest of > # certificate) is revoked > output = u_boot_console.run_command_list([ > 'fatload host 0:1 4000000 dbx_hash.auth', > @@ -195,7 +195,8 @@ class TestEfiSignedImage(object): > output = u_boot_console.run_command_list([ > 'efidebug boot next 1', > 'efidebug test bootmgr']) > - assert 'Hello, world!' in ''.join(output) > + assert '\'HELLO\' failed' in ''.join(output) > + assert 'efi_start_image() returned: 26' in ''.join(output) > > with u_boot_console.log.section('Test Case 5d'): > # Test Case 5d, rejected if both of signatures are revoked > @@ -209,6 +210,31 @@ class TestEfiSignedImage(object): > assert '\'HELLO\' failed' in ''.join(output) > assert 'efi_start_image() returned: 26' in ''.join(output) > > + # Try rejection in reverse order. > + u_boot_console.restart_uboot() > + with u_boot_console.log.section('Test Case 5e'): > + # Test Case 5e, authenticated even if only one of signatures > + # is verified. Same as before but reject dbx_hash1.auth only > + output = u_boot_console.run_command_list([ > + 'host bind 0 %s' % disk_img, > + 'fatload host 0:1 4000000 db.auth', > + 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db', > + 'fatload host 0:1 4000000 KEK.auth', > + 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK', > + 'fatload host 0:1 4000000 PK.auth', > + 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK', > + 'fatload host 0:1 4000000 db1.auth', > + 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize db', > + 'fatload host 0:1 4000000 dbx_hash1.auth', > + 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx']) > + assert 'Failed to set EFI variable' not in ''.join(output) > + output = u_boot_console.run_command_list([ > + 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed_2sigs -s ""', > + 'efidebug boot next 1', > + 'efidebug test bootmgr']) > + assert '\'HELLO\' failed' in ''.join(output) > + assert 'efi_start_image() returned: 26' in ''.join(output) > + > def test_efi_signed_image_auth6(self, u_boot_console, efi_boot_env): > """ > Test Case 6 - using digest of signed image in database > -- > 2.32.0 >