lib: rsa: fix padding_pss_verify 49/297449/2
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 31 Aug 2022 19:13:40 +0000 (21:13 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 21 Aug 2023 04:38:20 +0000 (04:38 +0000)
commit6ec366f5e79068232eb6a99a2e0b675ee617e972
treeddee02c729b6ee66098b98d6b38c27bdb7e084c2
parent780ceeebe4b126e302f59a6b194c0827744d97f3
lib: rsa: fix padding_pss_verify

Check the that the hash length is shorter than the message length. This
avoids:

    ./tools/../lib/rsa/rsa-verify.c:275:11: warning:
    ‘*db’ may be used uninitialized [-Wmaybe-uninitialized]
      275 |         db[0] &= 0xff >> leftmost_bits;

Fixes: 061daa0b61f0 ("rsa: add support of padding pss")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[sw0312.kim: backport upstream commit 0cd933bb4bd7 to remove build warning]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ia65f431ee3722af8b1f11b4e8e3033fc058df826
lib/rsa/rsa-verify.c