aboutsummaryrefslogtreecommitdiff
path: root/examples/authentication.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-07 21:43:59 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-07 21:49:45 +0200
commitca74d91d503da30c59b00e5bc3e0ee209dd83ebd (patch)
tree5158d9ceaf6946841145e84cd409978c6cfedbb0 /examples/authentication.c
parent956cf94f70621a59fd3fe16401c9bcd658ea7f84 (diff)
downloadlibssh-ca74d91d503da30c59b00e5bc3e0ee209dd83ebd.tar.gz
libssh-ca74d91d503da30c59b00e5bc3e0ee209dd83ebd.tar.xz
libssh-ca74d91d503da30c59b00e5bc3e0ee209dd83ebd.zip
example: Clear the password.
Diffstat (limited to 'examples/authentication.c')
-rw-r--r--examples/authentication.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/authentication.c b/examples/authentication.c
index c233e300..0e749e54 100644
--- a/examples/authentication.c
+++ b/examples/authentication.c
@@ -86,7 +86,9 @@ int authenticate_kbdint(ssh_session session, const char *password) {
}
answer = buffer;
}
- if (ssh_userauth_kbdint_setanswer(session, i, answer) < 0) {
+ err = ssh_userauth_kbdint_setanswer(session, i, answer);
+ memset(buffer, 0, sizeof(buffer));
+ if (err < 0) {
return SSH_AUTH_ERROR;
}
}
@@ -152,6 +154,7 @@ int authenticate_console(ssh_session session){
break;
}
}
+ memset(password, 0, sizeof(password));
}
banner = ssh_get_issue_banner(session);