public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>,
	Takahiro Akashi <takahiro.akashi@linaro.org>,
	Etienne Carriere <etienne.carriere@linaro.org>,
	Roger Knecht <rknecht@pm.me>,
	Chris Morgan <macromorgan@hotmail.com>, Stefan Roese <sr@denx.de>,
	Ovidiu Panait <ovidiu.panait@windriver.com>,
	Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Subject: Re: [PATCH v6 4/5] eficonfig: add UEFI Secure Boot Key enrollment interface
Date: Mon, 7 Nov 2022 15:27:31 +0200	[thread overview]
Message-ID: <Y2kHw1JHMTlBp5hm@hera> (raw)
In-Reply-To: <CADQ0-X-mnuLBw33Ho+mKOOP-yMeHxzOzBjFwjseknXg8_uF-nQ@mail.gmail.com>

Hi Kojima-san

[...]

> > > +     }
> > > +
> > > +     if (!file_have_auth_header(buf, size)) {
> >
> > Can you explain why we need this?  I would expect the user to prepare an
> > .esl file with ./tools/efivar.py
> 
> This is for the case that the user selects the .auth file
> signed by 'sign-efi-sig-list' tool.

Right that's what I imagined.  So we are trying to make sure the '-t'
option from sign-efi-sig-list is the user didn't since it's now mandatory
on the spec, right?

I get what you are trying to do here.  You basically want to make sure the
user will be allowed to enroll the keys in random order. IOW if the user
first enrolls a PK, the KEK, DB and DBX must be authenticated variables.
But if he started by enrolling DB(x) he can use with the .esl file
right ?(at least until PK is registered)

I don't think this is a bad idea, but I'd prefer being more pedantic here. 
I think we are better off *always* expecting .auth files and leave the decision
of accepting a timestamped authenticated variable or not to the core UEFI
subsystem, instead of shoehorning a timestamp.

Heirich, thoughts?

Thanks
/Ilias
> 
> Thanks,
> Masahisa Kojima
> 
> >
> > > +             struct efi_signature_store *sigstore;
> > > +             char *tmp_buf;
> > > +
> > > +             /* Check if the file is valid EFI Signature List(s) */
> > > +             tmp_buf = calloc(1, size);
> > > +             if (!tmp_buf) {
> > > +                     ret = EFI_OUT_OF_RESOURCES;
> > > +                     goto out;
> > > +             }
> > > +             memcpy(tmp_buf, buf, size);
> > > +             /* tmp_buf is freed in efi_build_signature_store() */
> > > +             sigstore = efi_build_signature_store(tmp_buf, size);
> > > +             if (!sigstore) {
> > > +                     eficonfig_print_msg("ERROR! Invalid file format.");
> > > +                     ret = EFI_INVALID_PARAMETER;
> > > +                     goto out;
> > > +             }
> > > +             efi_sigstore_free(sigstore);
> > > +
> > > +             ret = create_time_based_payload(buf, &new_db, &size);
> > > +             if (ret != EFI_SUCCESS) {
> > > +                     eficonfig_print_msg("ERROR! Failed to create payload with timestamp.");
> > > +                     goto out;
> > > +             }
> > > +
> > > +             free(buf);
> > > +             buf = new_db;
> > > +     }
> > > +
> > > +     attr = EFI_VARIABLE_NON_VOLATILE |
> > > +            EFI_VARIABLE_BOOTSERVICE_ACCESS |
> > > +            EFI_VARIABLE_RUNTIME_ACCESS |
> > > +            EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS;
> > > +
> > [...]
> >
> > Thanks
> > /Ilias

  reply	other threads:[~2022-11-07 13:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 10:43 [PATCH v6 0/5] eficonfig: add UEFI Secure Boot key maintenance interface Masahisa Kojima
2022-10-26 10:43 ` [PATCH v6 1/5] eficonfig: refactor eficonfig_select_file_handler() Masahisa Kojima
2022-11-04 15:12   ` Ilias Apalodimas
2022-11-07  2:31     ` Masahisa Kojima
2022-10-26 10:43 ` [PATCH v6 2/5] eficonfig: expose append entry function Masahisa Kojima
2022-11-04 15:16   ` Ilias Apalodimas
2022-11-07  2:32     ` Masahisa Kojima
2022-10-26 10:43 ` [PATCH v6 3/5] eficonfig: refactor change boot order implementation Masahisa Kojima
2022-11-04 22:08   ` Ilias Apalodimas
2022-11-07  3:18     ` Masahisa Kojima
2022-10-26 10:43 ` [PATCH v6 4/5] eficonfig: add UEFI Secure Boot Key enrollment interface Masahisa Kojima
2022-11-04 21:46   ` Ilias Apalodimas
2022-11-07  3:12     ` Masahisa Kojima
2022-11-07 13:27       ` Ilias Apalodimas [this message]
2022-11-07 13:37         ` Ilias Apalodimas
2022-10-26 10:43 ` [PATCH v6 5/5] eficonfig: add "Show/Delete Signature Database" menu entry Masahisa Kojima
  -- strict thread matches above, loose matches on Subject: below --
2022-11-09  3:28 [PATCH v6 0/5] eficonfig: add UEFI Secure Boot key maintenance interface Masahisa Kojima
2022-11-09  3:29 ` [PATCH v6 4/5] eficonfig: add UEFI Secure Boot Key enrollment interface Masahisa Kojima

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=Y2kHw1JHMTlBp5hm@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=ashok.reddy.soma@xilinx.com \
    --cc=etienne.carriere@linaro.org \
    --cc=macromorgan@hotmail.com \
    --cc=masahisa.kojima@linaro.org \
    --cc=ovidiu.panait@windriver.com \
    --cc=rknecht@pm.me \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --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