imgtool: Fix imgtool sign command without key
The fix adds a condition that checks if either key or fixed_sig are
`not None` before payload signing and TLV addition.
@@ -435,6 +435,7 @@ class Image():
tlv.add('SHA256', digest)
+ if key is not None or fixed_sig is not None:
if public_key_format == 'hash':
tlv.add('KEYHASH', pubbytes)
else:
