Commit 47b77c52 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

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.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 5e7c6dd5
Loading
Loading
Loading
Loading
+1 −1
Changes for scripts/imgtool/image.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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()