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 E51ACC433FE for ; Sat, 11 Sep 2021 14:13:14 +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 371AC6101A for ; Sat, 11 Sep 2021 14:13:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 371AC6101A 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 4BC61837EE; Sat, 11 Sep 2021 16:13:12 +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="vKlupURu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF759837F0; Sat, 11 Sep 2021 16:13:10 +0200 (CEST) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (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 C81EF837ED for ; Sat, 11 Sep 2021 16:13:06 +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-ej1-x62a.google.com with SMTP id jg16so10417573ejc.1 for ; Sat, 11 Sep 2021 07:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g36Y03PbDjfndbElEAkWIfc9tT/ahStPLQEMu2jR8B0=; b=vKlupURu7lOleCMnh6RUYCXRkaZUDIjLvwAtoNDLPTHQB5WXv0004Wtdtjy9QTVd9P 0sMANkJnaPq3w01vnXl0X/A2VbMXc/SW7k+kWjaBeAN6BDFPsLzdj8ZZIaksaDHG1YSx kDIBZChHcUXJmAPXL31P40Ql0T6yJ6owS4w+gf/9EjKThboBWE1u/vbz3pihB4+d+jwQ XJOpRoPim2lmZEOkQVQZgl3Te2MfRzcK8Wh9ante5ILAcXESmRliMKO+cpENoLLIgrxL 6N14JAjiBort/3M0XWNdlMI2SPXdvvhwYOoBJzJlRPjEOhaDEyvqXFNQaZhsavbI1BMD znvg== 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:references :mime-version:content-disposition:in-reply-to; bh=g36Y03PbDjfndbElEAkWIfc9tT/ahStPLQEMu2jR8B0=; b=o1hRtwWDqo5GQ0L8qHJ6rkTlL226J+ZqkiZmCsgPtLoXDVXHxOSwL6DfD0/IhlPSdI jl0Ip1md4TE2Qly8IZEmgxF3Jd7h39WEtyFfBlTbpuuCfrPne8HqKClaJIEF92DzQZ+1 vAxmxa1P+fbma6mfIkdXfMKy+c2cDMPK2ZRd+KKgZgO0XZoNNJ5MXbWwJzqN/2GIVgpY pTmmsrv3zTPDplDo3Hj4jl5bsWS25oG1fPOU1/e9EoKi8SKq7tcMiJDsqe+B74w6BFr9 EV7WfGD4TjQLfDd3URAb102iVCjmE0pnEKj5bwzBvmWRJ5EXGQToU3LBhQaqhaMYJNba UFeA== X-Gm-Message-State: AOAM5337pade/E+8REDctEfHHGs2KaG9FhMLfBSuWtl20RjHJVHMqhSF hU5AInpeFu8mP7PQK2W9I2n3tQ== X-Google-Smtp-Source: ABdhPJzO48nb6vCU1DOoF314JxZtKKnTwXqAoH8djwB0GX47devKuFlKWM99sBPMda5IcmuQvPZ35A== X-Received: by 2002:a17:906:16d1:: with SMTP id t17mr3072996ejd.360.1631369586436; Sat, 11 Sep 2021 07:13:06 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-137.home.otenet.gr. [94.66.220.137]) by smtp.gmail.com with ESMTPSA id r16sm1000974edt.15.2021.09.11.07.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 07:13:06 -0700 (PDT) Date: Sat, 11 Sep 2021 17:13:03 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, AKASHI Takahiro , Sughosh Ganu , Masahisa Kojima , Alexander Graf Subject: Re: [PATCH 2/4] efi_loader: function to get GUID for variable name Message-ID: References: <20210911072832.16991-1-xypron.glpk@gmx.de> <20210911072832.16991-3-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210911072832.16991-3-xypron.glpk@gmx.de> 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, 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; > +} > + > /** > * efi_get_var() - read value of an EFI variable > * > -- > 2.30.2 > Reviewed-by: Ilias Apalodimas