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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFCDDC4727E for ; Fri, 25 Sep 2020 18:30:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3C40208A9 for ; Fri, 25 Sep 2020 18:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727733AbgIYSaF (ORCPT ); Fri, 25 Sep 2020 14:30:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:52744 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbgIYSaF (ORCPT ); Fri, 25 Sep 2020 14:30:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2CEBBAD6B; Fri, 25 Sep 2020 18:30:04 +0000 (UTC) Date: Fri, 25 Sep 2020 20:30:02 +0200 From: Petr Vorel To: ltp@lists.linux.it Cc: Lakshmi Ramasubramanian , Mimi Zohar , Jarkko Sakkinen , linux-integrity@vger.kernel.org Subject: Re: [PATCH 3/4] ima_tpm.sh: Fix calculating boot aggregate Message-ID: <20200925183002.GA14078@dell5510> Reply-To: Petr Vorel References: <20200925174439.9534-1-pvorel@suse.cz> <20200925174439.9534-4-pvorel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200925174439.9534-4-pvorel@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Hi, ... > test1() > { > tst_res TINFO "verify boot aggregate" > - local zero="0000000000000000000000000000000000000000" > local tpm_bios="$SECURITYFS/tpm0/binary_bios_measurements" > - local ima_measurements="$ASCII_MEASUREMENTS" > - local boot_aggregate boot_hash line > + local cmd="evmctl ima_boot_aggregate" > + local boot_aggregate cmd zero > - # IMA boot aggregate > - read line < $ima_measurements > - boot_hash=$(echo $line | awk '{print $(NF-1)}' | cut -d':' -f2) > + if [ "$MISSING_EVMCTL" = 1 ]; then > + if [ -f "$tpm_bios" ]; then > + tst_res TCONF "missing $tpm_bios, $ERRMSG_EVMCTL" > + return > + fi > + cmd="ima_boot_aggregate" This is supposed to be: cmd="ima_boot_aggregate -f $tpm_bios" + there are other needed fixes => v2 needed. Kind regards, Petr From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Vorel Date: Fri, 25 Sep 2020 20:30:02 +0200 Subject: [LTP] [PATCH 3/4] ima_tpm.sh: Fix calculating boot aggregate In-Reply-To: <20200925174439.9534-4-pvorel@suse.cz> References: <20200925174439.9534-1-pvorel@suse.cz> <20200925174439.9534-4-pvorel@suse.cz> Message-ID: <20200925183002.GA14078@dell5510> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it Hi, ... > test1() > { > tst_res TINFO "verify boot aggregate" > - local zero="0000000000000000000000000000000000000000" > local tpm_bios="$SECURITYFS/tpm0/binary_bios_measurements" > - local ima_measurements="$ASCII_MEASUREMENTS" > - local boot_aggregate boot_hash line > + local cmd="evmctl ima_boot_aggregate" > + local boot_aggregate cmd zero > - # IMA boot aggregate > - read line < $ima_measurements > - boot_hash=$(echo $line | awk '{print $(NF-1)}' | cut -d':' -f2) > + if [ "$MISSING_EVMCTL" = 1 ]; then > + if [ -f "$tpm_bios" ]; then > + tst_res TCONF "missing $tpm_bios, $ERRMSG_EVMCTL" > + return > + fi > + cmd="ima_boot_aggregate" This is supposed to be: cmd="ima_boot_aggregate -f $tpm_bios" + there are other needed fixes => v2 needed. Kind regards, Petr