From f9f8ded7f0a691c0b46ccff596944ef1b06cf8a8 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 29 Dec 2008 11:33:51 +0000 Subject: Add a more generic auth callback function. You should be able to obtain passwords or usernames with this function. Signed-off-by: Andreas Schneider git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@198 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/options.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libssh/options.c') diff --git a/libssh/options.c b/libssh/options.c index 762980d..9de84ad 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -101,7 +101,8 @@ SSH_OPTIONS *ssh_options_copy(SSH_OPTIONS *opt){ for(i=0;i<10;++i) if(opt->wanted_methods[i]) ret->wanted_methods[i]=strdup(opt->wanted_methods[i]); - ret->passphrase_function=opt->passphrase_function; + ret->auth_function=opt->auth_function; + ret->auth_userdata=opt->auth_userdata; ret->connect_status_function=opt->connect_status_function; ret->connect_status_arg=opt->connect_status_arg; ret->timeout=opt->timeout; @@ -571,6 +572,14 @@ int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv){ return 0 ; } +void ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback cb, + void *userdata) { + if (opt == NULL) { + return; + } + opt->auth_function = cb; + opt->auth_userdata = userdata; +} /** @} */ -- cgit