public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 00/11] import x509/pkcs7 parsers from linux
Date: Wed, 23 Oct 2019 15:43:07 +0900	[thread overview]
Message-ID: <20191023064305.GD10448@linaro.org> (raw)
In-Reply-To: <20191018123523.GX16029@bill-the-cat>

Tom,

On Fri, Oct 18, 2019 at 08:35:23AM -0400, Tom Rini wrote:
> On Fri, Oct 18, 2019 at 05:36:28PM +0900, AKASHI Takahiro wrote:
> > Hi Tom,
> > 
> > On Thu, Oct 17, 2019 at 11:23:21AM -0400, Tom Rini wrote:
> > > On Tue, Oct 15, 2019 at 06:25:19PM +0900, AKASHI Takahiro wrote:
> > > > On Tue, Oct 15, 2019 at 07:33:18AM +0200, Heinrich Schuchardt wrote:
> > > > > On 10/15/19 5:18 AM, AKASHI Takahiro wrote:
> > > > > >On Sat, Oct 12, 2019 at 03:02:09PM +0200, Heinrich Schuchardt wrote:
> > > > > >>On 10/11/19 9:55 AM, AKASHI Takahiro wrote:
> > > > > >>>I hope this patch set will be reviewed promptly as I'm aiming to
> > > > > >>>push my "UEFI secure boot" patch for v2020.01.
> > > > > >>>
> > > > > >>
> > > > > >>How can I make all of these new files being built to check for build
> > > > > >>warnings?
> > > > > >
> > > > > >As always in my case of UEFI secure boot, they have gone through build and
> > > > > >run/tests as part of UEFI secure boot. This is also true for RSA
> > > > > >extension as UEFI secure boot is the only user of those features.
> > > > > 
> > > > > Did you run them through Travis?
> > > > 
> > > > As far as this patch set is concerned, no configuration enables
> > > > any of kconfig options listed below and running Travis doesn't make sense.
> > > 
> > > That's a problem that needs to be fixed.  I am not OK with the idea of
> > > adding a new feature that will not be put through our CI and so when
> > > things break it (which will happen, inadvertently) it won't be caught
> > > until much later.  Figuring out how to extend our CI to test this is a
> > > must.  Thanks!
> > 
> > I added a simple *unit* test under "test/lib."
> > As I said before, however, no existing configuration enables either
> >    CONFIG_X509_CERTIFICATE_PARSER, nor
> >    CONFIG_PKCS7_MESSAGE_PARSER
> > 
> > and the related code won't be built or exercised in any way.
> > So I made a small trick to Kconfig:
> > 
> > === 8< ===
> > config UT_LIB
> >         bool "Unit tests for library functions"
> >         depends on UNIT_TEST
> >         default y
> >         help
> >           Enables the 'ut lib' command which tests library functions like
> >           memcat(), memcyp(), memmove().
> > 
> > if UT_LIB
> > 
> > config UT_LIB_ASN1
> >         bool "Unit test for asn1 compiler and decoder function"
> >         default y
> >         imply ASYMMETRIC_KEY_TYPE
> >         imply ASYMMETRIC_PUBLIC_KEY_SUBTYPE
> >         imply X509_CERTIFICATE_PARSER
> >         imply PKCS7_MESSAGE_PARSER
> >         imply RSA_PUBLIC_KEY_PARSER
> >         help
> >           Enables a test which exercises asn1 compiler and decoder function
> >           via various parsers.
> > 
> > endif
> > === >8 ===
> > 
> > So as long as UT_LIB is enabled and run by one of Travis CI test cases,
> > a new test for ASN1 will also be exercised.
> > (I don't know which one will invoke "ut" command.)
> > 
> > Do you agree to this approach?

I'd like to confirm exactly what you suggested here:

> I think you're going to need to get a bit more familiar with some
> aspects of testing and building.  Today, CONFIG_UNIT_TEST is enabled for
> sandbox.  And we want as much as possible enabled on sandbox as that's
> also where coverity scan is performed.

Is this ("as much as possible") true? I wonder how it should be achieved.

As far as my RSA test approach above is concerned,
1) If UT_TEST is enabled, UT_LIB and then UT_LIB_ASN1 are also
   enabled *by default* and expected to be run automatically through
   Travis's sandbox build with test/py even if, say, X509_CERTIRFFICATE_PARSER
   is *not* enabled in any of sandbox_*_defconfig.
   Is this approach is OK for you?

