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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 D1EBCC433EF for ; Sat, 11 Sep 2021 14:22:08 +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 2C26B611BF for ; Sat, 11 Sep 2021 14:22:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C26B611BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 47126837EC; Sat, 11 Sep 2021 16:22:05 +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="uCTtdPoc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 604C1837A0; Sat, 11 Sep 2021 16:22:03 +0200 (CEST) Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) (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 B9431837A0 for ; Sat, 11 Sep 2021 16:21:59 +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=ilias.apalodimas@linaro.org Received: by mail-yb1-xb31.google.com with SMTP id z5so10300389ybj.2 for ; Sat, 11 Sep 2021 07:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7baKQx4JtlZt3RyrwGmAFv+djuKdtrxSW0LrRRYFZK4=; b=uCTtdPocYxxJ1dPCu02zVKPIo277d3+d2KL1d3C/V/s2R+HppWET3FJDaArV9l4XIb cM2CZDFA5TxjgdCANFwtNNXtxKidujUNpl8QbYSNOsEChouq2gspcIwPreVETskEr8FC V5LFPTMJd3pOT5ns4IDp9pKVizNbKF2AmU18gZE8A5z+Y3RfbZEdj42jGZkcGncoG7Hw bi/9UsE0eYBkQrC8N004xySl1CTljg9RnikzqT9mfdr2LeQgVKeZ0CqzhdcHaJXY7n3E D3drH1TFgRH26UVD2aGyUJVRs0IO9de907qUYiVspYAfZ4jv6pu2hFaYVU1+2EFsoEcj z3Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7baKQx4JtlZt3RyrwGmAFv+djuKdtrxSW0LrRRYFZK4=; b=3UIdQQZc4gfeA/yzl3rvytYbM3G8fjrFupOofVbXtR0+6oENOKokNr/LbBOv1opejk hsjPmLl0be38swmbUao1eg+YSvE2FWM0OvJMyorpACvbCcfD/o40Cpx+JaD4l1tQiGc5 mGPFEB9F6lnrnYCKDngVwA+gJ3EcKh+J171OJJo+h+YUpaRdOknkFyWfnl8vxyjqasK5 NrzBYriB4KCQBXp+oPRVjp5CJo+MDhM3bRWDMz5QAeN65NBe1lNCDT/yLQRV4bPJ14uu L81N2LIhxiNKvIU+N5v2cYUcWW2+Ehi04ApPCBTnm1XBwTV729esIqsGCaD16KSLJoiL xxCQ== X-Gm-Message-State: AOAM533EJGyspY6qE7adrJPtoysldJKfdwSd2sQYvZ6MzgatDXMUF4Z6 YFf/nNRIkPQ5B4Bbo+RH2zu5vUWDjsxHi4P+bBivtw== X-Google-Smtp-Source: ABdhPJy+UPprVknhviNJOZLJJp2rg4uL875pc3XWoGn/OOrrGnOm6PcgJGHVqpprrmytLUaZEcRmLNSxbJKLopUdUAY= X-Received: by 2002:a05:6902:1544:: with SMTP id r4mr4166286ybu.180.1631370118314; Sat, 11 Sep 2021 07:21:58 -0700 (PDT) MIME-Version: 1.0 References: <20210911072832.16991-1-xypron.glpk@gmx.de> <20210911072832.16991-3-xypron.glpk@gmx.de> In-Reply-To: From: Ilias Apalodimas Date: Sat, 11 Sep 2021 17:21:22 +0300 Message-ID: Subject: Re: [PATCH 2/4] efi_loader: function to get GUID for variable name To: Heinrich Schuchardt Cc: U-Boot Mailing List , AKASHI Takahiro , Sughosh Ganu , Masahisa Kojima , Alexander Graf Content-Type: text/plain; charset="UTF-8" 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 On Sat, 11 Sept 2021 at 17:13, Ilias Apalodimas wrote: > > On Sat, Sep 11, 2021 at 09:28:30AM +0200, Heinrich Schuchardt wrote: > > In multiple places we need the default GUID used for variables like > > 'PK', 'KEK', 'db'. Provide a function for it. > > > > Signed-off-by: Heinrich Schuchardt > > --- > > include/efi_variable.h | 8 ++++++++ > > lib/efi_loader/efi_var_common.c | 9 +++++++++ > > 2 files changed, 17 insertions(+) > > > > diff --git a/include/efi_variable.h b/include/efi_variable.h > > index 8f666b2309..03a3ecb235 100644 > > --- a/include/efi_variable.h > > +++ b/include/efi_variable.h > > @@ -256,6 +256,14 @@ efi_status_t efi_init_secure_state(void); > > enum efi_auth_var_type efi_auth_var_get_type(const u16 *name, > > const efi_guid_t *guid); > > > > +/** > > + * efi_auth_var_get_guid() - get the predefined GUID for a variable name > > + * > > + * @name: name of UEFI variable > > + * Return: guid of UEFI variable > > + */ > > +const efi_guid_t *efi_auth_var_get_guid(const u16 *name); > > + > > /** > > * efi_get_next_variable_name_mem() - Runtime common code across efi variable > > * implementations for GetNextVariable() > > diff --git a/lib/efi_loader/efi_var_common.c b/lib/efi_loader/efi_var_common.c > > index e179932124..3cbb7c96c2 100644 > > --- a/lib/efi_loader/efi_var_common.c > > +++ b/lib/efi_loader/efi_var_common.c > > @@ -385,6 +385,15 @@ enum efi_auth_var_type efi_auth_var_get_type(const u16 *name, > > return EFI_AUTH_VAR_NONE; > > } > > > > +const efi_guid_t *efi_auth_var_get_guid(const u16 *name) > > +{ > > + for (size_t i = 0; i < ARRAY_SIZE(name_type); ++i) { > > + if (!u16_strcmp(name, name_type[i].name)) > > + return name_type[i].guid; > > + } > > + return &efi_global_variable_guid; Actually looking at the following patch, shouldn't this be NULL? > > +} > > + > > /** > > * efi_get_var() - read value of an EFI variable > > * > > -- > > 2.30.2 > > > > Reviewed-by: Ilias Apalodimas