imgtool.py: Fix some errors in ecdsa key generation

There are two easy to fix problems with the ecdsa key generation code.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2017-07-27 10:23:02 -06:00 committed by David Brown
parent b189f1048d
commit 8ae61c05a5
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import sys
def gen_rsa2048(args):
keys.RSA2048.generate().export_private(args.key)
def gen_ecdsa_p256(args):
keys.ecdsa256p1.generate().export_private(args.key)
keys.ECDSA256P1.generate().export_private(args.key)
def gen_ecdsa_p224(args):
print("TODO: p-224 not yet implemented")

View File

@ -84,7 +84,7 @@ class ECDSA256P1():
def export_private(self, path):
with open(path, 'wb') as f:
f.write(key.to_pem())
f.write(self.key.to_pem())
def emit_c(self):
vk = self.key.get_verifying_key()