ecdh: fixup pubkey ID

This commit is contained in:
Roman Zeyde
2016-06-03 15:05:45 +03:00
parent 56e9d7c776
commit e9f7894d62

View File

@@ -98,11 +98,13 @@ class Factory(object):
@classmethod
def from_public_key(cls, pubkey, user_id):
"""Create from an existing GPG public key."""
s = cls(user_id=user_id,
is_ecdh = (pubkey['algo'] == proto.ECDH_ALGO_ID)
f = cls(user_id=user_id,
created=pubkey['created'],
curve_name=proto.find_curve_by_algo_id(pubkey['algo']))
### assert s.pubkey.key_id() == pubkey['key_id']
return s
curve_name=proto.find_curve_by_algo_id(pubkey['algo']),
ecdh=is_ecdh)
assert f.pubkey.key_id() == pubkey['key_id']
return f
def close(self):
"""Close connection and turn off the screen of the device."""