16 Jan, 2018

1 commit


06 Nov, 2017

1 commit


22 Nov, 2016

3 commits

  • Remove the need to explicitly add SHA/RSA pairings. Invalid SHA/RSA
    pairings will still fail on verify operations when the hash length is
    longer than the key length.

    Follow the same naming scheme "checksum,crytpo" without explicitly
    defining the string.

    Indirectly adds support for "sha1,rsa4096" signing/verification.

    Signed-off-by: Andrew Duda
    Signed-off-by: aduda
    Reviewed-by: Simon Glass

    Andrew Duda
     
  • Cut down on the repetition of algorithm information by defining separate
    checksum and crypto structs. image_sig_algos are now simply pairs of
    unique checksum and crypto algos.

    Signed-off-by: Andrew Duda
    Signed-off-by: aduda
    Reviewed-by: Simon Glass

    Andrew Duda
     
  • Padding verification was done against static SHA/RSA pair arrays which
    take up a lot of static memory, are mostly 0xff, and cannot be reused
    for additional SHA/RSA pairings. The padding can be easily computed
    according to PKCS#1v2.1 as:

    EM = 0x00 || 0x01 || PS || 0x00 || T

    where PS is (emLen - tLen - 3) octets of 0xff and T is DER encoding
    of the hash.

    Store DER prefix in checksum_algo and create rsa_verify_padding
    function to handle verification of a message for any SHA/RSA pairing.

    Signed-off-by: Andrew Duda
    Signed-off-by: aduda
    Reviewed-by: Simon Glass

    Andrew Duda
     

14 Oct, 2016

1 commit


17 Feb, 2015

1 commit


30 Jan, 2015

1 commit

  • Currently the hash functions used in RSA are called directly from the sha1
    and sha256 libraries. Change the RSA checksum library to use the progressive
    hash API's registered with struct hash_algo. This will allow the checksum
    library to use the hardware accelerated progressive hash API's once available.

    Signed-off-by: Ruchika Gupta
    CC: Simon Glass
    Acked-by: Simon Glass
    Signed-off-by: Simon Glass
    (Fixed build error in am335x_boneblack_vboot due to duplicate CONFIG_DM)

    Change-Id: Ic44279432f88d4e8594c6e94feb1cfcae2443a54

    Ruchika Gupta
     

19 Jun, 2014

2 commits


22 Mar, 2014

3 commits

  • add host tool "fit_check_sign" which verifies, if a fit image is
    signed correct.

    Signed-off-by: Heiko Schocher
    Cc: Simon Glass

    Heiko Schocher
     
  • Add support for sha256,rsa4096 signatures in u-boot.

    Signed-off-by: Heiko Schocher
    Acked-by: Simon Glass
    Cc: andreas@oetken.name

    Heiko Schocher
     
  • based on patch from andreas@oetken.name:

    http://patchwork.ozlabs.org/patch/294318/
    commit message:
    I currently need support for rsa-sha256 signatures in u-boot and found out that
    the code for signatures is not very generic. Thus adding of different
    hash-algorithms for rsa-signatures is not easy to do without copy-pasting the
    rsa-code. I attached a patch for how I think it could be better and included
    support for rsa-sha256. This is a fast first shot.

    aditionally work:
    - removed checkpatch warnings
    - removed compiler warnings
    - rebased against current head

    Signed-off-by: Heiko Schocher
    Cc: andreas@oetken.name
    Cc: Simon Glass

    Heiko Schocher
     

24 Jul, 2013

1 commit


26 Jun, 2013

4 commits

  • While signing images is useful, it does not provide complete protection
    against several types of attack. For example, it it possible to create a
    FIT with the same signed images, but with the configuration changed such
    that a different one is selected (mix and match attack). It is also possible
    to substitute a signed image from an older FIT version into a newer FIT
    (roll-back attack).

    Add support for signing of FIT configurations using the libfdt's region
    support.

    Please see doc/uImage.FIT/signature.txt for more information.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • RSA provides a public key encryption facility which is ideal for image
    signing and verification.

    Images are signed using a private key by mkimage. Then at run-time, the
    images are verified using a private key.

    This implementation uses openssl for the host part (mkimage). To avoid
    bringing large libraries into the U-Boot binary, the RSA public key
    is encoded using a simple numeric representation in the device tree.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add support for signing images using a new signature node. The process
    is handled by fdt_add_verification_data() which now takes parameters to
    provide the keys and related information.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add a structure to describe an algorithm which can sign and (later) verify
    images.

    Signed-off-by: Simon Glass

    Simon Glass