Skip to content
Commit f2fe2abb authored by Joel Stanley's avatar Joel Stanley Committed by Tom Rini
Browse files

lib/rsa: Sanity check db_len



When building with GCC 12:

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

If msg_len or hash_len were nonsense values, db_len would end up invalid
and the rest of the function wil not work, so detect this case and
return early. If this was host code we could assert, but as this is
target code print an error and return.

Fixes: 061daa0b ("rsa: add support of padding pss")
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
parent 57fb86a9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment