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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9557DC433F5 for ; Thu, 4 Nov 2021 01:14:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5898D611AE for ; Thu, 4 Nov 2021 01:14:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5898D611AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8EBA483664; Thu, 4 Nov 2021 02:14:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au 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=traverse.com.au header.i=@traverse.com.au header.b="FcU4LiWU"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="jk7QsZDA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA97B8365A; Thu, 4 Nov 2021 02:14:15 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 51C4783645 for ; Thu, 4 Nov 2021 02:14:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matt@traverse.com.au Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 887F85C00D0; Wed, 3 Nov 2021 21:14:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 03 Nov 2021 21:14:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=traverse.com.au; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=sV//766mViq7i SJKRBfTHdf00mz34lpC78PUA1KZJVk=; b=FcU4LiWU1xRF9vTx0oQIuyE7xlg6s a09CGEqMt7S4F4YRzLTd6bP8PSPYR8jgAGU7MTR0nw6sK/zt6lRomnd91QnFfKal yOrKd7/GVMx0tTCO4388Bsyh07SjsAFNNyxbZtfwgYpSCWIEIhRpuoSO/JaBzw6G /sKXAysIbl9oMZK7hi20X40Ao80evLDyvAOJP/IxVjbu+nMKA1cLLRBlWdp09ij0 z40Dp9N1CrVQnxMNk2Pyuse+ndGDgqaX3JyKXVy0YbNXzrFDyXszGIQWIpkFLERa GnSWhvjbFiRSAb7Kp5KDqha8F60+cFdfLfxsEK+GSw5m6mpqt8yfOJqJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=sV//766mViq7iSJKRBfTHdf00mz34lpC78PUA1KZJVk=; b=jk7QsZDA h+Gcc7HWSMAoHyya1g4raVNVxA4NNyOGChQ/JOv0HXyRfXVfvA1wmER2LZQl3Ygb 2yR56iUiy0Et1qlfMzf3BA7r79jX34OcIzSkfDKdX0QfvVCtYVWIxVXSTftFZPKt Nc+FOdqIb0B3rMhF2vpeKIePvHUN5+zBjW+kRQ8qPDXBxjPm8I8hjWMOBdHox1iP VAKWOyp6GTKGN4jGJmssZLr3AqGj4CUtlXT/QUQaUMIUnNg6C52aGdz+aFM4Wjus uIzsOobiOeuiXhw35Dy0itAxbaB83q+mAndgpS1F3+DDTJk3+/GsIh9Mu+RU4I9C taQOMFNDIaILPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdefgddvlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrthhhvgif ucfotgeurhhiuggvuceomhgrthhtsehtrhgrvhgvrhhsvgdrtghomhdrrghuqeenucggtf frrghtthgvrhhnpeekleevteelvdduheetgfdvfeelueekffeggeethedtteeljeeivedv gfehjeejheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrghtthesthhrrghvvghrshgvrdgtohhmrdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Nov 2021 21:14:03 -0400 (EDT) From: Mathew McBride To: u-boot@lists.denx.de, Ilias Apalodimas , Simon Glass Cc: Mathew McBride Subject: [PATCH 2/6] cmd: tpm-v1: fix load_key_by_sha1 compile errors Date: Thu, 4 Nov 2021 01:12:49 +0000 Message-Id: <20211104011253.4401-3-matt@traverse.com.au> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20211104011253.4401-1-matt@traverse.com.au> References: <20211104011253.4401-1-matt@traverse.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean This command is not compiled by default and has not been updated alongside changes to the tpmv1 API, such as passing the TPM udevice to the relevant functions. Signed-off-by: Mathew McBride --- cmd/tpm-v1.c | 10 +++++----- lib/tpm-v1.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/tpm-v1.c b/cmd/tpm-v1.c index 55f2aeff46..bf238a9f2e 100644 --- a/cmd/tpm-v1.c +++ b/cmd/tpm-v1.c @@ -406,9 +406,9 @@ static int do_tpm_load_key_by_sha1(struct cmd_tbl *cmdtp, int flag, int argc, void *key; struct udevice *dev; - rc = get_tpm(&dev); - if (rc) - return rc; + err = get_tpm(&dev); + if (err) + return err; if (argc < 5) return CMD_RET_USAGE; @@ -420,7 +420,7 @@ static int do_tpm_load_key_by_sha1(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; parse_byte_string(argv[4], usage_auth, NULL); - err = tpm_find_key_sha1(usage_auth, parent_hash, &parent_handle); + err = tpm1_find_key_sha1(dev, usage_auth, parent_hash, &parent_handle); if (err) { printf("Could not find matching parent key (err = %d)\n", err); return CMD_RET_FAILURE; @@ -428,7 +428,7 @@ static int do_tpm_load_key_by_sha1(struct cmd_tbl *cmdtp, int flag, int argc, printf("Found parent key %08x\n", parent_handle); - err = tpm_load_key2_oiap(parent_handle, key, key_len, usage_auth, + err = tpm1_load_key2_oiap(dev, parent_handle, key, key_len, usage_auth, &key_handle); if (!err) { printf("Key handle is 0x%x\n", key_handle); diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c index 8dc144080c..22a769c587 100644 --- a/lib/tpm-v1.c +++ b/lib/tpm-v1.c @@ -840,7 +840,7 @@ u32 tpm1_find_key_sha1(struct udevice *dev, const u8 auth[20], unsigned int i; /* fetch list of already loaded keys in the TPM */ - err = tpm_get_capability(dev, TPM_CAP_HANDLE, TPM_RT_KEY, buf, + err = tpm1_get_capability(dev, TPM_CAP_HANDLE, TPM_RT_KEY, buf, sizeof(buf)); if (err) return -1; @@ -852,7 +852,7 @@ u32 tpm1_find_key_sha1(struct udevice *dev, const u8 auth[20], /* now search a(/ the) key which we can access with the given auth */ for (i = 0; i < key_count; ++i) { buf_len = sizeof(buf); - err = tpm_get_pub_key_oiap(key_handles[i], auth, buf, &buf_len); + err = tpm1_get_pub_key_oiap(dev, key_handles[i], auth, buf, &buf_len); if (err && err != TPM_AUTHFAIL) return -1; if (err) -- 2.30.1