From patchwork Fri Jul 10 00:27:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1326285 X-Patchwork-Delegate: xypron.glpk@gmx.de 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Lyx/GZSV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4B2v5N730Fz9sQt for ; Fri, 10 Jul 2020 10:27:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 346EB81B98; Fri, 10 Jul 2020 02:27:50 +0200 (CEST) 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="Lyx/GZSV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6773D81B9D; Fri, 10 Jul 2020 02:27:48 +0200 (CEST) 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,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 4099681B95 for ; Fri, 10 Jul 2020 02:27:45 +0200 (CEST) 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-pl1-x62f.google.com with SMTP id d10so1518706pll.3 for ; Thu, 09 Jul 2020 17:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rIXEQv3+MFR6RX4Dv/+OGqSVUZ7bFC8EbRWap5awnKw=; b=Lyx/GZSVuV6X5KibXqjytHkjPsoXmWXJyU7xDLKsM4sDFS1KoawsWHEGyNJo8Wi3Gj k/UjyfE11+7F09hjs92I8UYeF9rdWHGJAJjOXfkpiHKaxraOOO4LKNDx5s5l0YNdZ7nw 5raXvEZ2ubSU+gkZxM9ifiT6G2nvnRUzYuhU2BwyFaFd9yGQZ15qINeax8jzinW3+kVi jx71ev+gJmTbgKz///OCSL8FfNlKs3G7KPyEQkw2t64C0RkZstjNHTw/FBknWKjN1VQO UaSY2ZIPbyKRtWCRBkOoEGtJbrJN78O2WqhySGRWCTxpffq2zxSHL0MecxMxJ679tm3k BzDA== 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=rIXEQv3+MFR6RX4Dv/+OGqSVUZ7bFC8EbRWap5awnKw=; b=ZPbTIAPykmwkQaces+jFtpUbKxGmytheJ3KdaNsWcju87O1LBGWva/2ZHEK3L8JqEE w0zqp/keFTYnvAAE89WzcUYV3UEt51zVPJMWCd4QfX51OBAIq8aVQX6Bro9yI2mAu4Jq 5yFeZSzJ+t7DIZgdpXACPzKkGtHNbPqDzNyfQkPoXbFydJf7UND9kzc9Cq6xNDB8ODdU VV64jWaqUqfg3YMQLLkirWzbt6r2pHftBSuRjC21NJA6NxCtjspLeI0CYvBWwU/9QLqZ 6BnAN1m3AVf10MJEim+q9bmkXkOZj8YaPYm9sVkufeta+iIkPMb5H4EAzLDAFGQcrH/j 9QfA== X-Gm-Message-State: AOAM531Egz6jRhT9NAM6Aj3FeroqTLxBHVVXtU+0echCMsGMXirWw9W7 OukCBGtdZmXQPlKpG7dPGgExEoAgeqeNsA== X-Google-Smtp-Source: ABdhPJwgn5mS2Hl+jMNlaQftfBU6jA893oMmDDpUH0Gjd6611s/bAi3gMoBqcD46BhEGEQVGdoy9jg== X-Received: by 2002:a17:90b:1386:: with SMTP id hr6mr2727476pjb.93.1594340863847; Thu, 09 Jul 2020 17:27:43 -0700 (PDT) Received: from localhost.localdomain (p6e421564.tkyea130.ap.so-net.ne.jp. [110.66.21.100]) by smtp.gmail.com with ESMTPSA id 202sm3709421pfw.84.2020.07.09.17.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 17:27:43 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH] test/py: efi_secboot: fix Test Case 6c Date: Fri, 10 Jul 2020 09:27:29 +0900 Message-Id: <20200710002729.26929-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.27.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 As the commit cb7116030aff ("efi_loader: time based authentication") fixed the timestamp handling, Test Case 6c has no longer worked as expected. So adjust the timestamp of "dbx" variable. Signed-off-by: AKASHI Takahiro --- test/py/tests/test_efi_secboot/conftest.py | 4 +++- test/py/tests/test_efi_secboot/test_signed.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/py/tests/test_efi_secboot/conftest.py b/test/py/tests/test_efi_secboot/conftest.py index 94c50f6cf7ca..b74640240318 100644 --- a/test/py/tests/test_efi_secboot/conftest.py +++ b/test/py/tests/test_efi_secboot/conftest.py @@ -141,7 +141,9 @@ def efi_boot_env(request, u_boot_config): check_call('cd %s; %shash-to-efi-sig-list helloworld.efi.signed db_hello_signed.hash; %ssign-efi-sig-list -c KEK.crt -k KEK.key db db_hello_signed.hash db_hello_signed.auth' % (mnt_point, EFITOOLS_PATH, EFITOOLS_PATH), shell=True) - check_call('cd %s; %ssign-efi-sig-list -c KEK.crt -k KEK.key dbx db_hello_signed.hash dbx_hello_signed.auth' + # 'sleep 2' here because timestamp should be newer than dbx_db.auth + # See Test Case 6c + check_call('cd %s; sleep 2; %ssign-efi-sig-list -c KEK.crt -k KEK.key dbx db_hello_signed.hash dbx_hello_signed.auth' % (mnt_point, EFITOOLS_PATH), shell=True) diff --git a/test/py/tests/test_efi_secboot/test_signed.py b/test/py/tests/test_efi_secboot/test_signed.py index 7531bbac6a5f..8b1e132c756c 100644 --- a/test/py/tests/test_efi_secboot/test_signed.py +++ b/test/py/tests/test_efi_secboot/test_signed.py @@ -237,8 +237,6 @@ class TestEfiSignedImage(object): with u_boot_console.log.section('Test Case 6c'): # Test Case 6c, rejected by image's digest in dbx output = u_boot_console.run_command_list([ - 'fatload host 0:1 4000000 db.auth', - 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db', 'fatload host 0:1 4000000 dbx_hello_signed.auth', 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx']) assert 'Failed to set EFI variable' not in ''.join(output)