#ifndef AUTH_REQUEST_H
#define AUTH_REQUEST_H
#include "net.h"
#include "var-expand.h"
#include "mech.h"
#include "userdb.h"
#include "passdb.h"
#include "auth-request-var-expand.h"
#include "password-scheme.h"
struct auth_client_connection;
enum auth_request_state {
};
enum auth_request_secured {
};
struct auth_request {
int refcount;
/* user contains the user who is being authenticated.
When master user is logging in as someone else, it gets more
complicated. Initially user is set to master's username and the
requested_login_user is set to destination username. After masterdb
has validated user as a valid master user, master_user is set to
user and user is set to requested_login_user. */
/* original_username contains the username exactly as given by the
client. this is needed at least with DIGEST-MD5 for password
verification. however with master logins the master username has
been dropped from it. */
const char *original_username;
/* the username after doing all internal translations, but before
being changed by a db lookup */
const char *translated_username;
/* realm for the request, may be specified by some auth mechanisms */
const char *realm;
/* extra_fields are returned in authentication reply. Fields prefixed
with "userdb_" are automatically placed to userdb_reply instead. */
/* the whole userdb result reply */
/* The final result of passdb lookup (delayed due to asynchronous
proxy DNS lookups) */
/* passdb lookups have a handler, userdb lookups don't */
unsigned int connect_uid;
unsigned int client_pid;
unsigned int id;
unsigned int policy_penalty;
unsigned int last_penalty;
const unsigned char *initial_response;
union {
const char *credentials_scheme;
const unsigned char *delayed_credentials;
void *context;
/* this is a lookup on auth socket (not login socket).
skip any proxying stuff if enabled. */
/* we're doing a userdb lookup now (we may have done passdb lookup
earlier) */
/* DIGEST-MD5 kludge */
/* auth_debug is enabled for this request */
/* flags received from auth client: */
/* current state: */
auth-workers to determine whether to send back a changed username. */
/* each passdb lookup can update the current success-status using the
result_* rules. the authentication succeeds only if this is TRUE
at the end. mechanisms that don't require passdb, but do a passdb
lookup anyway (e.g. GSSAPI) need to set this to TRUE by default. */
/* userdb equivalent of passdb_success */
/* the last userdb lookup failed either due to "tempfail" extra field
to a number */
/* userdb_* fields have been set by the passdb lookup, userdb prefetch
will work. */
/* userdb lookup's results are from cache */
/* ... mechanism specific data ... */
};
extern unsigned int auth_request_state_count[AUTH_REQUEST_STATE_MAX];
extern const char auth_default_subsystems[2];
struct auth_request *
struct auth_request *auth_request_new_dummy(void);
enum auth_request_state state);
const char *password,
const char *scheme,
const char *username,
const char **error_r);
const char *field,
const char *const *fields,
const char *name,
const char *const *values);
/* returns -1 = failed, 0 = callback is called later, 1 = finished */
const char *subsystem);
const char *plain_password,
const char *crypted_password,
const char *plain_password,
const char *crypted_password,
bool log_password_mismatch);
const char *subsystem,
const char *subsystem,
const char *subsystem,
const char *subsystem,
const char *subsystem);
const char *subsystem,
const char *message);
void
struct auth_request *request);
struct auth_request *request);
const unsigned char *credentials,
struct auth_request *request);
struct auth_request *request);
#endif