Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompability of passphrase being a string or a byte[] ? #1

Open
sundbp opened this issue Dec 2, 2012 · 0 comments
Open

Incompability of passphrase being a string or a byte[] ? #1

sundbp opened this issue Dec 2, 2012 · 0 comments

Comments

@sundbp
Copy link

sundbp commented Dec 2, 2012

Hi,

This line does no extra conversions of the passphrase from string to byte[]:
https://github.com/pallet/ssh-transport/blob/develop/src/pallet/ssh/transport.clj#L25

In the underlying lib the passphrase is assumed to be a byte array:
https://github.com/hugoduncan/clj-ssh/blob/develop/src/clj_ssh/ssh.clj#L136

I end up getting an exception of String not being convertible to byte[] here:
https://github.com/hugoduncan/clj-ssh/blob/develop/src/clj_ssh/ssh.clj#L180

The decrypt method does have an overload that takes a String, but I assume because of the type hint the byte[] version gets forced:
http://epaul.github.com/jsch-documentation/javadoc/com/jcraft/jsch/KeyPair.html

If I use a passphrase that is (.getBytes "foobar") then it all works ok, but I would have assumed that working with strings would be the natural thing to do. A simple .getBytes before passing on the passphrase would solve the issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant