Support keys with line comments
Open, Needs TriagePublic

Description

The presence of line comments in the key file makes it unreadable to libssh

[2017/09/20 11:12:23.757044, 2] ssh_pki_import_privkey_base64:  Trying to decode privkey passphrase=false
[2017/09/20 11:12:23.757067, 1] pki_private_key_from_base64:  Unknown or invalid private key.

The same key is usable by OpenSSH and removing the line comments makes it compatible with libssh:

Example:

# line comment
# line comment
-----BEGIN RSA PRIVATE KEY-----
key data
-----END RSA PRIVATE KEY-----
nickb937 created this task.Sep 20 2017, 8:41 PM