From e74b9c77af4d9e17e5be1b6ea45dc9af50987bcc Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 30 Oct 2016 21:45:56 +0200 Subject: [PATCH] gpg: rename gpg.device into gpg.client --- trezor_agent/gpg/__main__.py | 5 ++--- trezor_agent/gpg/agent.py | 4 ++-- trezor_agent/gpg/{device.py => client.py} | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) rename trezor_agent/gpg/{device.py => client.py} (98%) diff --git a/trezor_agent/gpg/__main__.py b/trezor_agent/gpg/__main__.py index e9b8596..a31e781 100755 --- a/trezor_agent/gpg/__main__.py +++ b/trezor_agent/gpg/__main__.py @@ -10,7 +10,7 @@ import time import semver -from . import agent, decode, device, encode, keyring, protocol +from . import agent, decode, client, encode, keyring, protocol from .. import formats, server, util log = logging.getLogger(__name__) @@ -29,8 +29,7 @@ def run_create(args): log.warning('NOTE: in order to re-generate the exact same GPG key later, ' 'run this command with "--time=%d" commandline flag (to set ' 'the timestamp of the GPG key manually).', args.time) - d = device.HardwareSigner(user_id=args.user_id, - curve_name=args.ecdsa_curve) + d = client.Client(user_id=args.user_id, curve_name=args.ecdsa_curve) verifying_key = d.pubkey(ecdh=False) decryption_key = d.pubkey(ecdh=True) diff --git a/trezor_agent/gpg/agent.py b/trezor_agent/gpg/agent.py index 575f8d2..22b6f31 100644 --- a/trezor_agent/gpg/agent.py +++ b/trezor_agent/gpg/agent.py @@ -2,7 +2,7 @@ import binascii import logging -from . import decode, device, keyring, protocol +from . import decode, client, keyring, protocol from .. import util log = logging.getLogger(__name__) @@ -51,7 +51,7 @@ def open_connection(keygrip_bytes): curve_name = protocol.get_curve_name_by_oid(pubkey_dict['curve_oid']) ecdh = (pubkey_dict['algo'] == protocol.ECDH_ALGO_ID) - conn = device.HardwareSigner(user_id, curve_name=curve_name) + conn = client.Client(user_id, curve_name=curve_name) pubkey = protocol.PublicKey( curve_name=curve_name, created=pubkey_dict['created'], verifying_key=conn.pubkey(ecdh=ecdh), ecdh=ecdh) diff --git a/trezor_agent/gpg/device.py b/trezor_agent/gpg/client.py similarity index 98% rename from trezor_agent/gpg/device.py rename to trezor_agent/gpg/client.py index 04e6dba..f431d54 100644 --- a/trezor_agent/gpg/device.py +++ b/trezor_agent/gpg/client.py @@ -7,7 +7,7 @@ from .. import device, formats, util log = logging.getLogger(__name__) -class HardwareSigner(object): +class Client(object): """Sign messages and get public keys from a hardware device.""" def __init__(self, user_id, curve_name):