aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-30 14:07:33 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-30 14:07:33 +0000
commitd68016050082930e4e7fa7c87ef9c1046f9b518b (patch)
treefb2176b1191c816736ba9e5690b11fe549d5948f /libssh
parent2317a589968d7d906840dd2b1330174c6b1d7d0d (diff)
downloadlibssh-d68016050082930e4e7fa7c87ef9c1046f9b518b.tar.gz
libssh-d68016050082930e4e7fa7c87ef9c1046f9b518b.tar.xz
libssh-d68016050082930e4e7fa7c87ef9c1046f9b518b.zip
Add a BURN_STRING macro and use it in auth.c.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@660 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
-rw-r--r--libssh/auth.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index fbb073f..c83dea1 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -53,11 +53,6 @@ static int ask_userauth(SSH_SESSION *session) {
return rc;
}
-static void burn(char *ptr){
- if(ptr)
- memset(ptr,'X',strlen(ptr));
-}
-
static int wait_auth_status(SSH_SESSION *session,int kbdint){
int err=SSH_AUTH_ERROR;
int cont=1;
@@ -964,14 +959,14 @@ static void kbdint_free(struct ssh_kbdint *kbd) {
if (kbd->prompts) {
for (i = 0; i < n; i++) {
- burn(kbd->prompts[i]);
+ BURN_STRING(kbd->prompts[i]);
SAFE_FREE(kbd->prompts[i]);
}
SAFE_FREE(kbd->prompts);
}
if (kbd->answers) {
for (i = 0; i < n; i++) {
- burn(kbd->answers[i]);
+ BURN_STRING(kbd->answers[i]);
SAFE_FREE(kbd->answers[i]);
}
SAFE_FREE(kbd->answers);
@@ -995,7 +990,7 @@ static void kbdint_clean(struct ssh_kbdint *kbd) {
if (kbd->prompts) {
for (i = 0; i < n; i++) {
- burn(kbd->prompts[i]);
+ BURN_STRING(kbd->prompts[i]);
SAFE_FREE(kbd->prompts[i]);
}
SAFE_FREE(kbd->prompts);
@@ -1003,7 +998,7 @@ static void kbdint_clean(struct ssh_kbdint *kbd) {
if (kbd->answers) {
for (i = 0; i < n; i++) {
- burn(kbd->answers[i]);
+ BURN_STRING(kbd->answers[i]);
SAFE_FREE(kbd->answers[i]);
}
SAFE_FREE(kbd->answers);
@@ -1429,7 +1424,7 @@ int ssh_userauth_kbdint_setanswer(SSH_SESSION *session, unsigned int i,
}
if (session->kbdint->answers[i]) {
- burn(session->kbdint->answers[i]);
+ BURN_STRING(session->kbdint->answers[i]);
SAFE_FREE(session->kbdint->answers[i]);
}