gpg: fix method's caching

This commit is contained in:
Roman Zeyde
2018-04-16 12:38:28 +03:00
parent 61e516e200
commit bc691ae795
2 changed files with 19 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ class Handler(object):
raise AgentError(b'ERR 100696144 No such device <SCD>')
keyring.sendline(conn, b'D ' + reply)
@util.memoize
@util.memoize_method # global cache for key grips
def get_identity(self, keygrip):
"""
Returns device.interface.Identity that matches specified keygrip.
@@ -171,7 +171,6 @@ class Handler(object):
ec_point = self.client.ecdh(identity=identity, pubkey=remote_pubkey)
keyring.sendline(conn, b'D ' + _serialize_point(ec_point))
@util.memoize
def have_key(self, *keygrips):
"""Check if any keygrip corresponds to a TREZOR-based key."""
for keygrip in keygrips: