16 Jan, 2018

1 commit


06 Nov, 2017

3 commits

  • This function is called when signing configuration nodes. Adjust
    the error message.

    I do not know why we do not need to show the error message in case of
    ENOSPC. Remove the if-conditional that seems unnecessary.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • If -K option is missing when you sign image nodes, it fails with
    an unclear error message:

    tools/mkimage Can't add hashes to FIT blob: -1

    It is hard to figure out the cause of the failure.

    In contrast, when you sign configuration nodes, -K is optional because
    fit_config_process_sig() returns successfully if keydest is unset.
    Probably this is a preferred behavior when you want to update FIT with
    the same key; you do not have to update the public key in this case.

    So, this commit changes fit_image_process_sig() to continue signing
    without keydest. If ->add_verify_data() fails, show a clearer error
    message, which has been borrowed from fit_config_process_sig().

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • The "algo_name" points to a property in a blob being edited. The
    pointer becomes stale when fit_image_write_sig() inserts signatures.
    Then crypto->add_verify_data() writes wrong data to the public key
    destination.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

24 Oct, 2017

1 commit


15 Jan, 2017

1 commit

  • Add support for signing with the pkcs11 engine. This allows FIT images
    to be signed with keys securely stored on a smartcard, hardware security
    module, etc without exposing the keys.

    Support for other engines can be added in the future by modifying
    rsa_engine_get_pub_key() and rsa_engine_get_priv_key() to construct
    correct key_id strings.

    Signed-off-by: George McCollister

    George McCollister
     

22 Nov, 2016

2 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
     

26 Jul, 2016

1 commit

  • [NOTE: I took v1 of these patches in, and then v2 came out, this commit
    is squashing the minor deltas from v1 -> v2 of updates to c236ebd and
    2b9ec76 into this commit - trini]

    - Added an additional NULL check, as suggested by Simon Glass to
    fit_image_process_sig
    - Re-formatted the comment blocks

    Signed-off-by: Mario Six
    Reviewed-by: Simon Glass
    [For merging the chnages from v2 back onto v1]
    Signed-off-by: Tom Rini

    mario.six@gdsys.cc
     

23 Jul, 2016

1 commit

  • When signing images, we repeatedly call fit_add_file_data() with
    successively increasing size values to include the keys in the DTB.

    Unfortunately, if large keys are used (such as 4096 bit RSA keys), this
    process fails sometimes, and mkimage needs to be called repeatedly to
    integrate the keys into the DTB.

    This is because fit_add_file_data actually returns the wrong error
    code, and the loop terminates prematurely, instead of trying again with
    a larger size value.

    This patch corrects the return value and also removes a error message,
    which is misleading, since we actually allow the function to fail. A
    (hopefully helpful) comment is also added to explain the lack of error
    message.

    This is probably related to 1152a05 ("tools: Correct error handling in
    fit_image_process_hash()") and the corresponding error reported here:

    https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html

    Signed-off-by: Mario Six

    mario.six@gdsys.cc
     

15 Jul, 2016

1 commit

  • We should not be returning -1 as an error code. This can mask a situation
    where we run out of space adding things to the FIT. By returning the correct
    error in this case (-ENOSPC) it can be handled by the higher-level code.

    This may fix the error reported by Tom Van Deun here:

    https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html

    although I am not sure as I cannot actually repeat it.

    Signed-off-by: Simon Glass
    Reported-by: Tom Van Deun
    Reviewed-by: Teddy Reed

    Simon Glass
     

14 Aug, 2014

1 commit


19 Jun, 2014

2 commits


12 Jun, 2014

1 commit


22 Mar, 2014

2 commits


24 Jul, 2013

1 commit


26 Jun, 2013

2 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
     
  • 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
     

15 May, 2013

4 commits