From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH v3 01/13] lib/crypto, efi_loader: avoid multiple inclusions of header files
Date: Thu, 9 Jul 2020 09:47:58 +0900 [thread overview]
Message-ID: <20200709004758.GA1075@laputa> (raw)
In-Reply-To: <3ec2058f-58cc-85df-421d-101df4b73d97@gmx.de>
Heinrich,
On Wed, Jul 08, 2020 at 12:29:54PM +0200, Heinrich Schuchardt wrote:
> On 08.07.20 07:01, AKASHI Takahiro wrote:
> > By adding extra symbols, we can now avoid including x509_parser and
> > pkcs7_parser.h files multiple times.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > ---
> > lib/efi_loader/efi_image_loader.c | 1 +
> > lib/efi_loader/efi_signature.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
> > index 06a2ebdb9081..5b00fea2f113 100644
> > --- a/lib/efi_loader/efi_image_loader.c
> > +++ b/lib/efi_loader/efi_image_loader.c
> > @@ -14,6 +14,7 @@
> > #include <pe.h>
> > #include <sort.h>
> > #include <crypto/pkcs7_parser.h>
> > +#include <crypto/x509_parser.h>
> > #include <linux/err.h>
> >
> > const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
> > diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c
> > index e05c471c61ce..da3818ac62e2 100644
> > --- a/lib/efi_loader/efi_signature.c
> > +++ b/lib/efi_loader/efi_signature.c
> > @@ -11,6 +11,7 @@
> > #include <hexdump.h>
> > #include <malloc.h>
> > #include <crypto/pkcs7_parser.h>
> > +#include <crypto/x509_parser.h>
> > #include <linux/compat.h>
> > #include <linux/oid_registry.h>
> > #include <u-boot/rsa.h>
> >
The patch (and the commit message) seems to have been
somehow corrupted during my rework.
> I would prefer to use
>
> [PATCH 1/1] lib/crypto: use qualified path for x509_parser.h
> https://lists.denx.de/pipermail/u-boot/2020-July/419214.html
My point is, as I said before, that we should include a header
*directly* if some symbols in that header are used in a given file
even though such a header is *indirectly* inherited by another
header, pkcs7_parser.h in this case.
That way, "#include" explicitly indicates that the C file relies on
another header and associated functions.
I always take this practice.
In this sense, this patch still makes sense.
-Takahiro Akashi
>
> which has the same effect.
>
> Best regards
>
> Heinrich
next prev parent reply other threads:[~2020-07-09 0:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 5:01 [PATCH v3 00/13] efi_loader: rework/improve UEFI secure boot code AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 01/13] lib/crypto, efi_loader: avoid multiple inclusions of header files AKASHI Takahiro
2020-07-08 10:29 ` Heinrich Schuchardt
2020-07-09 0:47 ` AKASHI Takahiro [this message]
2020-07-08 5:01 ` [PATCH v3 02/13] efi_loader: image_loader: add a check against certificate type of authenticode AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 03/13] efi_loader: image_loader: retrieve authenticode only if it exists AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 04/13] efi_loader: signature: fix a size check against revocation list AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 05/13] efi_loader: signature: make efi_hash_regions more generic AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 06/13] efi_loader: image_loader: verification for all signatures should pass AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 07/13] efi_loader: image_loader: add digest-based verification for signed image AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 08/13] test/py: efi_secboot: apply autopep8 AKASHI Takahiro
2020-07-08 5:01 ` [PATCH v3 09/13] test/py: efi_secboot: more fixes against pylint AKASHI Takahiro
2020-07-08 5:02 ` [PATCH v3 10/13] test/py: efi_secboot: split "signed image" test case-1 into two cases AKASHI Takahiro
2020-07-08 5:02 ` [PATCH v3 11/13] test/py: efi_secboot: add a test against certificate revocation AKASHI Takahiro
2020-07-08 5:02 ` [PATCH v3 12/13] test/py: efi_secboot: add a test for multiple signatures AKASHI Takahiro
2020-07-08 5:02 ` [PATCH v3 13/13] test/py: efi_secboot: add a test for verifying with digest of signed image AKASHI Takahiro
2020-07-11 6:47 ` Heinrich Schuchardt
2020-07-13 0:20 ` AKASHI Takahiro
2020-07-08 16:40 ` [PATCH v3 00/13] efi_loader: rework/improve UEFI secure boot code 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=20200709004758.GA1075@laputa \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.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