01 Jun, 2017

1 commit

  • Currently these (board agnostic) commands cannot be selected using
    menuconfig and friends. Fix this the obvious way. As part of this,
    don't muddle the meaning of CONFIG_HASH_VERIFY to mean both 'hash -v'
    and "we have a hashing command" as this makes the Kconfig logic odd.

    Signed-off-by: Daniel Thompson
    [trini: Re-apply, add imply for a few cases, run moveconfig.py, also
    migrate CRC32_VERIFY]
    Signed-off-by: Tom Rini

    Daniel Thompson
     

14 Jan, 2016

1 commit

  • The function hash_show is now only called by hash_command, so mark it as
    static (and drop from hash.h). We only call hash_command when any of
    CONFIG_CMD_CRC32, CONFIG_CMD_SHA1SUM or CONFIG_CMD_HASH are set. Since
    hash.c is linked in unconditionally we must take extra care with
    functions that bring in read-only strings as these will not be
    discarded.

    Signed-off-by: Tom Rini

    Tom Rini
     

09 Jun, 2015

1 commit

  • This patch adds the feature to only stop the autobooting, and therefor
    boot into the U-Boot prompt, when the input string / password matches
    a values that is encypted via a SHA256 hash and saved in the environment.

    This feature is enabled by defined these config options:
    CONFIG_AUTOBOOT_KEYED
    CONFIG_AUTOBOOT_STOP_STR_SHA256

    Signed-off-by: Stefan Roese
    Reviewed-by: Simon Glass

    Stefan Roese
     

30 Jan, 2015

2 commits


19 Jun, 2014

1 commit


12 Jun, 2014

1 commit


06 Jun, 2014

1 commit

  • Due to the FIT_MAX_HASH_LEN constant not having been updated
    to support SHA256 signatures one will always see a buffer
    overflow in fit_image_process_hash when signing images that
    use this larger hash. This is exposed by vboot_test.sh.

    Signed-off-by: Michael van der Westhuizen
    Acked-by: Simon Glass
    [trini: Rework a bit so move the exportable parts of hash.h outside of
    !USE_HOSTCC and only need that as a new include to image.h]
    Signed-off-by: Tom Rini

    Michael van der Westhuizen
     

22 Mar, 2014

1 commit

  • Add hash_init(), hash_update() and hash_finish() to the
    hash_algo struct. Add hash_lookup_algo() to look up the
    struct given an algorithm name.

    Signed-off-by: Hung-ying Tyan
    Signed-off-by: Simon Glass
    Signed-off-by: Heiko Schocher
    Acked-by: Simon Glass

    Hung-ying Tyan
     

24 Jul, 2013

1 commit


15 May, 2013

1 commit


01 Mar, 2013

3 commits

  • Rather than use strcasecmp() in the hash algorithm search, require the
    caller to do this first. Most of U-Boot can use lower case anyway, and
    the hash command can convert to lower case before calling hash_command().
    This saves needing strcasecmp() for boards that use hashing but not
    the hash command.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add the CRC32 algorithm to the list of available hashes, and make
    the crc32 command use hash_command(). Add a new crc32_wd_buf() to
    make this possible, which puts its result in a buffer rather than
    returning it as a 32-bit value.

    Note: For some boards the hash command is not enabled, neither
    are sha1, sha256 or the verify option. In this case the full
    hash implementation adds about 500 bytes of overhead. So as a
    special case, we use #ifdef to select very simple bahaviour in
    that case. The justification for this is that it is currently
    a very common case (virtually all boards enable crc32 but only
    some enable more advanced features).

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Some hashing commands permit saving the hash in an environment variable,
    and verifying a hash from there. But the crc32 command does not support
    this. In order to permit crc32 to use the generic hashing infrastructure,
    add a flag to select which behaviour to use.

    Signed-off-by: Simon Glass

    Simon Glass
     

12 Dec, 2012

1 commit

  • We have a SHA1 command and want to add a SHA256 command also. Instead of
    duplicating the code, create a generic hash API which can process
    commands for different algorithms.

    Signed-off-by: Simon Glass

    Simon Glass