rugged icon indicating copy to clipboard operation
rugged copied to clipboard

implement SshKeyFromMemory

Open ccutrer opened this issue 5 years ago • 2 comments

fixes gh-796

libgit2 already supports it.

I wrote the tests for it, but was unable to get any of the OnlineTests to work. I'm guessing I probably just don't fully understand what I'm supposed to put in the environment variables. I did test it for reals. And I also tested it with libgit2 not having libssh2 support (since ssh key from memory is an optional feature), and Rugged's extensions still compiles. I did not test it with a libgit2 with libssh2 support, but not support for ssh key from memory (presumably a crypto backend other than openssl?).

ccutrer avatar May 09 '19 17:05 ccutrer

I've now tested with libssh2 built against gcrypt. when attempting to use in-memory ssh key without a public key (as you can with OpenSSL), you get Rugged::SshError: Failed to authenticate SSH session: Unable to extract public key from private key.. When I also provide the public key, I get Rugged::SshError: Failed to authenticate SSH session: Unable to send userauth-publickey request

ccutrer avatar May 09 '19 20:05 ccutrer

I'm pretty sure the previous error was because libgcrypt can't handle my private keys at all. When using a libssh2 with openssl, but without ssh memory credentials (???), I get Rugged::InvalidError: this version of libgit2 was not built with ssh memory credentials.. Which seems hugely descriptive to me of the exact problem!

ccutrer avatar May 09 '19 21:05 ccutrer