Lines Matching defs:authctxt
113 extern struct sshauthopt *auth_opts; /* XXX move to permanent ssh->authctxt? */
156 static Authctxt *authctxt;
287 authctxt = (Authctxt *)ssh->authctxt;
288 memset(authctxt, 0, sizeof(*authctxt));
289 ssh->authctxt = authctxt;
291 authctxt->loginmsg = loginmsg;
304 auth2_authctxt_reset_info(authctxt);
316 !auth2_update_methods_lists(authctxt,
328 if (authctxt->pw->pw_uid == 0 &&
351 authctxt->failures++;
353 auth2_update_session_info(authctxt,
357 if (authctxt->failures > options.max_authtries) {
366 if (!authctxt->valid) {
377 debug_f("user %s authenticated by privileged process", authctxt->user);
379 ssh->authctxt = NULL;
380 ssh_packet_set_log_preamble(ssh, "user %s", authctxt->user);
648 postauth = (authctxt && authctxt->pw && authctxt->authenticated);
848 if (authctxt->attempt++ != 0)
851 if ((r = sshbuf_get_cstring(m, &authctxt->user, NULL)) != 0)
854 pwent = getpwnamallow(ssh, authctxt->user);
856 setproctitle("%s [priv]", pwent ? authctxt->user : "unknown");
863 authctxt->pw = fakepw();
868 authctxt->pw = pwent;
869 authctxt->valid = 1;
896 authctxt->valid ? "authenticating" : "invalid ", authctxt->user);
901 authctxt->valid ? "" : "invalid user ",
902 authctxt->user, ssh_remote_ipaddr(ssh),
911 if (auth2_setup_methods_lists(authctxt) != 0) {
957 if ((r = sshbuf_get_cstring(m, &authctxt->service, NULL)) != 0 ||
958 (r = sshbuf_get_cstring(m, &authctxt->style, NULL)) != 0)
960 debug3_f("service=%s, style=%s", authctxt->service, authctxt->style);
962 if (strlen(authctxt->style) == 0) {
963 free(authctxt->style);
964 authctxt->style = NULL;
1049 success = bsdauth_query(authctxt, &name, &infotxt, &numprompts,
1081 if (authctxt->as == NULL)
1087 auth_userresponse(authctxt->as, response, 0);
1088 authctxt->as = NULL;
1156 sshpam_ctxt = (sshpam_device.init_ctx)(authctxt);
1291 if (key != NULL && authctxt->valid) {
1297 if (auth2_key_already_used(authctxt, key))
1302 allowed = user_key_allowed(ssh, authctxt->pw, key,
1309 if (auth2_key_already_used(authctxt, key))
1314 allowed = hostbased_key_allowed(ssh, authctxt->pw,
1316 auth2_record_info(authctxt,
1328 (key == NULL || !authctxt->valid) ? "invalid" : sshkey_type(key),
1331 auth2_record_key(authctxt, 0, key);
1402 xasprintf(&userstyle, "%s%s%s", authctxt->user,
1403 authctxt->style ? ":" : "",
1404 authctxt->style ? authctxt->style : "");
1473 xasprintf(&userstyle, "%s%s%s", authctxt->user,
1474 authctxt->style ? ":" : "",
1475 authctxt->style ? authctxt->style : "");
1586 authctxt->valid ? "" : "invalid user ",
1587 authctxt->user, ssh_remote_ipaddr(ssh),
1598 authctxt->valid ? "" : "invalid user ",
1599 authctxt->user, ssh_remote_ipaddr(ssh),
1604 auth2_record_key(authctxt, ret == 0, key);
1681 s->authctxt = authctxt;
1682 s->pw = authctxt->pw;
1687 pty_setowner(authctxt->pw, s->tty);
1697 mm_record_login(ssh, s, authctxt->pw);
2059 authenticated = authctxt->valid && ssh_gssapi_userok(authctxt->user);
2071 auth2_record_info(authctxt, "%s", displayname);