From 46b96a145cde14b7ecf4a9608173508aa877b9fa Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Mon, 17 Mar 2008 02:31:22 +0000 Subject: preliminary test suite git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@153 7dcaeef0-15fb-0310-b436-a5af3365683c --- tests/authentication.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tests/authentication.c (limited to 'tests/authentication.c') diff --git a/tests/authentication.c b/tests/authentication.c new file mode 100644 index 00000000..00abd052 --- /dev/null +++ b/tests/authentication.c @@ -0,0 +1,74 @@ +/* +This file is distributed in public domain. You can do whatever you want +with its content. +*/ + + +#include +#include +#include +#include + +#include + +#include "tests.h" +static int auth_kbdint(SSH_SESSION *session){ + int err=ssh_userauth_kbdint(session,NULL,NULL); + char *name,*instruction,*prompt,*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