Skip to content

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

@sundbp

Description

@sundbp

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions