comparison cli-auth.c @ 1821:df8d8ec1801c

added option to disable trivial auth methods (#128) * added option to disable trivial auth methods * rename argument to match with other ssh clients * fixed trivial auth detection for pubkeys
author Manfred Kaiser <37737811+manfred-kaiser@users.noreply.github.com>
date Thu, 19 Aug 2021 17:37:14 +0200
parents bf1912d2d6e9
children d512da7b1198
comparison
equal deleted inserted replaced
1820:e9854650d45b 1821:df8d8ec1801c
259 void recv_msg_userauth_success() { 259 void recv_msg_userauth_success() {
260 /* This function can validly get called multiple times 260 /* This function can validly get called multiple times
261 if DROPBEAR_CLI_IMMEDIATE_AUTH is set */ 261 if DROPBEAR_CLI_IMMEDIATE_AUTH is set */
262 262
263 TRACE(("received msg_userauth_success")) 263 TRACE(("received msg_userauth_success"))
264 if (cli_opts.disable_trivial_auth && cli_ses.is_trivial_auth) {
265 dropbear_exit("trivial authentication not allowed");
266 }
264 /* Note: in delayed-zlib mode, setting authdone here 267 /* Note: in delayed-zlib mode, setting authdone here
265 * will enable compression in the transport layer */ 268 * will enable compression in the transport layer */
266 ses.authstate.authdone = 1; 269 ses.authstate.authdone = 1;
267 cli_ses.state = USERAUTH_SUCCESS_RCVD; 270 cli_ses.state = USERAUTH_SUCCESS_RCVD;
268 cli_ses.lastauthtype = AUTH_TYPE_NONE; 271 cli_ses.lastauthtype = AUTH_TYPE_NONE;