diff mbox series

[v2,4/9] efi_loader: ease the file path check for public key

Message ID 20210727091054.512050-5-takahiro.akashi@linaro.org
State New
Headers show
Series efi_loader: capsule: improve capsule authentication support | expand

Commit Message

AKASHI Takahiro July 27, 2021, 9:10 a.m. UTC
The check for CONFIG_EFI_CAPSULE_KEY_PATH:
    ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")
does not allow users to specify a relative path for including a public
key binary. This is fine for most of all cases, but it will make it
difficult to add pytest test cases as pre-created keys/certificates
are placed in "test" directory.

So just ease the check, still causing an error if the specified file
does not exist at compiling efi_capsule_key.S.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

---
 lib/efi_loader/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.31.0

Comments

Heinrich Schuchardt Aug. 1, 2021, 9:35 a.m. UTC | #1
On 7/27/21 11:10 AM, AKASHI Takahiro wrote:
> The check for CONFIG_EFI_CAPSULE_KEY_PATH:

>      ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")

> does not allow users to specify a relative path for including a public

> key binary. This is fine for most of all cases, but it will make it

> difficult to add pytest test cases as pre-created keys/certificates

> are placed in "test" directory.

>

> So just ease the check, still causing an error if the specified file

> does not exist at compiling efi_capsule_key.S.

>

> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

> ---

>   lib/efi_loader/Makefile | 5 +++--

>   1 file changed, 3 insertions(+), 2 deletions(-)

>

> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile

> index 9b369430e258..fca0da4d131e 100644

> --- a/lib/efi_loader/Makefile

> +++ b/lib/efi_loader/Makefile

> @@ -21,8 +21,9 @@ targets += helloworld.o

>   endif

>

>   ifeq ($(CONFIG_EFI_CAPSULE_AUTHENTICATE),y)

> -EFI_CAPSULE_KEY_PATH := $(subst $\",,$(CONFIG_EFI_CAPSULE_KEY_PATH))

> -ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")

> +#EFI_CAPSULE_KEY_PATH := $(subst $\",,$(CONFIG_EFI_CAPSULE_KEY_PATH))

> +#ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")


Please, remove these two comment lines.

> +ifeq ($(CONFIG_EFI_CAPSULE_KEY_PATH),"")

>   $(error .esl cerificate not found. Configure your CONFIG_EFI_CAPSULE_KEY_PATH)


%s/cerificate/certificate/

Best regards

Heinrich

>   endif

>   endif

>
AKASHI Takahiro Aug. 2, 2021, 4:50 a.m. UTC | #2
On Sun, Aug 01, 2021 at 11:35:15AM +0200, Heinrich Schuchardt wrote:
> On 7/27/21 11:10 AM, AKASHI Takahiro wrote:

> > The check for CONFIG_EFI_CAPSULE_KEY_PATH:

> >      ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")

> > does not allow users to specify a relative path for including a public

> > key binary. This is fine for most of all cases, but it will make it

> > difficult to add pytest test cases as pre-created keys/certificates

> > are placed in "test" directory.

> > 

> > So just ease the check, still causing an error if the specified file

> > does not exist at compiling efi_capsule_key.S.

> > 

> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

> > ---

> >   lib/efi_loader/Makefile | 5 +++--

> >   1 file changed, 3 insertions(+), 2 deletions(-)

> > 

> > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile

> > index 9b369430e258..fca0da4d131e 100644

> > --- a/lib/efi_loader/Makefile

> > +++ b/lib/efi_loader/Makefile

> > @@ -21,8 +21,9 @@ targets += helloworld.o

> >   endif

> > 

> >   ifeq ($(CONFIG_EFI_CAPSULE_AUTHENTICATE),y)

> > -EFI_CAPSULE_KEY_PATH := $(subst $\",,$(CONFIG_EFI_CAPSULE_KEY_PATH))

> > -ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")

> > +#EFI_CAPSULE_KEY_PATH := $(subst $\",,$(CONFIG_EFI_CAPSULE_KEY_PATH))

> > +#ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")

> 

> Please, remove these two comment lines.


I forgot to do so.

> > +ifeq ($(CONFIG_EFI_CAPSULE_KEY_PATH),"")

> >   $(error .esl cerificate not found. Configure your CONFIG_EFI_CAPSULE_KEY_PATH)

> 

> %s/cerificate/certificate/


This misspelling does exist in the original.
I won't fix it.

-Takahiro Akashi


> Best regards

> 

> Heinrich

> 

> >   endif

> >   endif

> > 

>
diff mbox series

Patch

diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index 9b369430e258..fca0da4d131e 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -21,8 +21,9 @@  targets += helloworld.o
 endif
 
 ifeq ($(CONFIG_EFI_CAPSULE_AUTHENTICATE),y)
-EFI_CAPSULE_KEY_PATH := $(subst $\",,$(CONFIG_EFI_CAPSULE_KEY_PATH))
-ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")
+#EFI_CAPSULE_KEY_PATH := $(subst $\",,$(CONFIG_EFI_CAPSULE_KEY_PATH))
+#ifeq ("$(wildcard $(EFI_CAPSULE_KEY_PATH))","")
+ifeq ($(CONFIG_EFI_CAPSULE_KEY_PATH),"")
 $(error .esl cerificate not found. Configure your CONFIG_EFI_CAPSULE_KEY_PATH)
 endif
 endif