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: Fabio Utzig <utzig@apache.org>
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/bootutil/src/image_validate.c b/boot/bootutil/src/image_validate.c
index 3f0550b..5b2b9a0 100644
--- a/boot/bootutil/src/image_validate.c
+++ b/boot/bootutil/src/image_validate.c
@@ -119,7 +119,7 @@
     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];