[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on privatekey_from_file

On Monday 21 December 2009 05:21:29 you wrote:
> Hi,


> Recently I am trying to use privatekey_from_file without a public key. I
> think I can do it by:
> privatekey_from_file -> publickey_from_privatekey -> publickey_to_string

yes, this is the way, but it doesn't work.
> But in order to call privatekey_from_file, I have to tell it the key
> type (RSA or DSS). Previously I could get the key type from
> publickey_from_file, but now I can't since I don't have the public key
> file.

That's more or less the problem, we should read the first line and then 
comapre it with RSA_HEADER_BEGIN and DSA_HEADER_BEGIN to find out the type. It 
is on my todo list but I haven't had the time to do it.

> I know it's quite easy to tell the keytype from the private key file by
> simply read the first line... but any reason why this cannot be done
> automatically inside libssh?

It should be implemented this way but it isn't. I wanted to do that for 0.4.1. 
If you have time feel free to fix it.

Read the first line and then comapre it with RSA_HEADER_BEGIN and 
DSA_HEADER_BEGIN. Then set the type.

The next step should be in the auth functions to check for public keys. If 
there is none get it from the private key ...

If you have time, feel free to implement it. I don't know when I will have the 
time to fix it. There is more stuff which needs to be cleaned up.

	-- andreas

cybernetic synapses - http://www.cynapses.org/

Attachment: signature.asc
Description: This is a digitally signed message part.

Re: Question on privatekey_from_fileAris Adamantiadis <aris@xxxxxxxxxxxx>
Re: Question on privatekey_from_fileVic Lee <llyzs@xxxxxxx>
Question on privatekey_from_fileVic Lee <llyzs@xxxxxxx>
Archive administrator: postmaster@lists.cynapses.org