imgtool: Fix signing payload type
The 'cryptography' library is pickier about the data it is asked to
sign.  Get the bytes value out of the bytearray for doing the actual
signature.
@@ -125,7 +125,7 @@ class Image():
pubbytes = sha.digest()
tlv.add('KEYHASH', pubbytes)
- sig = key.sign(self.payload)
+ sig = key.sign(bytes(self.payload))
tlv.add(key.sig_tlv(), sig)
self.payload += tlv.get()
