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

Re: password protected rsa server key.


Hi libssh, 

I would really love an answer to my previous email below.

Can this be done, for v0.6.0 release?

Alternatively, If I write a patch for it - can it be included in v0.6.0?
 Which is you preferred method of handling it (for my patch)?

thanks, 
drbob.



On Tue, 2013-08-27 at 00:39 +1000, drbob wrote:
> Hi, 
> 
> I've just checked out V0.6.0rc1, because I heard a rumour that it was possible to load your own RSA key from memory...
> 
> Having looked through the code, I see that the framework is there, 
> but some external facing functions/options seem to be missing (or more likely I missed them!).
> 
> Basically, I want to load a protected RSA key - without the password prompt.
> 
> There appears to be two ways to do this, 
>    with a function like:  pki.cc:  pki_private_key_from_base64( )  - from memory.
>    or,  pki.cc:  ssh_pki_import_privkey_file(...)   - from protected file.
> 
> Both functions have a "password" parameter / auth callback which is perfect for my needs.
> 
> But, it seems I cannot set the password, or import an rsa key via the set_bind_options() or ssh_bind  structure.
> 
> 
> bind.c:147
> ------- 
> int ssh_bind_listen(ssh_bind sshbind)
> {
> ...
>   if (sshbind->rsakey) {
>       		rc = ssh_pki_import_privkey_file(sshbind->rsakey,
>                                        NULL,  <---- PASSWORD PARAMETER.
>                                        NULL,  <---- auth_cb
>                                        NULL,
>                                        &sshbind->rsa);
> ...
> }
> 
> Is it possible to add a  SSH_BIND_OPTIONS_PASSWORD ???
> or is there a way to set the auth_callback for the bind_listen ???
> 
> ======
> 
> Alternatively, I noticed:
> 
> include/libssh/libssh.h:486:LIBSSH_API int ssh_pki_import_privkey_base64(const char *b64_key,...)
> 
> Is it possible to use this function to set the RSA key on the ssh_bind structure ???
> The ssh_bind_listen() fn  requires "rsakey" (filename) set, and doesn't accept setting "rsa".
>  
> 
> -----------------
> 
> Would love to have this feature in libssh0.6 release, and it is so close to there.
> 
> Thanks for your time and effort developing libssh!
> 
> drbob.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 



Follow-Ups:
Re: password protected rsa server key.Andreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org