comparison cli-auth.c @ 1546:bb8eaa26bc93 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Mon, 26 Feb 2018 22:44:48 +0800
parents 6c16a05023aa
children bf1912d2d6e9
comparison
equal deleted inserted replaced
1530:63fa53d3b6c7 1546:bb8eaa26bc93
58 Race described at 58 Race described at
59 http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/zlib-openssh.html 59 http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/zlib-openssh.html
60 */ 60 */
61 if (ses.keys->trans.algo_comp != DROPBEAR_COMP_ZLIB_DELAY) { 61 if (ses.keys->trans.algo_comp != DROPBEAR_COMP_ZLIB_DELAY) {
62 ses.authstate.authtypes = AUTH_TYPE_PUBKEY; 62 ses.authstate.authtypes = AUTH_TYPE_PUBKEY;
63 #if DROPBEAR_USE_DROPBEAR_PASSWORD 63 #if DROPBEAR_USE_PASSWORD_ENV
64 if (getenv(DROPBEAR_PASSWORD_ENV)) { 64 if (getenv(DROPBEAR_PASSWORD_ENV)) {
65 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT; 65 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT;
66 } 66 }
67 #endif 67 #endif
68 if (cli_auth_try() == DROPBEAR_SUCCESS) { 68 if (cli_auth_try() == DROPBEAR_SUCCESS) {
335 * password is statically allocated by getpass() */ 335 * password is statically allocated by getpass() */
336 char* getpass_or_cancel(const char* prompt) 336 char* getpass_or_cancel(const char* prompt)
337 { 337 {
338 char* password = NULL; 338 char* password = NULL;
339 339
340 #if DROPBEAR_USE_DROPBEAR_PASSWORD 340 #if DROPBEAR_USE_PASSWORD_ENV
341 /* Password provided in an environment var */ 341 /* Password provided in an environment var */
342 password = getenv(DROPBEAR_PASSWORD_ENV); 342 password = getenv(DROPBEAR_PASSWORD_ENV);
343 if (password) 343 if (password)
344 { 344 {
345 return password; 345 return password;