summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGa?l PORTAY <gael.portay@gmail.com>2015-05-02 16:30:59 +0200
committerGa?l PORTAY <gael.portay@gmail.com>2015-05-02 16:30:59 +0200
commit2a1c060bc623fc51568abc383a08874b54e5add1 (patch)
tree6639398aba8e9ee85909c9783a9bd666216a40a8
parent906efe89d0fdcf4b3ccb984eb2931402e79586cd (diff)
downloaddropbear-2a1c060bc623fc51568abc383a08874b54e5add1.tar.gz
Turn get_response()'s return type and prompt argument into char *
-rw-r--r--cli-authinteract.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/cli-authinteract.c b/cli-authinteract.c
index 192a54e..a7987eb 100644
--- a/cli-authinteract.c
+++ b/cli-authinteract.c
@@ -31,10 +31,10 @@
#ifdef ENABLE_CLI_INTERACT_AUTH
-static unsigned char* get_response(unsigned char* prompt)
+static char* get_response(char* prompt)
{
FILE* tty = NULL;
- unsigned char* response = NULL;
+ char* response = NULL;
/* not a password, but a reasonable limit */
char buf[DROPBEAR_MAX_CLI_PASS];
char* ret = NULL;
@@ -50,13 +50,13 @@ static unsigned char* get_response(unsigned char* prompt)
}
if (ret == NULL) {
- response = (unsigned char*)m_strdup("");
+ response = m_strdup("");
} else {
unsigned int buflen = strlen(buf);
/* fgets includes newlines */
if (buflen > 0 && buf[buflen-1] == '\n')
buf[buflen-1] = '\0';
- response = (unsigned char*)m_strdup(buf);
+ response = m_strdup(buf);
}
m_burn(buf, sizeof(buf));
@@ -71,9 +71,9 @@ void recv_msg_userauth_info_request() {
unsigned int num_prompts = 0;
unsigned int i;
- unsigned char *prompt = NULL;
+ char *prompt = NULL;
unsigned int echo = 0;
- unsigned char *response = NULL;
+ char *response = NULL;
TRACE(("enter recv_msg_recv_userauth_info_request"))
@@ -115,13 +115,13 @@ void recv_msg_userauth_info_request() {
for (i = 0; i < num_prompts; i++) {
unsigned int response_len = 0;
- prompt = buf_getstring(ses.payload, NULL);
+ prompt = (char *)buf_getstring(ses.payload, NULL);
cleantext(prompt);
echo = buf_getbool(ses.payload);
if (!echo) {
- unsigned char* p = getpass_or_cancel(prompt);
+ char* p = getpass_or_cancel(prompt);
response = m_strdup(p);
m_burn(p, strlen(p));
} else {
@@ -129,7 +129,7 @@ void recv_msg_userauth_info_request() {
}
response_len = strlen(response);
- buf_putstring(ses.writepayload, response, response_len);
+ buf_putstring(ses.writepayload, (const unsigned char *)response, response_len);
m_burn(response, response_len);
m_free(prompt);
m_free(response);