Fix image creation without sign/encryption
Generating images with no signature or encryption was broken by commit
06b77b835336d80c102e35f7c6da997d9380c9b8
This allows generating images with just sha256 again, and fixes a few
leftovers from the imghash TLV change.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/scripts/imgtool.py b/scripts/imgtool.py
index 2937331..dbb3334 100755
--- a/scripts/imgtool.py
+++ b/scripts/imgtool.py
@@ -158,8 +158,7 @@
raise Exception("Encryption only available with RSA")
if key and not isinstance(key, (keys.RSA2048, keys.RSA2048Public)):
raise Exception("Encryption with sign only available with RSA")
- if key or enckey:
- img.create(key, enckey)
+ img.create(key, enckey)
if pad:
img.pad_to(slot_size)