Subject: Re: [libssh2] userauth_keyboard_interactive problem

Re: [libssh2] userauth_keyboard_interactive problem

From: Mikhail Gusarov <>
Date: Sat, 15 Dec 2007 12:15:45 +0600

"Paul Thomas" <> writes:

> So when I'm using the library, my class has to have a static member
> function so that it can be passed into you library as a function
> pointer. Unfortunately a non-static member function can not be passed
> into the library.

You've got "abstract" void* pointer attached to every libssh2 to pass
any context to your handler (use libssh2_session_abstract to access it):

static void
        const char* name,
        int name_len, ...,
        void* abstract)
  MyCplusPlusWrapper* this_ = static_cast<MyCplusPlusWrapper*>(abstract);

  this_-> ....

This is pretty common pattern in C world, I'm pretty sure you've seen it
numerous times under the "ctx" or "context" name.

> 2) Is there any possibility that a future version of libssh2 will give
> the ability to just do something as simple as:
> libssh2_userauth_keyboard_interactive( session, username, password)
> Then if someone like me is using C++, then we aren't stuck only using
> static functions with keyboard interactive auth.

It's impossible. Have a look at the protocol specification.

SF.Net email is sponsored by:
Check out the new Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.;164216239;13503038;w?
libssh2-devel mailing list
Received on 2007-12-15