All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC 0/3] rsa: extend rsa_verify() for UEFI secure boot
@ 2019-09-06  7:08 AKASHI Takahiro
  2019-09-06  7:08 ` [U-Boot] [RFC 1/3] lib: rsa: decouple rsa from FIT image verification AKASHI Takahiro
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: AKASHI Takahiro @ 2019-09-06  7:08 UTC (permalink / raw)
  To: u-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.

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#2.
# Please let me know if this is not appropriate.

# Checkpatch will complain with lots of warnings/errors, but
# I intentionally don't fix them for maximum maintainability.

  [1] https://bearssl.org/

AKASHI Takahiro (3):
  lib: rsa: decouple rsa from FIT image verification
  lib: rsa: generate additional parameters for public key
  lib: rsa: add rsa_verify_with_pkey()

 include/u-boot/rsa-mod-exp.h |   3 +
 lib/rsa/Kconfig              |  14 +
 lib/rsa/Makefile             |   3 +-
 lib/rsa/rsa-keyprop.c        | 631 +++++++++++++++++++++++++++++++++++
 lib/rsa/rsa-verify.c         |  63 +++-
 5 files changed, 705 insertions(+), 9 deletions(-)
 create mode 100644 lib/rsa/rsa-keyprop.c

-- 
2.21.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-10-28  0:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  7:08 [U-Boot] [RFC 0/3] rsa: extend rsa_verify() for UEFI secure boot AKASHI Takahiro
2019-09-06  7:08 ` [U-Boot] [RFC 1/3] lib: rsa: decouple rsa from FIT image verification AKASHI Takahiro
2019-09-06  7:39   ` Heinrich Schuchardt
2019-09-06  9:26     ` AKASHI Takahiro
2019-09-06  7:08 ` [U-Boot] [RFC 2/3] lib: rsa: generate additional parameters for public key AKASHI Takahiro
2019-09-17  5:48   ` Simon Glass
2019-09-18  2:35     ` AKASHI Takahiro
2019-10-03  7:34   ` Ilias Apalodimas
2019-10-03  8:58     ` AKASHI Takahiro
2019-10-03 13:37       ` Heinrich Schuchardt
2019-09-06  7:08 ` [U-Boot] [RFC 3/3] lib: rsa: add rsa_verify_with_pkey() AKASHI Takahiro
2019-09-17  5:48   ` Simon Glass
2019-09-18  3:03     ` AKASHI Takahiro
2019-10-03  5:48       ` AKASHI Takahiro
2019-10-22 13:50       ` Simon Glass
2019-10-23  5:44         ` AKASHI Takahiro
2019-10-27 16:31           ` Simon Glass
2019-10-28  0:43             ` AKASHI Takahiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.