Subject: Libssh2/Libgcrypt: Can't Parse RSA Keys

Libssh2/Libgcrypt: Can't Parse RSA Keys

From: Paul Romero <>
Date: Thu, 26 Aug 2010 21:49:57 -0700

Dear Group:

Thanks to previous hints about SSH private key formats,
I was able to isolate the code that fails when trying to parse
PKCS encoded RSA keys. (i.e. Private keys with a

The failure occurs in libssh2_base64_parse() when it
is called by _libssh2_pem_parse(). Previous E-Mail
indicates the problem is PKCS encoded private RSA keys,
which the current code cannot handle.
(i.e. I am using version 1.2.6)

My application needs to be able to handle
at least RSA 1 private keys, and preferably
RSA 2 private keys.

Can the Libssh2 code handle unencrypted
RSA 1 or 2 keys ? If not, how can I
circumvent the problem enough for interoperability
with standard Linux servers ? Also, when will
the problem be fixed ?

Note that using Openssl is not an option !

Best Regards,

Paul R.

Paul Romero
RCOM Communications Software
Phone/Fax: (510)339-2628
Received on 2010-08-27