50 #include <sofia-sip/url_tag.h> 60 typedef AUTH_MAGIC_T auth_magic_t;
62 typedef void auth_magic_t;
105 url_t const *as_user_uri;
157 SOFIAPUBVAR char const auth_internal_server_error[];
159 #define AUTH_STATUS_INIT \ 160 {{ SU_HOME_INIT(auth_status_t) }, 500, auth_internal_server_error, NULL } 162 #define AUTH_STATUS_DEINIT(as) \ 163 su_home_deinit(as->as_home) 165 #define AUTH_RESPONSE_INIT(as) AUTH_STATUS_INIT 166 #define AUTH_RESPONSE_DEINIT(as) AUTH_STATUS_DEINIT(as) 192 msg_auth_t *credentials,
217 msg_auth_t *credentials,
222 msg_auth_t *credentials,
246 #define AUTHTAG_ANY() authtag_any, ((tag_value_t)0) 250 #define AUTHTAG_MODULE(x) authtag_module, authtag_module_v((x)) 253 #define AUTHTAG_MODULE_REF(x) authtag_module_ref, authtag_module_vr((&x)) 256 #if SU_INLINE_TAG_CAST 264 #define authtag_module_v(v) ((tag_value_t)(v)) 265 #define authtag_module_vr(v) ((tag_value_t)(v)) 269 #define AUTHTAG_METHOD(x) authtag_method, tag_str_v((x)) 272 #define AUTHTAG_METHOD_REF(x) authtag_method_ref, tag_str_vr((&x)) 276 #define AUTHTAG_REALM(x) authtag_realm, tag_str_v((x)) 279 #define AUTHTAG_REALM_REF(x) authtag_realm_ref, tag_str_vr((&x)) 283 #define AUTHTAG_OPAQUE(x) authtag_opaque, tag_str_v((x)) 286 #define AUTHTAG_OPAQUE_REF(x) authtag_opaque_ref, tag_str_vr((&x)) 290 #define AUTHTAG_DB(x) authtag_db, tag_str_v((x)) 293 #define AUTHTAG_DB_REF(x) authtag_db_ref, tag_str_vr((&x)) 297 #define AUTHTAG_QOP(x) authtag_qop, tag_str_v((x)) 300 #define AUTHTAG_QOP_REF(x) authtag_qop_ref, tag_str_vr((&x)) 304 #define AUTHTAG_ALGORITHM(x) authtag_algorithm, tag_str_v((x)) 307 #define AUTHTAG_ALGORITHM_REF(x) authtag_algorithm_ref, tag_str_vr((&x)) 311 #define AUTHTAG_EXPIRES(x) authtag_expires, tag_uint_v((x)) 314 #define AUTHTAG_EXPIRES_REF(x) authtag_expires_ref, tag_uint_vr((&x)) 318 #define AUTHTAG_NEXT_EXPIRES(x) authtag_next_expires, tag_uint_v((x)) 321 #define AUTHTAG_NEXT_EXPIRES_REF(x) \ 322 authtag_next_expires_ref, tag_uint_vr((&x)) 326 #define AUTHTAG_MAX_NCOUNT(x) authtag_max_ncount, tag_uint_v((x)) 329 #define AUTHTAG_MAX_NCOUNT_REF(x) authtag_max_ncount_ref, tag_uint_vr((&x)) 333 #define AUTHTAG_BLACKLIST(x) authtag_blacklist, tag_uint_v((x)) 336 #define AUTHTAG_BLACKLIST_REF(x) authtag_blacklist_ref, tag_uint_vr((&x)) 340 #define AUTHTAG_FORBIDDEN(x) authtag_forbidden, tag_bool_v((x)) 343 #define AUTHTAG_FORBIDDEN_REF(x) authtag_forbidden_ref, tag_bool_vr((&x)) 347 #define AUTHTAG_ANONYMOUS(x) authtag_anonymous, tag_bool_v((x)) 350 #define AUTHTAG_ANONYMOUS_REF(x) authtag_anonymous_ref, tag_bool_vr((&x)) 354 #define AUTHTAG_HSS(x) authtag_hss, tag_ptr_v((x)) 357 #define AUTHTAG_HSS_REF(x) authtag_hss_ref, tag_ptr_vr((&x), (x)) 361 #define AUTHTAG_REMOTE(x) authtag_remote, urltag_url_v((x)) 364 #define AUTHTAG_REMOTE_REF(x) authtag_remote_ref, urltag_url_vr((&x)) 368 #define AUTHTAG_ALLOW(x) authtag_allow, tag_str_v((x)) 371 #define AUTHTAG_ALLOW_REF(x) authtag_allow_ref, tag_str_vr((&x)) 375 #define AUTHTAG_FAKE(x) authtag_fake, tag_bool_v((x)) 378 #define AUTHTAG_FAKE_REF(x) authtag_fake_ref, tag_bool_vr((&x)) 382 #define AUTHTAG_MASTER_KEY(x) authtag_master_key, tag_str_v((x)) 385 #define AUTHTAG_MASTER_KEY_REF(x) authtag_master_key_ref, tag_str_vr((&x)) 389 #define AUTHTAG_CACHE_USERS(x) authtag_cache_users, tag_uint_v((x)) 392 #define AUTHTAG_CACHE_USERS_REF(x) authtag_cache_users_ref, tag_uint_vr((&x)) 396 #define AUTHTAG_CACHE_ERRORS(x) authtag_cache_errors, tag_uint_v((x)) 399 #define AUTHTAG_CACHE_ERRORS_REF(x) authtag_cache_errors_ref, tag_uint_vr((&x)) struct tag_type_s const tag_typedef_t[1]
struct msg_hclass_s const msg_hclass_t
auth_splugin_t * as_plugin
Pointer to extended state, used exclusively by plugin modules.
Definition: auth_module.h:139
int ach_status
Response status for challenge response.
Definition: auth_module.h:151
char const * as_uri
Request-URI [in].
Definition: auth_module.h:113
auth_mod_t * auth_mod_create(su_root_t *root, tag_type_t, tag_value_t,...)
Create an authentication plugin module.
Definition: auth_plugin.c:106
void auth_status_unref(auth_status_t *as)
Destroy (a reference to) an auth_status_t structure.
Definition: auth_module.c:350
msg_time_t as_nonce_issued
Nonce issue time [out].
Definition: auth_module.h:120
void auth_callback_t(auth_magic_t *, auth_status_t *)
Callback from completeted asynchronous authentication operation.
Definition: auth_module.h:76
struct tag_type_s const * tag_type_t
auth_status_t * auth_status_ref(auth_status_t *as)
Create a new reference to an auth_status_t structure.
Definition: auth_module.c:343
void const * as_body
Message body to protect [in].
Definition: auth_module.h:117
unsigned as_nextnonce
Client used nextnonce [out].
Definition: auth_module.h:125
int auth_mod_register_plugin(auth_scheme_t *asch)
Register an authentication plugin.
Definition: auth_plugin.c:78
char const * as_domain
Hostname [in].
Definition: auth_module.h:112
auth_status_t * auth_status_init_with(void *p, isize_t size, int status, char const *phrase)
Initialize a auth_status_t stucture.
Definition: auth_module.c:306
char const * as_phrase
Return response phrase [out].
Definition: auth_module.h:101
isize_t as_bodylen
Length of message body [in].
Definition: auth_module.h:118
char const * as_user
Authenticated username [in/out].
Definition: auth_module.h:102
unsigned as_blacklist
Blacklist time [out].
Definition: auth_module.h:121
struct auth_scheme const auth_scheme_t
Virtual table for authentication plugin.
Definition: auth_module.h:66
su_addrinfo_t * as_source
Source address [in].
Definition: auth_module.h:109
struct auth_uplugin_t auth_uplugin_t
Opaque authentication operation data used by plugin module.
Definition: auth_module.h:73
char const * as_method
Method name to authenticate [in].
Definition: auth_module.h:115
char const * as_display
Return user's real name [in/out].
Definition: auth_module.h:103
void auth_mod_challenge(auth_mod_t *am, auth_status_t *as, auth_challenger_t const *ach)
Make a challenge header.
Definition: auth_module.c:449
auth_callback_t * as_callback
Completion callback [in].
Definition: auth_module.h:135
char const * as_pdomain
Domain parameter [in] (ignored).
Definition: auth_module.h:114
struct addrinfo su_addrinfo_t
void auth_mod_verify(auth_mod_t *am, auth_status_t *as, msg_auth_t *credentials, auth_challenger_t const *ach)
Authenticate user.
Definition: auth_module.c:397
char const * ach_phrase
Response phrase for challenge response.
Definition: auth_module.h:152
int as_status
Return authorization status [out].
Definition: auth_module.h:100
unsigned as_stale
Credentials were stale [out].
Definition: auth_module.h:123
Authentication scheme.
Definition: auth_plugin.h:65
struct auth_splugin_t auth_splugin_t
Opaque user data used by plugin module.
Definition: auth_module.h:71
su_home_t as_home[1]
Memory home for authentication.
Definition: auth_module.h:98
void auth_mod_unref(auth_mod_t *am)
Destroy a reference to an authentication module.
Definition: auth_module.c:280
Authentication challenge.
Definition: auth_module.h:149
auth_magic_t * as_magic
Application data [in].
Definition: auth_module.h:134
void auth_mod_cancel(auth_mod_t *am, auth_status_t *as)
Cancel asynchronous authentication.
Definition: auth_module.c:464
auth_status_t * auth_status_init(void *p, isize_t size)
Initialize a auth_status_t stucture.
Definition: auth_module.c:296
struct auth_challenger auth_challenger_t
Authentication challenge.
Authentication operation result.
Definition: auth_module.h:96
unsigned as_allow
Method cannot be challenged [out].
Definition: auth_module.h:124
auth_status_t * auth_status_new(su_home_t *home)
Allocate a new auth_status_t structure.
Definition: auth_module.c:330
msg_header_t * as_info
Authentication-Info [out].
Definition: auth_module.h:129
msg_hclass_t * ach_header
Header class for challenge header.
Definition: auth_module.h:153
char const * as_realm
Authentication realm [in].
Definition: auth_module.h:111
msg_header_t * as_match
Used authentication header [out].
Definition: auth_module.h:130
struct auth_plugin_t auth_plugin_t
Opaque data used by authentication plugin module.
Definition: auth_module.h:69
auth_mod_t * auth_mod_ref(auth_mod_t *am)
Create a new reference to authentication module.
Definition: auth_module.c:274
struct su_root_t su_root_t
char const * auth_mod_name(auth_mod_t *am)
Get authenticatin module name.
Definition: auth_module.c:286
unsigned as_profile
User profile (group) [out].
Definition: auth_module.h:107
msg_header_t * as_response
Authentication challenge [out].
Definition: auth_module.h:128
Common data for authentication module.
Definition: auth_plugin.h:124
unsigned as_anonymous
Return true if user is anonymous [out].
Definition: auth_module.h:122
void auth_mod_destroy(auth_mod_t *)
Destroy (a reference to) an authentication module.
Definition: auth_module.c:252
char const * as_ident
Identities [out].
Definition: auth_module.h:106