imgtool: Fix ECDSA signatures

Earlier refactoring created a call for get_public_bytes() that was added
to the RSA class, but missed on the ECDSA class.  Add this call so that
ECDSA signatures will work again.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2017-09-06 10:31:11 -06:00 committed by David Brown
parent 9911b1864b
commit cb1bb48bb5
1 changed files with 4 additions and 0 deletions

View File

@ -101,6 +101,10 @@ class ECDSA256P1():
with open(path, 'wb') as f: with open(path, 'wb') as f:
f.write(self.key.to_pem()) f.write(self.key.to_pem())
def get_public_bytes(self):
vk = self.key.get_verifying_key()
return bytes(vk.to_der())
def emit_c(self): def emit_c(self):
vk = self.key.get_verifying_key() vk = self.key.get_verifying_key()
print(AUTOGEN_MESSAGE) print(AUTOGEN_MESSAGE)