Lines Matching defs:method
96 #define MATCH_NONE 0 /* method or submethod mismatch */
97 #define MATCH_METHOD 1 /* method matches (no submethod specified) */
98 #define MATCH_BOTH 2 /* method and submethod match */
99 #define MATCH_PARTIAL 3 /* method matches, submethod can't be checked */
263 char *user = NULL, *service = NULL, *method = NULL, *style = NULL;
272 (r = sshpkt_get_cstring(ssh, &method, NULL)) != 0)
274 debug("userauth-request for user %s service %s method %s", user, service, method);
326 m = authmethod_lookup(authctxt, method);
328 debug2("input_userauth_request: try method %s", method);
329 authenticated = m->userauth(ssh, method);
331 if (!authctxt->authenticated && strcmp(method, "none") != 0)
334 userauth_finish(ssh, authenticated, method, NULL);
339 free(method);
349 const char *method = packet_method;
361 if ((m = authmethod_byname(method)) == NULL)
362 fatal("INTERNAL ERROR: bad method %s", method);
363 method = m->cfg->name;
368 !auth_root_allowed(ssh, method))
372 if (!auth2_update_methods_lists(authctxt, method, submethod)) {
379 auth_log(ssh, authenticated, partial, method, submethod);
383 auth2_update_session_info(authctxt, method, submethod);
402 (authctxt->attempt > 1 || strcmp(method, "none") != 0))
420 * Checks whether method is allowed by at least one AuthenticationMethods
425 auth2_method_allowed(Authctxt *authctxt, const char *method,
437 if (list_starts_with(authctxt->auth_methods[i], method,
478 fatal_f("NULL authentication method name");
485 debug_f("unrecognized authentication method name: %s", name);
492 Authmethod *method;
494 if ((method = authmethod_byname(name)) == NULL)
497 if (method->cfg->enabled == NULL || *(method->cfg->enabled) == 0) {
498 debug3_f("method %s not enabled", name);
501 if (!auth2_method_allowed(authctxt, method->cfg->name, NULL)) {
502 debug3_f("method %s not allowed "
506 return method;
521 /* First, normalise away the "any" pseudo-method */
538 "disabled method, skipping",
556 list_starts_with(const char *methods, const char *method,
559 size_t l = strlen(method);
563 if (strncmp(methods, method, l) != 0)
583 * Remove method from the start of a comma-separated list of methods.
584 * Returns 0 if the list of methods did not start with that method or 1
588 remove_method(char **methods, const char *method, const char *submethod)
591 size_t l = strlen(method);
594 match = list_starts_with(omethods, method, submethod);
608 * Called after successful authentication. Will remove the successful method
609 * from the start of each list in which it occurs. If it was the last method
611 * Returns 1 if the method completed any authentication list or 0 otherwise.
614 auth2_update_methods_lists(Authctxt *authctxt, const char *method,
619 debug3_f("updating methods list after \"%s\"", method);
621 if (!remove_method(&(authctxt->auth_methods[i]), method,
634 fatal_f("method not in AuthenticationMethods");
638 /* Reset method-specific information */
647 /* Record auth method-specific information for logs */
721 * whenever an authentication method succeeds.
724 auth2_update_session_info(Authctxt *authctxt, const char *method,
734 /* Append method[/submethod] */
736 method, submethod == NULL ? "" : "/",
738 fatal_fr(r, "append method");
755 fatal_fr(r, "append method info");