u-boot/lib/rsa
mario.six@gdsys.cc 2b9ec762c4 rsa: Fix return value and masked error
When signing images, we repeatedly call fit_add_file_data() with
successively increasing size values to include the keys in the DTB.

Unfortunately, if large keys are used (such as 4096 bit RSA keys), this
process fails sometimes, and mkimage needs to be called repeatedly to
integrate the keys into the DTB.

This is because fit_add_file_data actually returns the wrong error
code, and the loop terminates prematurely, instead of trying again with
a larger size value.

This patch corrects the return value by fixing the return value of
fdt_add_bignum, fixes a case where an error is masked by a unconditional
setting of a return value variable, and also removes a error message,
which is misleading, since we actually allow the function to fail. A
(hopefully helpful) comment is also added to explain the lack of error
message.

This is probably related to 1152a05 ("tools: Correct error handling in
fit_image_process_hash()") and the corresponding error reported here:

https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html

Signed-off-by: Mario Six <mario.six@gdsys.cc>
2016-07-22 14:46:24 -04: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: Use checksum algorithms from struct hash_algo 2015-01-29 17:09:59 -07:00
rsa-mod-exp.c rsa: Split the rsa-verify to separate the modular exponentiation 2015-01-29 17:09:58 -07:00
rsa-sign.c rsa: Fix return value and masked error 2016-07-22 14:46:24 -04:00
rsa-verify.c rsa: Use checksum algorithms from struct hash_algo 2015-01-29 17:09:59 -07:00