1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00
Files
u-boot-megous/lib
Heiko Stuebner fdf0819afb rsa: fix alignment issue when getting public exponent
To fill the exponent field of the rsa_public_key struct, rsa_mod_exp_sw
did a cast to uint64_t of the key_prop->public_exponent field.
But that alignment is not guaranteed in all cases.

This came to light when in my spl-fit-signature the key-name exceeded
a certain length and with it the verification then started failing.
(naming it "integrity" worked fine, "integrity-uboot" failed)

key_prop.public_exponent itself is actually a void-pointer, fdt_getprop()
also just returns such a void-pointer and inside the devicetree the 64bit
exponent is represented as 2 32bit numbers, so assuming a 64bit alignment
can lead to false reads.

So just use the already existing rsa_convert_big_endian() to do the actual
conversion from the dt's big-endian to the needed uint64 value.

Fixes: fc2f4246b4 ("rsa: Split the rsa-verify to separate the modular exponentiation")
Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-07 09:01:42 -04:00
..
2020-04-30 17:16:12 +08:00
2020-04-27 14:55:29 -04:00
2020-01-17 10:15:49 -05:00
2019-12-06 16:44:20 -05:00
2019-09-20 20:09:19 +02:00
2019-12-02 18:23:07 -05:00
2019-10-31 07:22:53 -04:00
2019-07-10 16:52:58 -06:00
2020-04-24 10:51:32 -04:00
2019-12-06 16:44:20 -05:00
2019-08-11 16:43:41 -04:00
2020-05-01 11:03:24 -04:00
2020-01-22 17:47:57 -05:00
2020-04-24 16:40:09 -04:00
2019-05-05 08:48:50 -04:00