From 765649f74bd78cc72b85d545b55d4423d47bfa92 Mon Sep 17 00:00:00 2001 From: Andre Borie Date: Wed, 27 Dec 2017 04:43:20 +0000 Subject: [PATCH 1/2] Increase socket timeout --- agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent.py b/agent.py index 9cac4e4..3750730 100644 --- a/agent.py +++ b/agent.py @@ -32,7 +32,7 @@ SIG_HEADER_EDDSA = "ssh-ed25519" SOCK_PREFIX = 'blue-ssh-agent' -TIMEOUT = 0.5 +TIMEOUT = 1 SSH2_AGENTC_REQUEST_IDENTITIES = 11 SSH2_AGENTC_SIGN_REQUEST = 13 From d2c9fff1611df452015ad9b0f35b0522a008b64b Mon Sep 17 00:00:00 2001 From: Andre Borie Date: Wed, 27 Dec 2017 04:43:27 +0000 Subject: [PATCH 2/2] Pipenv support --- Pipfile | 19 +++++++ Pipfile.lock | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 16 ++++-- 3 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..1b8de77 --- /dev/null +++ b/Pipfile @@ -0,0 +1,19 @@ +[[source]] + +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + + +[dev-packages] + + + +[packages] + +ledgerblue = "*" + + +[requires] + +python_version = "2.7" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..63dcf59 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,150 @@ +{ + "_meta": { + "hash": { + "sha256": "63e2ebf5aa32a470dd8ca52e285ee78b511cb9b29e238c59ed5421a8e9d5b932" + }, + "host-environment-markers": { + "implementation_name": "cpython", + "implementation_version": "0", + "os_name": "posix", + "platform_machine": "x86_64", + "platform_python_implementation": "CPython", + "platform_release": "17.3.0", + "platform_system": "Darwin", + "platform_version": "Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64", + "python_full_version": "2.7.14", + "python_version": "2.7", + "sys_platform": "darwin" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "2.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "ecpy": { + "hashes": [ + "sha256:0509a90714448ef47ef727cb7aee3415995c883c945e972521b5838fa4c50e24" + ], + "version": "==0.8.2" + }, + "future": { + "hashes": [ + "sha256:e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb" + ], + "version": "==0.16.0" + }, + "hidapi": { + "hashes": [ + "sha256:bf03f06f586ce7d8aeb697a94b7dba12dc9271aae92d7a8d4486360ff711a660", + "sha256:1ac170f4d601c340f2cd52fd06e85c5e77bad7ceac811a7bb54b529f7dc28c24", + "sha256:d4ad1e46aef98783a9e6274d523b8b1e766acfc3d72828cd44a337564d984cfa", + "sha256:c76de162937326fcd57aa399f94939ce726242323e65c15c67e183da1f6c26f7", + "sha256:d4b5787a04613503357606bb10e59c3e2c1114fa00ee328b838dd257f41cbd7b", + "sha256:b4b1f6aff0192e9be153fe07c1b7576cb7a1ff52e78e3f76d867be95301a8e87", + "sha256:edfb16b16a298717cf05b8c8a9ad1828b6ff3de5e93048ceccd74e6ae4ff0922", + "sha256:8d3be666f464347022e2b47caf9132287885d9eacc7895314fc8fefcb4e42946", + "sha256:e0be1aa6566979266a8fc845ab0e18613f4918cf2c977fe67050f5dc7e2a9a97" + ], + "version": "==0.7.99.post21" + }, + "ledgerblue": { + "hashes": [ + "sha256:eba56b887339fb5f8582771e4e398df4fa5a017183b908d4f8950588157c1504" + ], + "version": "==0.1.16" + }, + "olefile": { + "hashes": [ + "sha256:61f2ca0cd0aa77279eb943c07f607438edf374096b66332fae1ee64a6f0f73ad" + ], + "version": "==0.44" + }, + "pillow": { + "hashes": [ + "sha256:cc6a5ed5b8f9d2f25e4e42d562e0ec4df3ce838f9e9b9d9d9b65fac6fe93a4cc", + "sha256:54898190b538a6c8fa4228e866ff2e7609da1ba9fd1d9cc5dc8ca591d37ce0a8", + "sha256:a336596b06e062b92eb8201a3b5dff07ae01c3a5d08ce5539d2da49b123f2be6", + "sha256:922aeb050bd52d8ce9531ab57fd2440bfe975900e8700fec385fb741c3c557c7", + "sha256:6d814aa655d94c63547fc3208cb6ab886ff1a64c543b31f52658663b1bb3f011", + "sha256:e66080685863444738f08e13081c287e340b6e4f8bd674a2e0da967776ac6f46", + "sha256:575a9b3468c82f38be0419cd39d35001ae95a0cc5226534e45430035fecef583", + "sha256:4fb8ab0f8895fb946454ef6ffe806f49ee387095f2d6112ae24670e5fb8fbcd9", + "sha256:1d742642d01914b7e0cf6fd597a51f57d21fd68f794cf84803e03e72db78a261", + "sha256:59cef683d79b85d55a950c1e61dc7b6be0c45a5074692746354cd9a8ace1cd17", + "sha256:822e4fc261d12fa44d88dadee0e93d59663db94d962d4ffffbf09b1fe5e5be51", + "sha256:a6f43511c79bed431ec2b56e55150b5222c732cd9e5f80e77a44e068e94c71fc", + "sha256:2046a2001e2c413998951cc28aa0dbfd4cff846a12e24c2145d42630d5104094", + "sha256:39c7c9dcf64430091e30ef14d4191b4cae9b7b5ff29762357730aac4866fb189", + "sha256:f2d71951f473744ac617b645b62d0c4df5372ef4618c425646bfe5e2e8878e61", + "sha256:9adcfa2477b7e279ebeee75b49f535518201bbd7d26ca2ef1cf6751cb6e658e8", + "sha256:0e3b56364a2c772c961a8faad8a835d3f24d8848310de035c9e07cc006035cbc", + "sha256:92087cb92a968421f42235f7d8153f4766b6ba213a6efb36b8060f3c9d294569", + "sha256:53eaec751151b5713a15b1cd62b06d0fc16d72f56623c15448728c554c30770b", + "sha256:e595312f67962d6b4fde3b7dffaaaca4becefa522d677676bb57b0ec5f8f921a", + "sha256:dc32362d0cadf18c3aef7040455760106cafe7dd3c211dc27c507e746376bb56", + "sha256:759e5e3e99c4ac87b99e9288a75236c63173d1bb24c8d3f9d9d2c8332fceeb0a", + "sha256:b13106cb83a3b7d1a02fafb94bfafbc980465ba948b76ea1996245959c6783d2", + "sha256:9184b9788a9cf677e53626a4dc141136a22d349a5480479b98defd3cfb5015a4", + "sha256:be803fae6af36639524a0f6861a8cface67bbec66c3416c3eaf592f1d45b8b20", + "sha256:effa82e72f5064439a3d2c7ff615b999eb1c4d65bb1f1e6ee6e2ddb345b3e81e", + "sha256:9dc002a914cefa710dcb9fb204d34f6cd822662047a6038178f5fc9bfa7be961", + "sha256:7b3cf7a80608ed661b77793f64e1f2bd1e77136ad0b750aa2c81fac9c7e2c785", + "sha256:a9bad3405a642649e68568fe9832e8f6ae585354ab0b4ae250816ead11a553a2", + "sha256:4d3dbd93b131013a71b2e98530dd4945a03c7994d42381e44a921dd8bec300bc", + "sha256:9a1514bee2e32e0d4c0f55ba7a20f4387f883e37c7d2db64ca50449ffebe86cc", + "sha256:a9721fe1f6fdfe0c108ea81b1a05dc216f1ec5bb65ef1de1d85fd00494d019e0", + "sha256:e75d745306ec8aac0e6903358fdfc7fb6854febe551ed753ee7a1cad058b61bb", + "sha256:ccc9c1f5ba413fc5ee09bc78de7dd2ad8e189edb48f3bc38acedd04a7f43a0c1", + "sha256:150e24462fd106074a9a63417a55fbb0c633716cef9511f1bd7a773972de14f4", + "sha256:250d8470661fd657c2583672ab5139f40e7f2ef28ecdc90f87563af0b27f6fba", + "sha256:a97c715d44efd5b4aa8d739b8fad88b93ed79f1b33fc2822d5802043f3b1b527", + "sha256:dbefe5aa0882f00f12eceb3fb7df57105cd87fae767ca025db4685b7577c2390", + "sha256:62a7bbf0a1120ff07a99ddedd383779a8d80bd9d363f3964b2b43a26cef6ea50", + "sha256:42b4a67949085ddd4559c3c716a00a275fb45cb2c3a3aeec95c4b94419b7c243", + "sha256:0ac037e6c1746d63a1ea354f0d5974d8f3f984fc0333be373ad193711a89b1e9", + "sha256:8989cbf10ea07fc9982ec86116f6234bb3e44da481874ac94650d6176f60106f", + "sha256:77834551d3e928f3da922ce9dfb5c8db46758ea2f2922d4c5835a5b67a222aff", + "sha256:c00301e807084706bd46a1c56694ee235debe68eaf482c0186edfe07b93a9f6a", + "sha256:0163bd681d3488e2e9c26f4fbbfefcfb7f32259c431bfd2c3bc25574708a8b8c", + "sha256:223b06c337d8d60fb65af3b540ab1fa4644931d61d1fddf6e32f7a0e496685f2", + "sha256:1ab641cb7daf88e88ede8d3b89b7bd68a7099d8671160492d5e6845e24426080" + ], + "version": "==4.3.0" + }, + "protobuf": { + "hashes": [ + "sha256:11788df3e176f44e0375fe6361342d7258a457b346504ea259a21b77ffc18a90", + "sha256:50c24f0d00b7efb3a72ae638ddc118e713cfe8cef40527afe24f7ebcb878e46d", + "sha256:41661f9a442eba2f1967f15333ebe9ecc7e7c51bcbaa2972303ad33a4ca0168e", + "sha256:06ec363b74bceb7d018f2171e0892f03ab6816530e2b0f77d725a58264551e48", + "sha256:b20f861b55efd8206428c13e017cc8e2c34b40b2a714446eb202bbf0ff7597a6", + "sha256:c1f9c36004a7ae6f1ce4a23f06070f6b07f57495f251851aa15cc4da16d08378", + "sha256:4d2e665410b0a278d2eb2c0a529ca2366bb325eb2ae34e189a826b71fb1b28cd", + "sha256:95b78959572de7d7fafa3acb718ed71f482932ddddddbd29ba8319c10639d863" + ], + "version": "==3.5.1" + }, + "pycrypto": { + "hashes": [ + "sha256:f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c" + ], + "version": "==2.6.1" + }, + "six": { + "hashes": [ + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + ], + "version": "==1.11.0" + } + }, + "develop": {} +} diff --git a/README.md b/README.md index 429f390..25036bc 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,29 @@ A simple PGP and SSH agent for Ledger Blue, supporting prime256v1 and ed25519 ke This agent is compatible with the third party SSH/PGP host client from Roman Zeyde available at https://github.com/romanz/trezor-agent - it is recommended to use it for extra functionalities -You can also use the SSH functionalities with the following instructions using Python 2 : +## Installation + +You'll need [`pipenv`](https://docs.pipenv.org) and Python 2. + +Clone this repo somewhere, then run the following inside it: + + pipenv install + +This will automatically create a Python 2 "virtualenv" with the Ledger Blue Python libraries this software depends on. + +## Usage Run getPublicKey.py to get the public key in SSH format, to be added to your authorized keys on the target ``` -python getPublicKey.py +pipenv run python getPublicKey.py ecdsa-sha2-nistp256 AAAA.... ``` Run agent.py, providing the base64 encoded key retrieved earlier ``` -python agent.py --key AAAA.... +pipenv run python agent.py --key AAAA.... ``` Export the environment variables in your shell to use it