gpg: export git-gpg wrapper

should be used as 'gpg.program' in .git/config
This commit is contained in:
Roman Zeyde 2016-04-23 23:13:06 +03:00
parent 0c94363595
commit 6cc3a629a8
2 changed files with 5 additions and 2 deletions

View File

@ -31,5 +31,6 @@ setup(
'trezor-agent = trezor_agent.__main__:run_agent', 'trezor-agent = trezor_agent.__main__:run_agent',
'trezor-git = trezor_agent.__main__:run_git', 'trezor-git = trezor_agent.__main__:run_git',
'trezor-gpg = trezor_agent.gpg.signer:main', 'trezor-gpg = trezor_agent.gpg.signer:main',
'trezor-git-gpg-wrapper = trezor_agent.gpg.git_wrapper:main',
]}, ]},
) )

View File

@ -17,9 +17,11 @@ def main():
if '--verify' in args: if '--verify' in args:
return sp.call(['gpg2'] + args) return sp.call(['gpg2'] + args)
else: else:
command, user_id = args command = args[0]
user_id = ' '.join(args[1:])
assert command == '-bsau' # --detach-sign --sign --armor --local-user 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() data = sys.stdin.read()
sig = s.sign(data) sig = s.sign(data)