comparison svr-auth.c @ 594:a98a2138364a

Improve capitalisation for all logged strings
author Matt Johnston <matt@ucc.asn.au>
date Wed, 23 Feb 2011 15:50:30 +0000
parents d3ea8b9672f0
children d40f3cc47aed
comparison
equal deleted inserted replaced
593:ea103e4476ce 594:a98a2138364a
220 /* new user or username has changed */ 220 /* new user or username has changed */
221 if (ses.authstate.username == NULL || 221 if (ses.authstate.username == NULL ||
222 strcmp(username, ses.authstate.username) != 0) { 222 strcmp(username, ses.authstate.username) != 0) {
223 /* the username needs resetting */ 223 /* the username needs resetting */
224 if (ses.authstate.username != NULL) { 224 if (ses.authstate.username != NULL) {
225 dropbear_log(LOG_WARNING, "client trying multiple usernames from %s", 225 dropbear_log(LOG_WARNING, "Client trying multiple usernames from %s",
226 svr_ses.addrstring); 226 svr_ses.addrstring);
227 m_free(ses.authstate.username); 227 m_free(ses.authstate.username);
228 } 228 }
229 authclear(); 229 authclear();
230 fill_passwd(username); 230 fill_passwd(username);
233 233
234 /* check that user exists */ 234 /* check that user exists */
235 if (!ses.authstate.pw_name) { 235 if (!ses.authstate.pw_name) {
236 TRACE(("leave checkusername: user '%s' doesn't exist", username)) 236 TRACE(("leave checkusername: user '%s' doesn't exist", username))
237 dropbear_log(LOG_WARNING, 237 dropbear_log(LOG_WARNING,
238 "login attempt for nonexistent user from %s", 238 "Login attempt for nonexistent user from %s",
239 svr_ses.addrstring); 239 svr_ses.addrstring);
240 send_msg_userauth_failure(0, 1); 240 send_msg_userauth_failure(0, 1);
241 return DROPBEAR_FAILURE; 241 return DROPBEAR_FAILURE;
242 } 242 }
243 243
250 } 250 }
251 251
252 /* check for an empty password */ 252 /* check for an empty password */
253 if (ses.authstate.pw_passwd[0] == '\0') { 253 if (ses.authstate.pw_passwd[0] == '\0') {
254 TRACE(("leave checkusername: empty pword")) 254 TRACE(("leave checkusername: empty pword"))
255 dropbear_log(LOG_WARNING, "user '%s' has blank password, rejected", 255 dropbear_log(LOG_WARNING, "User '%s' has blank password, rejected",
256 ses.authstate.pw_name); 256 ses.authstate.pw_name);
257 send_msg_userauth_failure(0, 1); 257 send_msg_userauth_failure(0, 1);
258 return DROPBEAR_FAILURE; 258 return DROPBEAR_FAILURE;
259 } 259 }
260 260
279 } 279 }
280 } 280 }
281 /* no matching shell */ 281 /* no matching shell */
282 endusershell(); 282 endusershell();
283 TRACE(("no matching shell")) 283 TRACE(("no matching shell"))
284 dropbear_log(LOG_WARNING, "user '%s' has invalid shell, rejected", 284 dropbear_log(LOG_WARNING, "User '%s' has invalid shell, rejected",
285 ses.authstate.pw_name); 285 ses.authstate.pw_name);
286 send_msg_userauth_failure(0, 1); 286 send_msg_userauth_failure(0, 1);
287 return DROPBEAR_FAILURE; 287 return DROPBEAR_FAILURE;
288 288
289 goodshell: 289 goodshell:
341 unsigned int delay; 341 unsigned int delay;
342 genrandom((unsigned char*)&delay, sizeof(delay)); 342 genrandom((unsigned char*)&delay, sizeof(delay));
343 /* We delay for 300ms +- 50ms, 0.1ms granularity */ 343 /* We delay for 300ms +- 50ms, 0.1ms granularity */
344 delay = 250000 + (delay % 1000)*100; 344 delay = 250000 + (delay % 1000)*100;
345 usleep(delay); 345 usleep(delay);
346 dropbear_log(LOG_INFO, "delay is %d", delay);
347 ses.authstate.failcount++; 346 ses.authstate.failcount++;
348 } 347 }
349 348
350 if (ses.authstate.failcount >= MAX_AUTH_TRIES) { 349 if (ses.authstate.failcount >= MAX_AUTH_TRIES) {
351 char * userstr; 350 char * userstr;