1
0
mirror of http://galexander.org/git/simplesshd.git synced 2025-07-06 11:02:34 +00:00

improve the formatting of the password message in the log

This commit is contained in:
Greg Alexander 2016-10-16 18:25:00 -04:00
parent cbee2a1b67
commit 8a9503ac90

View File

@ -81,6 +81,7 @@ static void authclear() {
if (authkeys_exists()) { if (authkeys_exists()) {
ses.authstate.authtypes = AUTH_TYPE_PUBKEY; ses.authstate.authtypes = AUTH_TYPE_PUBKEY;
} else { } else {
/* NB - don't use Il1O0 because they're visually ambiguous */
static const char tab64[64] = static const char tab64[64] =
"abcdefghijk!mnopqrstuvwxyzABCDEFGH@JKLMN#PQRSTUVWXYZ$%23456789^&"; "abcdefghijk!mnopqrstuvwxyzABCDEFGH@JKLMN#PQRSTUVWXYZ$%23456789^&";
char pw[9]; char pw[9];
@ -91,7 +92,10 @@ static void authclear() {
pw[i] = tab64[pw[i] & 63]; pw[i] = tab64[pw[i] & 63];
} }
pw[8] = 0; pw[8] = 0;
fprintf(stderr, "no authorized keys, temporary password: %s\n", pw); dropbear_log(LOG_WARNING, "no authorized keys, generating single-use password:");
dropbear_log(LOG_ALERT, "--------", pw);
dropbear_log(LOG_ALERT, "%s", pw);
dropbear_log(LOG_ALERT, "--------", pw);
ses.authstate.pw_passwd = m_strdup(pw); ses.authstate.pw_passwd = m_strdup(pw);
} }
#endif /* 0 */ #endif /* 0 */