diff --git a/setup.py b/setup.py index 6b63997..5e0da7a 100644 --- a/setup.py +++ b/setup.py @@ -31,5 +31,6 @@ setup( 'trezor-agent = trezor_agent.__main__:run_agent', 'trezor-git = trezor_agent.__main__:run_git', 'trezor-gpg = trezor_agent.gpg.signer:main', + 'trezor-git-gpg-wrapper = trezor_agent.gpg.git_wrapper:main', ]}, ) diff --git a/trezor_agent/gpg/git_cmd.py b/trezor_agent/gpg/git_wrapper.py similarity index 78% rename from trezor_agent/gpg/git_cmd.py rename to trezor_agent/gpg/git_wrapper.py index f3296bd..24f85bf 100755 --- a/trezor_agent/gpg/git_cmd.py +++ b/trezor_agent/gpg/git_wrapper.py @@ -17,9 +17,11 @@ def main(): if '--verify' in args: return sp.call(['gpg2'] + args) else: - command, user_id = args + command = args[0] + user_id = ' '.join(args[1:]) assert command == '-bsau' # --detach-sign --sign --armor --local-user - s = signer.load_from_gpg(user_id) + pubkey = signer.load_from_gpg(user_id) + s = signer.Signer.from_public_key(user_id=user_id, pubkey=pubkey) data = sys.stdin.read() sig = s.sign(data)