#ifndef _SECURITY_AUTH_AGENT_H_
#define _SECURITY_AUTH_AGENT_H_
#if defined(__cplusplus)
extern "C" {
#endif
typedef enum _PluginState {
init,
created,
current,
deactivating,
active,
interrupting,
mechinterrupting,
dead
} PluginState;
typedef enum {
privilegedAuthHost,
securityAgent,
userAuthHost
} AuthHostType;
enum Reason {
noReason = 0, unknownReason,
newDatabase = 11, changePassphrase,
invalidPassphrase = 21,
passphraseIsNull = 31, passphraseTooSimple, passphraseRepeated, passphraseUnacceptable, oldPassphraseWrong,
userNotInGroup = 41, unacceptableUser,
tooManyTries = 61, noLongerNeeded, keychainAddFailed, generalErrorCancel,
worldChanged = 101
};
typedef enum {
tool = 'TOOL',
bundle = 'BNDL',
unknown = 'UNKN'
} RequestorType;
AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
agent_t agent_create(engine_t engine, mechanism_t mech, auth_token_t auth, process_t proc, bool firstMech);
AUTH_NONNULL_ALL
uint64_t agent_run(agent_t,auth_items_t hints, auth_items_t context, auth_items_t immutable_hints);
AUTH_NONNULL_ALL
auth_items_t agent_get_hints(agent_t);
AUTH_NONNULL_ALL
auth_items_t agent_get_context(agent_t);
AUTH_NONNULL_ALL
void agent_deactivate(agent_t);
AUTH_NONNULL_ALL
void agent_destroy(agent_t);
AUTH_NONNULL_ALL
PluginState agent_get_state(agent_t);
AUTH_NONNULL_ALL
mechanism_t agent_get_mechanism(agent_t);
AUTH_NONNULL_ALL
void agent_receive(agent_t);
AUTH_NONNULL_ALL
void
agent_notify_interrupt(agent_t agent);
AUTH_NONNULL_ALL
void
agent_clear_interrupt(agent_t agent);
#if defined(__cplusplus)
}
#endif
#endif