From 839be89a49de99fb606babd2f0f662362d39613c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 16 Jul 2007 22:16:21 +0000 Subject: [PATCH] added test success messages. --- example/simple/ssh2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/example/simple/ssh2.c b/example/simple/ssh2.c index fe94420..bcde0d8 100644 --- a/example/simple/ssh2.c +++ b/example/simple/ssh2.c @@ -1,5 +1,5 @@ /* - * $Id: ssh2.c,v 1.5 2007/07/14 21:24:38 bagder Exp $ + * $Id: ssh2.c,v 1.6 2007/07/16 22:16:21 gknauf Exp $ * * Sample showing how to do SSH2 connect. * @@ -105,12 +105,16 @@ int main(int argc, char *argv[]) if (libssh2_userauth_password(session, username, password)) { printf("Authentication by password failed.\n"); goto shutdown; + } else { + printf("Authentication by password succeeded.\n"); } } else { /* Or by public key */ if (libssh2_userauth_publickey_fromfile(session, username, "/home/username/.ssh/id_rsa.pub", "/home/username/.ssh/id_rsa", password)) { printf("\tAuthentication by public key failed\n"); goto shutdown; + } else { + printf("Authentication by public key succeeded.\n"); } } @@ -176,6 +180,6 @@ int main(int argc, char *argv[]) sleep(1); close(sock); #endif - printf("all done\n"); + printf("all done!\n"); return 0; }