comparison cli-authpasswd.c @ 293:9d110777f345 contrib-blacklist

propagate from branch 'au.asn.ucc.matt.dropbear' (head 7ad1775ed65e75dbece27fe6b65bf1a234db386a) to branch 'au.asn.ucc.matt.dropbear.contrib.blacklist' (head 1d86a4f0a401cc68c2670d821a2f6366c37af143)
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Mar 2006 06:31:29 +0000
parents 475a818dd6e7
children 8f3ec7c104d9
comparison
equal deleted inserted replaced
247:c07de41b53d7 293:9d110777f345
111 TRACE(("leave gui_getpass")) 111 TRACE(("leave gui_getpass"))
112 return(buf); 112 return(buf);
113 } 113 }
114 #endif /* ENABLE_CLI_ASKPASS_HELPER */ 114 #endif /* ENABLE_CLI_ASKPASS_HELPER */
115 115
116 int cli_auth_password() { 116 void cli_auth_password() {
117 117
118 char* password = NULL; 118 char* password = NULL;
119 119
120 TRACE(("enter cli_auth_password")) 120 TRACE(("enter cli_auth_password"))
121 CHECKCLEARTOWRITE(); 121 CHECKCLEARTOWRITE();
123 #ifdef ENABLE_CLI_ASKPASS_HELPER 123 #ifdef ENABLE_CLI_ASKPASS_HELPER
124 if (want_askpass()) 124 if (want_askpass())
125 password = gui_getpass("Password: "); 125 password = gui_getpass("Password: ");
126 else 126 else
127 #endif 127 #endif
128 password = getpass("Password: "); 128 password = getpass_or_cancel("Password: ");
129
130 if (password == NULL)
131 return 0;
132 129
133 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); 130 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
134 131
135 buf_putstring(ses.writepayload, cli_opts.username, 132 buf_putstring(ses.writepayload, cli_opts.username,
136 strlen(cli_opts.username)); 133 strlen(cli_opts.username));
147 144
148 encrypt_packet(); 145 encrypt_packet();
149 m_burn(password, strlen(password)); 146 m_burn(password, strlen(password));
150 147
151 TRACE(("leave cli_auth_password")) 148 TRACE(("leave cli_auth_password"))
152 return 1; /* Password auth can always be tried */
153
154 } 149 }
155 #endif /* ENABLE_CLI_PASSWORD_AUTH */ 150 #endif /* ENABLE_CLI_PASSWORD_AUTH */