rugged
rugged copied to clipboard
implement SshKeyFromMemory
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?).
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
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!