u-boot/lib/rsa
Andrew Duda da29f2991d rsa: Verify RSA padding programatically
Padding verification was done against static SHA/RSA pair arrays which
take up a lot of static memory, are mostly 0xff, and cannot be reused
for additional SHA/RSA pairings. The padding can be easily computed
according to PKCS#1v2.1 as:

  EM = 0x00 || 0x01 || PS || 0x00 || T

where PS is (emLen - tLen - 3) octets of 0xff and T is DER encoding
of the hash.

Store DER prefix in checksum_algo and create rsa_verify_padding
function to handle verification of a message for any SHA/RSA pairing.

Signed-off-by: Andrew Duda <aduda@meraki.com>
Signed-off-by: aduda <aduda@meraki.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-11-21 14:07:30 -05:00
..
Kconfig verified-boot: Minimal support for booting U-Boot proper from SPL 2016-06-12 13:14:58 -04:00
Makefile verified-boot: Minimal support for booting U-Boot proper from SPL 2016-06-12 13:14:58 -04:00
rsa-checksum.c rsa: Verify RSA padding programatically 2016-11-21 14:07:30 -05:00
rsa-mod-exp.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
rsa-sign.c tools, rsa: Further minor cleanups on top of c236ebd and 2b9ec7 2016-07-25 12:01:36 -04:00
rsa-verify.c rsa: Verify RSA padding programatically 2016-11-21 14:07:30 -05:00