comparison cli-auth.c @ 1514:6c16a05023aa

rename some options and move some to sysoptions.h
author Matt Johnston <matt@ucc.asn.au>
date Sun, 18 Feb 2018 00:29:17 +0800
parents 2d450c1056e3
children bf1912d2d6e9
comparison
equal deleted inserted replaced
1513:c7675aa88880 1514:6c16a05023aa
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;