comparison cli-auth.c @ 1115:efb7e545a65e

Turn banner, methods and tok local variable into char *
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 23:48:57 +0200
parents c45d65392c1a
children aaf576b27a10
comparison
equal deleted inserted replaced
1114:db7963049308 1115:efb7e545a65e
73 TRACE(("leave cli_auth_getmethods")) 73 TRACE(("leave cli_auth_getmethods"))
74 } 74 }
75 75
76 void recv_msg_userauth_banner() { 76 void recv_msg_userauth_banner() {
77 77
78 unsigned char* banner = NULL; 78 char* banner = NULL;
79 unsigned int bannerlen; 79 unsigned int bannerlen;
80 unsigned int i, linecount; 80 unsigned int i, linecount;
81 81
82 TRACE(("enter recv_msg_userauth_banner")) 82 TRACE(("enter recv_msg_userauth_banner"))
83 if (ses.authstate.authdone) { 83 if (ses.authstate.authdone) {
84 TRACE(("leave recv_msg_userauth_banner: banner after auth done")) 84 TRACE(("leave recv_msg_userauth_banner: banner after auth done"))
85 return; 85 return;
86 } 86 }
87 87
88 banner = buf_getstring(ses.payload, &bannerlen); 88 banner = (char *)buf_getstring(ses.payload, &bannerlen);
89 buf_eatstring(ses.payload); /* The language string */ 89 buf_eatstring(ses.payload); /* The language string */
90 90
91 if (bannerlen > MAX_BANNER_SIZE) { 91 if (bannerlen > MAX_BANNER_SIZE) {
92 TRACE(("recv_msg_userauth_banner: bannerlen too long: %d", bannerlen)) 92 TRACE(("recv_msg_userauth_banner: bannerlen too long: %d", bannerlen))
93 goto out; 93 goto out;
149 dropbear_exit("Unexpected userauth packet"); 149 dropbear_exit("Unexpected userauth packet");
150 } 150 }
151 151
152 void recv_msg_userauth_failure() { 152 void recv_msg_userauth_failure() {
153 153
154 unsigned char * methods = NULL; 154 char * methods = NULL;
155 unsigned char * tok = NULL; 155 char * tok = NULL;
156 unsigned int methlen = 0; 156 unsigned int methlen = 0;
157 unsigned int partial = 0; 157 unsigned int partial = 0;
158 unsigned int i = 0; 158 unsigned int i = 0;
159 159
160 TRACE(("<- MSG_USERAUTH_FAILURE")) 160 TRACE(("<- MSG_USERAUTH_FAILURE"))
199 #endif 199 #endif
200 cli_ses.state = USERAUTH_FAIL_RCVD; 200 cli_ses.state = USERAUTH_FAIL_RCVD;
201 cli_ses.lastauthtype = AUTH_TYPE_NONE; 201 cli_ses.lastauthtype = AUTH_TYPE_NONE;
202 } 202 }
203 203
204 methods = buf_getstring(ses.payload, &methlen); 204 methods = (char *)buf_getstring(ses.payload, &methlen);
205 205
206 partial = buf_getbool(ses.payload); 206 partial = buf_getbool(ses.payload);
207 207
208 if (partial) { 208 if (partial) {
209 dropbear_log(LOG_INFO, "Authentication partially succeeded, more attempts required"); 209 dropbear_log(LOG_INFO, "Authentication partially succeeded, more attempts required");