From 3a95ecfe74ee770f6c0045768abe16faf29ca1aa Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sat, 7 Nov 2009 03:45:27 +0100 Subject: move authentication out of sampe.c --- examples/sample.c | 82 ++++--------------------------------------------------- 1 file changed, 6 insertions(+), 76 deletions(-) (limited to 'examples/sample.c') diff --git a/examples/sample.c b/examples/sample.c index 1768351..3f827f0 100644 --- a/examples/sample.c +++ b/examples/sample.c @@ -33,6 +33,7 @@ clients must be made or how a client should react. #include +#include "examples_common.h" #define MAXCMD 10 char *host; char *user; @@ -305,49 +306,9 @@ static void batch_shell(ssh_session session){ select_loop(session,channel); } -static int auth_kbdint(ssh_session session){ - int err=ssh_userauth_kbdint(session,NULL,NULL); - const char *name, *instruction, *prompt; - char *ptr; - char buffer[128]; - int i,n; - char echo; - while (err==SSH_AUTH_INFO){ - name=ssh_userauth_kbdint_getname(session); - instruction=ssh_userauth_kbdint_getinstruction(session); - n=ssh_userauth_kbdint_getnprompts(session); - if(strlen(name)>0) - printf("%s\n",name); - if(strlen(instruction)>0) - printf("%s\n",instruction); - for(i=0;i