Or,
2) Should we add ASYMMETRIC_*/X509_CERTIFICATE_PARSER/PKCS7_MESSAGE_PARSER
   to one (or all) of sandbox_*_defconfig (even though there is no explicit
   user of these features before my secure boot patch will be merged)?
Or,
3) Should we create a new sandbox_*_defconfig for any further tests?
Or,
4) Would we better set ASYMMETRIC_*/X509_CERTIFICATE_PARSER/PKCS7_MESSAGE_PARSER
   enabled by default on Sandbox? I mean,
=== 8< ===
menuconfig ASYMMETRIC_KEY_TYPE
	bool "Asymmetric (public-key cryptographic) key Support"
	default y if SANDBOX	<== added

if ASYMMETRIC_KEY_TYPE
...
config X509_CERTIFICATE_PARSER
        bool "RSA public key parser"
        depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
	default y if SANDBOX	<== added
...
=== >8 ===

> So that will get us part of the
> way forward here longer term.  I think however you're going to also need
> to enable some tests on the QEMU platforms so that we can have all of
> this new secure boot code put through CI there.  Thanks!

Are you talking about this patch set(asn1 parsers) or is this your
general comment on my overall "UEFI secure boot" patch?

Please note that my secure boot patch is architecture agnostic and  will
perfectly work on Sandbox and all the related py tests will also be done
on Sandbox.

Thanks,
-Takahiro Akashi


> -- 
> Tom

      reply	other threads:[~2019-10-23  6:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11  7:41 [U-Boot] [PATCH v1 00/11] import x509/pkcs7 parsers from linux AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 01/11] linux_compat: add kmemdup() AKASHI Takahiro
2019-10-12 11:22   ` Heinrich Schuchardt
2019-10-17  3:04     ` AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 02/11] include: time.h: define time64_t AKASHI Takahiro
2019-10-12 11:40   ` Heinrich Schuchardt
2019-10-17  5:39     ` AKASHI Takahiro
2019-10-17  5:51       ` Heinrich Schuchardt
2019-10-11  7:41 ` [U-Boot] [PATCH v1 03/11] include: kernel.h: include printk.h AKASHI Takahiro
2019-10-12 11:47   ` Heinrich Schuchardt
2019-10-17  5:58     ` AKASHI Takahiro
2019-10-17  6:17       ` AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 04/11] cmd: add asn1_compiler AKASHI Takahiro
2019-10-12 12:22   ` Heinrich Schuchardt
2019-10-17  6:25     ` AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 05/11] Makefile: add build script for asn1 parsers AKASHI Takahiro
2019-10-12 12:36   ` Heinrich Schuchardt
2019-10-17  6:40     ` AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 06/11] lib: add asn1 decoder AKASHI Takahiro
2019-10-12 12:29   ` Heinrich Schuchardt
2019-10-17  7:02     ` AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 07/11] lib: add oid registry utility AKASHI Takahiro
2019-10-12 12:58   ` Heinrich Schuchardt
2019-10-11  7:41 ` [U-Boot] [PATCH v1 08/11] lib: crypto: add public key utility AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 09/11] lib: crypto: add x509 parser AKASHI Takahiro
2019-10-11  7:41 ` [U-Boot] [PATCH v1 10/11] lib: crypto: add pkcs7 message parser AKASHI Takahiro
2019-10-11  7:42 ` [U-Boot] [PATCH v1 11/11] lib: crypto: add rsa public key parser AKASHI Takahiro
2019-10-12 13:11   ` Heinrich Schuchardt
2019-10-11  7:55 ` [U-Boot] [PATCH v1 00/11] import x509/pkcs7 parsers from linux AKASHI Takahiro
2019-10-12 13:02   ` Heinrich Schuchardt
2019-10-15  3:18     ` AKASHI Takahiro
2019-10-15  5:33       ` Heinrich Schuchardt
2019-10-15  8:56         ` AKASHI Takahiro
2019-10-15 11:10           ` Heinrich Schuchardt
2019-10-15  9:25         ` AKASHI Takahiro
2019-10-17 15:23           ` Tom Rini
2019-10-18  8:36             ` AKASHI Takahiro
2019-10-18 12:35               ` Tom Rini
2019-10-23  6:43                 ` AKASHI Takahiro [this message]

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=20191023064305.GD10448@linaro.org \
    --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