Skip to content

rsa: extend rsa_verify() for UEFI secure boot

Tom Rini u-boot 3 versions – New

Get series with b4
b4 am 20200221171841.GO18302@bill-the-cat

Versions newest first · linked by author and title

  1. v7 Latest7 patches 0 repliesNew
  2. v6 posting 2/20 of 7 patches 0 repliesSuperseded
  3. v6 posting 1/20 of 7 patches 0 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7lib: rsa: decouple rsa from FIT image verification+0 -00 replies
2/7rsa: add CONFIG_RSA_VERIFY_WITH_PKEY config+0 -00 replies
3/7include: image.h: add key info to image_sign_info+0 -00 replies
4/7lib: rsa: generate additional parameters for public key+0 -00 replies
5/7lib: rsa: add rsa_verify_with_pkey()+0 -00 replies
6/7test: add rsa_verify() unit test+0 -00 replies
7/7test: enable RSA library test on sandbox+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 0/7] rsa: extend rsa_verify() for UEFI secure boot
Quoted 16 lines · AKASHI Takahiro

# This patch set is a prerequisite for UEFI secure boot.

The current rsa_verify() requires five parameters for a RSA public key for efficiency while RSA, in theory, requires only two. In addition, those parameters are expected to come from FIT image.

So this function won't fit very well when we want to use it for the purpose of implementing UEFI secure boot, in particular, image authentication as well as variable authentication, where the essential two parameters are set to be retrieved from one of X509 certificates in signature database.

So, in this patch, additional three parameters will be calculated on the fly when rsa_verify() is called without fdt which should contain parameters above.

Quoted 7 lines

This calculation heavily relies on "big-number (or multi-precision) library." Therefore some routines from BearSSL[1] under MIT license are imported in this implementation. See Patch#4.
# Please let me know if this is not appropriate.

Prerequisite:
* public key parser in my "import x509/pkcs7 parser" patch[2]

This has been applied a long while back.

And for the record, without http://patchwork.ozlabs.org/patch/1239098/
applied sandbox fails to build. I had said I would take care of that specific issue, so I'm just noting it here. I'm kicking off a larger test now.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200221/3593699f/attachment.sig>