01 Apr, 2020

3 commits


26 Feb, 2020

1 commit


17 Jan, 2020

1 commit

  • This commit add the support of encrypting image with aes
    in mkimage. To enable the ciphering, a node cipher with
    a reference to a key and IV (Initialization Vector) must
    be added to the its file. Then mkimage add the encrypted
    image to the FIT and add the key and IV to the u-boot
    device tree.

    Signed-off-by: Philippe Reynes

    Philippe Reynes
     

03 Dec, 2018

1 commit

  • The rsa signature use a padding algorithm. By default, we use the
    padding pkcs-1.5. In order to add some new padding algorithm, we
    add a padding framework to manage several padding algorithm.
    The choice of the padding is done in the file .its.

    Signed-off-by: Philippe Reynes
    Reviewed-by: Simon Glass

    Philippe Reynes
     

11 Jul, 2018

2 commits


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

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