Lines Matching defs:method

99 #define MATCH_NONE	0	/* method or submethod mismatch */
100 #define MATCH_METHOD 1 /* method matches (no submethod specified) */
101 #define MATCH_BOTH 2 /* method and submethod match */
102 #define MATCH_PARTIAL 3 /* method matches, submethod can't be checked */
273 char *user = NULL, *service = NULL, *method = NULL, *style = NULL;
282 (r = sshpkt_get_cstring(ssh, &method, NULL)) != 0)
284 debug("userauth-request for user %s service %s method %s", user, service, method);
343 m = authmethod_lookup(authctxt, method);
345 debug2("input_userauth_request: try method %s", method);
346 authenticated = m->userauth(ssh, method);
348 if (!authctxt->authenticated && strcmp(method, "none") != 0)
351 userauth_finish(ssh, authenticated, method, NULL);
356 free(method);
366 const char *method = packet_method;
378 if ((m = authmethod_byname(method)) == NULL)
379 fatal("INTERNAL ERROR: bad method %s", method);
380 method = m->cfg->name;
385 !auth_root_allowed(ssh, method)) {
393 if (!auth2_update_methods_lists(authctxt, method, submethod)) {
400 auth_log(ssh, authenticated, partial, method, submethod);
404 auth2_update_session_info(authctxt, method, submethod);
445 (authctxt->attempt > 1 || strcmp(method, "none") != 0))
467 * Checks whether method is allowed by at least one AuthenticationMethods
472 auth2_method_allowed(Authctxt *authctxt, const char *method,
484 if (list_starts_with(authctxt->auth_methods[i], method,
525 fatal_f("NULL authentication method name");
532 debug_f("unrecognized authentication method name: %s", name);
539 Authmethod *method;
541 if ((method = authmethod_byname(name)) == NULL)
544 if (method->cfg->enabled == NULL || *(method->cfg->enabled) == 0) {
545 debug3_f("method %s not enabled", name);
548 if (!auth2_method_allowed(authctxt, method->cfg->name, NULL)) {
549 debug3_f("method %s not allowed "
553 return method;
568 /* First, normalise away the "any" pseudo-method */
585 "disabled method, skipping",
603 list_starts_with(const char *methods, const char *method,
606 size_t l = strlen(method);
610 if (strncmp(methods, method, l) != 0)
630 * Remove method from the start of a comma-separated list of methods.
631 * Returns 0 if the list of methods did not start with that method or 1
635 remove_method(char **methods, const char *method, const char *submethod)
638 size_t l = strlen(method);
641 match = list_starts_with(omethods, method, submethod);
655 * Called after successful authentication. Will remove the successful method
656 * from the start of each list in which it occurs. If it was the last method
658 * Returns 1 if the method completed any authentication list or 0 otherwise.
661 auth2_update_methods_lists(Authctxt *authctxt, const char *method,
666 debug3_f("updating methods list after \"%s\"", method);
668 if (!remove_method(&(authctxt->auth_methods[i]), method,
681 fatal_f("method not in AuthenticationMethods");
685 /* Reset method-specific information */
694 /* Record auth method-specific information for logs */
768 * whenever an authentication method succeeds.
771 auth2_update_session_info(Authctxt *authctxt, const char *method,
781 /* Append method[/submethod] */
783 method, submethod == NULL ? "" : "/",
785 fatal_fr(r, "append method");
802 fatal_fr(r, "append method info");