Subject: Re: [libssh2] Publickey auth with SSH Tectia servers

Re: [libssh2] Publickey auth with SSH Tectia servers

From: Mononen Jussi <>
Date: Mon, 15 Jan 2007 10:21:06 +0200

>> The problem is that if I try to use libssh2_file_read_publickey
>> -function with a publickey converted to SECSH format it
>> failes "Invalid key data, not base64 encoded". As a result I can
>> use only OpenSSH formatted keys and that is unacceptable from the
>> Tectia server point of view.


as a solution the libssh2_file_read_publickey -function should be able
to read both formats of public key files. Now it simply expects the key
body to start from the second line of the key file failing miserably to
parse SECSH formatted keys which have begin and end markers as well as
header and comment fields.

A simple string comparison test against the first line of the key file
is enough to distinguish SECSH and OpenSSH formatted keys. Then
libssh2_file_read_publickey -function would only need a way to extract
the public key body from the SECSH formatted file in order to use it.
Thus it would be possible to use OpenSSH formatted private key and SECSH
formatted public key together in authentication.

Does this sound reasonable?

I am currently using version 0.12 and I can not switch to the latest
version very easily. If I submit a patch for this could someone
introduce it to the CVS taking care of possible merging at the same



perl -e '$@=[[0,0112,0,0],[0,0101,0,0],
Disclaimer: This message and any attachments thereto are intended solely for
the addressed recipient(s) and may contain confidential information. If you
are not the intended recipient, please notify the sender by reply e-mail and
delete the e-mail (including any attachments thereto) without producing,
distributing or retaining any copies thereof. Any review, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient(s) is prohibited.
Thank you.
Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
libssh2-devel mailing list
Received on 2007-01-15