Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libagent/age/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import traceback

import bech32
import pkg_resources
from importlib import metadata
import semver
from cryptography.exceptions import InvalidTag
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
Expand Down Expand Up @@ -155,8 +155,8 @@ def main(device_type):

agent_package = device_type.package_name()
resources_map = {r.key: r for r in pkg_resources.require(agent_package)}
resources = [resources_map[agent_package], resources_map['lib-agent']]
versions = '\n'.join('{}={}'.format(r.key, r.version) for r in resources)
resources = [metadata.distribution(agent_package), metadata.distribution('lib-agent')]
versions = '\n'.join('{}={}'.format(r.metadata['Name'], r.version) for r in resources)
p.add_argument('--version', help='print the version info',
action='version', version=versions)

Expand Down
9 changes: 4 additions & 5 deletions libagent/gpg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import time

import daemon
import pkg_resources
import semver
import Crypto.Hash
import Crypto.PublicKey
import Crypto.Signature
from Crypto.Signature import pkcs1_15
from Crypto.Hash import SHA256, SHA512
from Crypto.PublicKey import RSA
from importlib import metadata

from .. import device, formats, server, util
from . import agent, client, encode, keyring, protocol
Expand Down Expand Up @@ -328,9 +328,8 @@ def main(device_type):
parser = argparse.ArgumentParser(epilog=epilog)

agent_package = device_type.package_name()
resources_map = {r.key: r for r in pkg_resources.require(agent_package)}
resources = [resources_map[agent_package], resources_map['lib-agent']]
versions = '\n'.join('{}={}'.format(r.key, r.version) for r in resources)
resources = [metadata.distribution(agent_package), metadata.distribution('lib-agent')]
versions = '\n'.join('{}={}'.format(r.metadata['Name'], r.version) for r in resources)
parser.add_argument('--version', help='print the version info',
action='version', version=versions)

Expand Down Expand Up @@ -389,4 +388,4 @@ def main(device_type):
else:
device_type.ui = device.ui.UI(device_type=device_type, config=vars(args))

return args.func(device_type=device_type, args=args)
return args.func(device_type=device_type, args=args)
7 changes: 3 additions & 4 deletions libagent/ssh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import configargparse
import daemon
import pkg_resources

from importlib import metadata
from .. import device, formats, server, util
from . import client, protocol

Expand Down Expand Up @@ -72,9 +72,8 @@ def create_agent_parser(device_type):
p.add_argument('-v', '--verbose', default=0, action='count')

agent_package = device_type.package_name()
resources_map = {r.key: r for r in pkg_resources.require(agent_package)}
resources = [resources_map[agent_package], resources_map['lib-agent']]
versions = '\n'.join('{}={}'.format(r.key, r.version) for r in resources)
resources = [metadata.distribution(agent_package), metadata.distribution('lib-agent')]
versions = '\n'.join('{}={}'.format(r.metadata['Name'], r.version) for r in resources)
p.add_argument('--version', help='print the version info',
action='version', version=versions)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='lib-agent',
version='1.0.6',
version='1.0.7',
description='Using OnlyKey as hardware SSH and GPG agent',
author='CryptoTrust',
author_email='admin@crp.to',
Expand Down