u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	 Sughosh Ganu <sughosh.ganu@linaro.org>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	 Alexander Graf <agraf@csgraf.de>
Subject: Re: [PATCH 2/4] efi_loader: function to get GUID for variable name
Date: Sat, 11 Sep 2021 17:21:22 +0300	[thread overview]
Message-ID: <CAC_iWj+N-RodTPHzWsLXQ6n7Qj+Hjx9eZ8V75t_-OHUJh7u4qQ@mail.gmail.com> (raw)
In-Reply-To: <YTy5bxXAIPE5xbP+@apalos.home>

On Sat, 11 Sept 2021 at 17:13, Ilias Apalodimas
<ilias.apalodimas@linaro.org> 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 <xypron.glpk@gmx.de>
> > ---
> >  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 <ilias.apalodimas@linaro.org>

  reply	other threads:[~2021-09-11 14:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11  7:28 [PATCH 0/4] efi_loader: centralize known vendor GUIDs Heinrich Schuchardt
2021-09-11  7:28 ` [PATCH 1/4] efi_loader: treat UEFI variable name as const Heinrich Schuchardt
2021-09-11 14:10   ` Ilias Apalodimas
2021-09-12 19:19     ` Heinrich Schuchardt
2021-09-11  7:28 ` [PATCH 2/4] efi_loader: function to get GUID for variable name Heinrich Schuchardt
2021-09-11 14:13   ` Ilias Apalodimas
2021-09-11 14:21     ` Ilias Apalodimas [this message]
2021-09-11  7:28 ` [PATCH 3/4] efi_loader: simplify efi_sigstore_parse_sigdb() Heinrich Schuchardt
2021-09-11 14:25   ` Ilias Apalodimas
2021-09-12 19:16     ` Heinrich Schuchardt
2021-09-12 19:23       ` Ilias Apalodimas
2021-10-01 16:42         ` Heinrich Schuchardt
2021-10-01 19:08           ` Ilias Apalodimas
2021-09-11  7:28 ` [PATCH 4/4] efi_loader: simplify tcg2_measure_secure_boot_variable() Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC_iWj+N-RodTPHzWsLXQ6n7Qj+Hjx9eZ8V75t_-OHUJh7u4qQ@mail.gmail.com \
    --to=ilias.apalodimas@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=masahisa.kojima@linaro.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).