Commit 9911b186 authored by Fabio Utzig's avatar Fabio Utzig Committed by David Brown
Browse files

Allow keyhash lengths smaller than 32 bytes

The keyhash should be able to have any size up to the maximum allowed
size of 32, but the assert was not allowing images created with newt to
be accepted as valid (newt currently uses only 4 bytes for keyhash).

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 36ec0e7b
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/bootutil/src/image_validate.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ bootutil_find_key(uint8_t *keyhash, uint8_t keyhash_len)
    const struct bootutil_key *key;
    uint8_t hash[32];

    assert(keyhash_len == 32);
    assert(keyhash_len <= 32);

    for (i = 0; i < bootutil_key_cnt; i++) {
        key = &bootutil_keys[i];