Skip to content
Snippets Groups Projects
  1. Oct 16, 2020
  2. Oct 15, 2020
  3. Oct 14, 2020
  4. Oct 13, 2020
    • Tom Rini's avatar
      Merge branch '2020-10-12-assorted-encryption-changes' · 55fca74a
      Tom Rini authored
      - Fix verified boot on BE targets
      - Add support for multiple required keys in verified boots
      - Add support for Initialization Vectors in AES keys in FIT images
      - Assorted fixes in the RSA code
      55fca74a
    • Heinrich Schuchardt's avatar
      lib: rsa: superfluous initialization in rsa_verify() · ec71cc34
      Heinrich Schuchardt authored and Tom Rini's avatar Tom Rini committed
      
      Remove initialization of ret with unused value.
      
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      ec71cc34
    • Rasmus Villemoes's avatar
      rsa: fix retrieving public exponent on big-endian systems · 3f8808eb
      Rasmus Villemoes authored and Tom Rini's avatar Tom Rini committed
      
      Commit fdf0819a (rsa: fix alignment issue when getting public
      exponent) changed the logic to avoid doing an 8-byte access to a
      possibly-not-8-byte-aligned address.
      
      However, using rsa_convert_big_endian is wrong: That function converts
      an array of big-endian (32-bit) words with the most significant word
      first (aka a BE byte array) to an array of cpu-endian words with the
      least significant word first. While the exponent is indeed _stored_ as
      a big-endian 64-bit word (two BE words with MSW first), we want to
      extract it as a cpu-endian 64 bit word. On a little-endian host,
      swapping the words and byte-swapping each 32-bit word works, because
      that's the same as byte-swapping the whole 64 bit word. But on a
      big-endian host, the fdt32_to_cpu are no-ops, but
      rsa_convert_big_endian() still does the word-swapping, breaking
      verified boot.
      
      To fix that, while still ensuring we don't do unaligned accesses, add
      a little helper that first memcpy's the bytes to a local fdt64_t, then
      applies fdt64_to_cpu(). [The name is chosen based on the
      [bl]eXX_to_cpup in linux/byteorder/generic.h].
      
      Fixes: fdf0819a ("rsa: fix alignment issue when getting public exponent")
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      3f8808eb
Loading