Commit d55ffd95 authored by Pekka Pessi's avatar Pekka Pessi

Updated headers in iptsec module.

Added SOFIAPUBFUN and SOFIAPUBVAR where needed.
Removed auc_with_uicc().

darcs-hash:20060502154127-65a35-bc404fe28133b5cfcb178db4972dde3d25100185.gz
parent cf5ae1d4
......@@ -138,29 +138,6 @@ void ca_destroy(su_home_t *home, auth_client_t *ca)
su_free(home, ca);
}
/** Initialize AKA authenticator.
*
* The function auc_with_uicc() initializes the AKA authenticator to the
* list of authenticators @a auc_list.
*
* @param auc_list [in/out] list of authenticators to be updated
* @param home [in/out] memory home used for allocating authenticators
* @param uicc [in] UICC object
*
* @retval 0 when successful
* @retval -1 upon an error
*/
int auc_with_uicc(auth_client_t **auc_list,
su_home_t *home,
struct uicc_s *uicc)
{
#if HAVE_UICC_H
/* Xyzzy. */
#endif
return -1;
}
/** Initialize authenticators.
*
* The function auc_challenge() merges the challenge @a ch to the list of
......
......@@ -52,36 +52,43 @@ SOFIA_BEGIN_DECLS
/** Authenticator object. */
typedef struct auth_client_s auth_client_t;
SOFIAPUBFUN
int auc_challenge(auth_client_t **auc, su_home_t *home,
msg_auth_t const *auth,
msg_hclass_t *crcl);
SOFIAPUBFUN
int auc_credentials(auth_client_t **auc, su_home_t *home, char const *data);
SOFIAPUBFUN
int auc_all_credentials(auth_client_t **auc_list,
char const *scheme,
char const *realm,
char const *user,
char const *pass);
SOFIAPUBFUN
int auc_clear_credentials(auth_client_t **auc_list,
char const *scheme,
char const *realm);
SOFIAPUBFUN
int auc_authorization(auth_client_t **auc_list, msg_t *msg, msg_pub_t *pub,
char const *method,
url_t const *url,
msg_payload_t const *body);
SOFIAPUBFUN
int auc_authorization_headers(auth_client_t **auc_list,
su_home_t *home,
char const *method,
url_t const *url,
msg_payload_t const *body,
msg_header_t **return_headers);
struct uicc_s;
struct sip_s;
int auc_with_uicc(auth_client_t **auc, su_home_t *home, struct uicc_s *uicc);
SOFIAPUBFUN
int auc_authorize(auth_client_t **auc, msg_t *msg, struct sip_s *sip);
SOFIA_END_DECLS
......
......@@ -23,21 +23,19 @@
*/
#ifndef AUTH_DIGEST_H /** Defined when <auth_digest.h> has been included. */
#define AUTH_DIGEST_H
#define AUTH_DIGEST_H
/**@file auth_digest.h
* Datatypes and functions for Digest authentication.
*
* The structures and functions here follow the RFC 2617.
*
* @sa
* <a href="ftp://ftp.ietf.org/rfc/rfc2617.txt">RFC 2617</a>,
* @sa @RFC2617,
* <i>"HTTP Authentication: Basic and Digest Access Authentication"</i>,
* J. Franks et al,
* June 1999.
*
* @sa Section 19 from
* <a href="ftp://ftp.ietf.org/internet-drafts/draft-ietf-sip-rfc2543bis-04.txt>draft-ietf-sip-rfc2543bis-04</a>.
* @sa @RFC3261 section 22
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
......@@ -70,6 +68,8 @@ SOFIA_BEGIN_DECLS
* qop-options = "qop" "=" <"> 1#qop-value <">
* qop-value = "auth" | "auth-int" | token
* @endcode
*
* @sa @RFC2617
*/
typedef struct {
int ac_size;
......@@ -142,20 +142,19 @@ SOFIAPUBFUN void auth_digest_challenge_free_params(su_home_t *home,
SOFIAPUBFUN int auth_digest_response_get(su_home_t *, auth_response_t *,
char const * const params[]);
int auth_digest_a1(auth_response_t *ar,
auth_hexmd5_t ha1,
char const *secret);
SOFIAPUBFUN int auth_digest_a1(auth_response_t *ar,
auth_hexmd5_t ha1,
char const *secret);
int auth_digest_a1sess(auth_response_t *ar,
auth_hexmd5_t ha1sess,
char const *ha1);
SOFIAPUBFUN int auth_digest_a1sess(auth_response_t *ar,
auth_hexmd5_t ha1sess,
char const *ha1);
int auth_digest_sessionkey(auth_response_t *, auth_hexmd5_t ha1,
char const *secret);
int auth_digest_response(auth_response_t *, auth_hexmd5_t response,
auth_hexmd5_t const ha1,
char const *method_name, void const *data, int dlen);
int auth_struct_copy(void *dst, void const *src, int s_size);
SOFIA_END_DECLS
......
......@@ -153,7 +153,7 @@ typedef struct auth_challenger
msg_hclass_t *ach_info;
} auth_challenger_t;
extern char const auth_internal_server_error[];
SOFIAPUBVAR char const auth_internal_server_error[];
#define AUTH_STATUS_INIT \
{{ SU_HOME_INIT(auth_status_t) }, 500, auth_internal_server_error, NULL }
......@@ -164,38 +164,40 @@ extern char const auth_internal_server_error[];
#define AUTH_RESPONSE_INIT(as) AUTH_STATUS_INIT
#define AUTH_RESPONSE_DEINIT(as) AUTH_STATUS_DEINIT(as)
int auth_mod_register_plugin(auth_scheme_t *asch);
SOFIAPUBFUN int auth_mod_register_plugin(auth_scheme_t *asch);
auth_mod_t *auth_mod_create(su_root_t *root, tag_type_t, tag_value_t, ...);
void auth_mod_destroy(auth_mod_t *);
SOFIAPUBFUN auth_mod_t *auth_mod_create(su_root_t *root,
tag_type_t, tag_value_t, ...);
SOFIAPUBFUN void auth_mod_destroy(auth_mod_t *);
auth_mod_t *auth_mod_ref(auth_mod_t *am);
void auth_mod_unref(auth_mod_t *am);
SOFIAPUBFUN auth_mod_t *auth_mod_ref(auth_mod_t *am);
SOFIAPUBFUN void auth_mod_unref(auth_mod_t *am);
auth_status_t *auth_status_init(void *, int size);
auth_status_t *auth_status_init_with(void *, int size,
int status, char const *phrase);
SOFIAPUBFUN auth_status_t *auth_status_init(void *, int size);
SOFIAPUBFUN auth_status_t *auth_status_init_with(void *, int size,
int status,
char const *phrase);
auth_status_t *auth_status_new(su_home_t *);
SOFIAPUBFUN auth_status_t *auth_status_new(su_home_t *);
auth_status_t *auth_status_ref(auth_status_t *as);
SOFIAPUBFUN auth_status_t *auth_status_ref(auth_status_t *as);
void auth_status_unref(auth_status_t *as);
SOFIAPUBFUN void auth_status_unref(auth_status_t *as);
void auth_mod_method(auth_mod_t *am,
auth_status_t *as,
msg_auth_t *credentials,
auth_challenger_t const *ach);
SOFIAPUBFUN void auth_mod_method(auth_mod_t *am,
auth_status_t *as,
msg_auth_t *credentials,
auth_challenger_t const *ach);
void auth_mod_challenge(auth_mod_t *am,
auth_status_t *as,
auth_challenger_t const *ach);
SOFIAPUBFUN void auth_mod_challenge(auth_mod_t *am,
auth_status_t *as,
auth_challenger_t const *ach);
void auth_mod_authorize(auth_mod_t *am,
auth_status_t *as,
auth_challenger_t const *ach);
SOFIAPUBFUN void auth_mod_authorize(auth_mod_t *am,
auth_status_t *as,
auth_challenger_t const *ach);
void auth_mod_cancel(auth_mod_t *am, auth_status_t *as);
SOFIAPUBFUN void auth_mod_cancel(auth_mod_t *am, auth_status_t *as);
/* ====================================================================== */
/* Compatibility interface */
......@@ -207,42 +209,46 @@ typedef enum {
auth_consume
} auth_kind_t;
void auth_mod_check_client(auth_mod_t *am,
auth_status_t *as,
msg_auth_t *credentials,
auth_challenger_t const *ach);
SOFIAPUBFUN void auth_mod_check_client(auth_mod_t *am,
auth_status_t *as,
msg_auth_t *credentials,
auth_challenger_t const *ach);
void auth_mod_challenge_client(auth_mod_t *am,
auth_status_t *as,
auth_challenger_t const *ach);
SOFIAPUBFUN void auth_mod_challenge_client(auth_mod_t *am,
auth_status_t *as,
auth_challenger_t const *ach);
#ifdef NTA_H
void auth_mod_check(auth_mod_t *am,
auth_status_t *as,
sip_t const *sip,
auth_kind_t proxy);
SOFIAPUBFUN void auth_mod_check(auth_mod_t *am,
auth_status_t *as,
sip_t const *sip,
auth_kind_t proxy);
#endif
#ifdef HTTP_H
const char *auth_mod_check_http(auth_mod_t *am,
auth_status_t *as,
http_t const *http,
auth_kind_t proxy);
SOFIAPUBFUN const char *auth_mod_check_http(auth_mod_t *am,
auth_status_t *as,
http_t const *http,
auth_kind_t proxy);
#endif
#define AUTHTAG_ANY() authtag_any, ((tag_value_t)0)
AUTH_DLL extern tag_typedef_t authtag_any;
SOFIAPUBVAR tag_typedef_t authtag_any;
/** Pointer to an authentication server (auth_mod_t). */
#define AUTHTAG_MODULE(x) authtag_module, authtag_module_v((x))
AUTH_DLL extern tag_typedef_t authtag_module;
SOFIAPUBVAR tag_typedef_t authtag_module;
#define AUTHTAG_MODULE_REF(x) authtag_module_ref, authtag_module_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_module_ref;
SOFIAPUBVAR tag_typedef_t authtag_module_ref;
#if SU_HAVE_INLINE
static inline tag_value_t authtag_module_v(auth_mod_t *v) { return (tag_value_t)v; }
static inline tag_value_t authtag_module_vr(auth_mod_t **vp) {return(tag_value_t)vp;}
static inline tag_value_t authtag_module_v(auth_mod_t *v) {
return (tag_value_t)v;
}
static inline tag_value_t authtag_module_vr(auth_mod_t **vp) {
return (tag_value_t)vp;
}
#else
#define authtag_module_v(v) (tag_value_t)(v)
#define authtag_module_vr(v) (tag_value_t)(v)
......@@ -250,136 +256,137 @@ static inline tag_value_t authtag_module_vr(auth_mod_t **vp) {return(tag_value_t
/** Authentication scheme used by authentication module. */
#define AUTHTAG_METHOD(x) authtag_method, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_method;
SOFIAPUBVAR tag_typedef_t authtag_method;
#define AUTHTAG_METHOD_REF(x) authtag_method_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_method_ref;
SOFIAPUBVAR tag_typedef_t authtag_method_ref;
/** Authentication realm used by authentication server. */
#define AUTHTAG_REALM(x) authtag_realm, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_realm;
SOFIAPUBVAR tag_typedef_t authtag_realm;
#define AUTHTAG_REALM_REF(x) authtag_realm_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_realm_ref;
SOFIAPUBVAR tag_typedef_t authtag_realm_ref;
/** Opaque authentication data always included in challenge. */
#define AUTHTAG_OPAQUE(x) authtag_opaque, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_opaque;
SOFIAPUBVAR tag_typedef_t authtag_opaque;
#define AUTHTAG_OPAQUE_REF(x) authtag_opaque_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_opaque_ref;
SOFIAPUBVAR tag_typedef_t authtag_opaque_ref;
/** Name of authentication database used by authentication server. */
#define AUTHTAG_DB(x) authtag_db, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_db;
SOFIAPUBVAR tag_typedef_t authtag_db;
#define AUTHTAG_DB_REF(x) authtag_db_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_db_ref;
SOFIAPUBVAR tag_typedef_t authtag_db_ref;
/** Quality-of-protection used by digest authentication. */
#define AUTHTAG_QOP(x) authtag_qop, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_qop;
SOFIAPUBVAR tag_typedef_t authtag_qop;
#define AUTHTAG_QOP_REF(x) authtag_qop_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_qop_ref;
SOFIAPUBVAR tag_typedef_t authtag_qop_ref;
/** Algorithm used by digest authentication. */
#define AUTHTAG_ALGORITHM(x) authtag_algorithm, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_algorithm;
SOFIAPUBVAR tag_typedef_t authtag_algorithm;
#define AUTHTAG_ALGORITHM_REF(x) authtag_algorithm_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_algorithm_ref;
SOFIAPUBVAR tag_typedef_t authtag_algorithm_ref;
/** Nonce lifetime. */
#define AUTHTAG_EXPIRES(x) authtag_expires, tag_uint_v((x))
AUTH_DLL extern tag_typedef_t authtag_expires;
SOFIAPUBVAR tag_typedef_t authtag_expires;
#define AUTHTAG_EXPIRES_REF(x) authtag_expires_ref, tag_uint_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_expires_ref;
SOFIAPUBVAR tag_typedef_t authtag_expires_ref;
/** Next nonce lifetime. */
/** Lifetime for nextnonce, 0 disables nextnonce. */
#define AUTHTAG_NEXT_EXPIRES(x) authtag_next_expires, tag_uint_v((x))
AUTH_DLL extern tag_typedef_t authtag_next_expires;
SOFIAPUBVAR tag_typedef_t authtag_next_expires;
#define AUTHTAG_NEXT_EXPIRES_REF(x) authtag_next_expires_ref, tag_uint_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_next_expires_ref;
#define AUTHTAG_NEXT_EXPIRES_REF(x) \
authtag_next_expires_ref, tag_uint_vr((&x))
SOFIAPUBVAR tag_typedef_t authtag_next_expires_ref;
/** Extra delay when responding if provided invalid credentials or nonce. */
#define AUTHTAG_BLACKLIST(x) authtag_blacklist, tag_uint_v((x))
AUTH_DLL extern tag_typedef_t authtag_blacklist;
SOFIAPUBVAR tag_typedef_t authtag_blacklist;
#define AUTHTAG_BLACKLIST_REF(x) authtag_blacklist_ref, tag_uint_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_blacklist_ref;
SOFIAPUBVAR tag_typedef_t authtag_blacklist_ref;
/** Respond with 403 Forbidden if given invalid credentials. */
#define AUTHTAG_FORBIDDEN(x) authtag_forbidden, tag_bool_v((x))
AUTH_DLL extern tag_typedef_t authtag_forbidden;
SOFIAPUBVAR tag_typedef_t authtag_forbidden;
#define AUTHTAG_FORBIDDEN_REF(x) authtag_forbidden_ref, tag_bool_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_forbidden_ref;
SOFIAPUBVAR tag_typedef_t authtag_forbidden_ref;
/** Allow anonymous access. */
#define AUTHTAG_ANONYMOUS(x) authtag_anonymous, tag_bool_v((x))
AUTH_DLL extern tag_typedef_t authtag_anonymous;
SOFIAPUBVAR tag_typedef_t authtag_anonymous;
#define AUTHTAG_ANONYMOUS_REF(x) authtag_anonymous_ref, tag_bool_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_anonymous_ref;
SOFIAPUBVAR tag_typedef_t authtag_anonymous_ref;
/** Fake authentication procedure - do not check result. */
#define AUTHTAG_FAKE(x) authtag_fake, tag_bool_v((x))
AUTH_DLL extern tag_typedef_t authtag_fake;
SOFIAPUBVAR tag_typedef_t authtag_fake;
#define AUTHTAG_FAKE_REF(x) authtag_fake_ref, tag_bool_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_fake_ref;
SOFIAPUBVAR tag_typedef_t authtag_fake_ref;
/** HSS client structure. */
#define AUTHTAG_HSS(x) authtag_hss, tag_ptr_v((x))
AUTH_DLL extern tag_typedef_t authtag_hss;
SOFIAPUBVAR tag_typedef_t authtag_hss;
#define AUTHTAG_HSS_REF(x) authtag_hss_ref, tag_ptr_vr((&x), (x))
AUTH_DLL extern tag_typedef_t authtag_hss_ref;
SOFIAPUBVAR tag_typedef_t authtag_hss_ref;
/** Remote authenticator URL. */
#define AUTHTAG_REMOTE(x) authtag_remote, urltag_url_v((x))
AUTH_DLL extern tag_typedef_t authtag_remote;
SOFIAPUBVAR tag_typedef_t authtag_remote;
#define AUTHTAG_REMOTE_REF(x) authtag_remote_ref, urltag_url_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_remote_ref;
SOFIAPUBVAR tag_typedef_t authtag_remote_ref;
/** Comma-separated list of methods never challenged. */
#define AUTHTAG_ALLOW(x) authtag_allow, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_allow;
SOFIAPUBVAR tag_typedef_t authtag_allow;
#define AUTHTAG_ALLOW_REF(x) authtag_allow_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_allow_ref;
SOFIAPUBVAR tag_typedef_t authtag_allow_ref;
/** Check that user exists, don't do authentication. */
#define AUTHTAG_FAKE(x) authtag_fake, tag_bool_v((x))
AUTH_DLL extern tag_typedef_t authtag_fake;
SOFIAPUBVAR tag_typedef_t authtag_fake;
#define AUTHTAG_FAKE_REF(x) authtag_fake_ref, tag_bool_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_fake_ref;
SOFIAPUBVAR tag_typedef_t authtag_fake_ref;
/** Master key in base64 for the authentication module. */
#define AUTHTAG_MASTER_KEY(x) authtag_master_key, tag_str_v((x))
AUTH_DLL extern tag_typedef_t authtag_master_key;
SOFIAPUBVAR tag_typedef_t authtag_master_key;
#define AUTHTAG_MASTER_KEY_REF(x) authtag_master_key_ref, tag_str_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_master_key_ref;
SOFIAPUBVAR tag_typedef_t authtag_master_key_ref;
/** Cache time for authentication data. */
#define AUTHTAG_CACHE_USERS(x) authtag_cache_users, tag_uint_v((x))
AUTH_DLL extern tag_typedef_t authtag_cache_users;
SOFIAPUBVAR tag_typedef_t authtag_cache_users;
#define AUTHTAG_CACHE_USERS_REF(x) authtag_cache_users_ref, tag_uint_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_cache_users_ref;
SOFIAPUBVAR tag_typedef_t authtag_cache_users_ref;
/** Cache time for errors. */
#define AUTHTAG_CACHE_ERRORS(x) authtag_cache_errors, tag_uint_v((x))
AUTH_DLL extern tag_typedef_t authtag_cache_errors;
SOFIAPUBVAR tag_typedef_t authtag_cache_errors;
#define AUTHTAG_CACHE_ERRORS_REF(x) authtag_cache_errors_ref, tag_uint_vr((&x))
AUTH_DLL extern tag_typedef_t authtag_cache_errors_ref;
SOFIAPUBVAR tag_typedef_t authtag_cache_errors_ref;
SOFIA_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment