Authentication API’s
- group PJSIP_AUTH_API
Structures and functions to perform authentication.
Defines
-
PJSIP_MD5STRLEN
Length of digest MD5 string.
- Deprecated:
Use pjsip_auth_algorithm::digest_str_length instead.
-
PJSIP_SHA256STRLEN
Length of digest SHA256 string.
- Deprecated:
Use pjsip_auth_algorithm::digest_str_length instead.
-
PJSIP_AUTH_MAX_DIGEST_BUFFER_LENGTH
The length of the buffer needed to contain the largest supported algorithm’s digest.
-
PJSIP_CRED_DATA_PASSWD_MASK
-
PJSIP_CRED_DATA_EXT_MASK
-
PJSIP_CRED_DATA_IS_AKA(cred)
-
PJSIP_CRED_DATA_IS_PASSWD(cred)
-
PJSIP_CRED_DATA_IS_DIGEST(cred)
-
PJSIP_AUTH_SRV_IS_PROXY
Flag to specify that server is a proxy.
Typedefs
-
typedef pj_status_t (*pjsip_cred_cb)(pj_pool_t *pool, const pjsip_digest_challenge *chal, const pjsip_cred_info *cred, const pj_str_t *method, pjsip_digest_credential *auth)
Type of callback function to create authentication response. Application can specify this callback in cb field of the credential info (pjsip_cred_info) and specifying PJSIP_CRED_DATA_DIGEST_CALLBACK as data_type. When this function is called, most of the fields in the auth authentication response will have been filled by the framework. Application normally should just need to calculate the response digest of the authentication response.
- Param pool:
Pool to allocate memory from if application needs to.
- Param chal:
The authentication challenge sent by server in 401 or 401 response, in either Proxy-Authenticate or WWW-Authenticate header.
- Param cred:
The credential that has been selected by the framework to authenticate against the challenge.
- Param auth:
The authentication response which application needs to calculate the response digest.
- Return:
Application may return non-PJ_SUCCESS to abort the authentication process. When this happens, the framework will return failure to the original function that requested authentication.
-
typedef pj_status_t pjsip_auth_lookup_cred(pj_pool_t *pool, const pj_str_t *realm, const pj_str_t *acc_name, pjsip_cred_info *cred_info)
Type of function to lookup credential for the specified name.
Note
If pjsip_cred_info::data_type is set to PJSIP_CRED_DATA_DIGEST and pjsip_cred_info::algorithm_type is left unset (0), algorithm_type will default to PJSIP_AUTH_ALGORITHM_MD5.
- Param pool:
Pool to initialize the credential info.
- Param realm:
Realm to find the account.
- Param acc_name:
Account name to look for.
- Param cred_info:
The structure to put the credential when it’s found.
- Return:
The function MUST return PJ_SUCCESS when it found a correct credential for the specified account and realm. Otherwise it may return PJSIP_EAUTHACCNOTFOUND or PJSIP_EAUTHACCDISABLED.
-
typedef pj_status_t pjsip_auth_lookup_cred2(pj_pool_t *pool, const pjsip_auth_lookup_cred_param *param, pjsip_cred_info *cred_info)
Type of function to lookup credential for the specified name.
Note
If pjsip_cred_info::data_type is set to PJSIP_CRED_DATA_DIGEST and pjsip_cred_info::algorithm_type is left unset (0), algorithm_type will default to PJSIP_AUTH_ALGORITHM_MD5.
- Param pool:
Pool to initialize the credential info.
- Param param:
The input param for credential lookup.
- Param cred_info:
The structure to put the credential when it’s found.
- Return:
The function MUST return PJ_SUCCESS when it found a correct credential for the specified account and realm. Otherwise it may return PJSIP_EAUTHACCNOTFOUND or PJSIP_EAUTHACCDISABLED.
-
typedef pj_status_t pjsip_auth_clt_async_impl_send(pjsip_auth_clt_sess *sess, void *user_data, pjsip_tx_data *new_request)
-
typedef void pjsip_auth_clt_async_impl_abandon(pjsip_auth_clt_sess *sess, void *user_data)
Enums
-
enum pjsip_auth_algorithm_type
Digest Algorithm Types.
The MD5, SHA-256, and SHA-512/256 algorithms are described in RFC 7616 and RFC 8760. The AKA algorithms are described in RFC 3310 and RFC 4169 and 3GPP TS 33.203.
Warning
These entries must remain in order with no gaps and with _NOT_SET = 0 and _COUNT as the last entry.
Values:
-
enumerator PJSIP_AUTH_ALGORITHM_NOT_SET
Algorithm not set.
-
enumerator PJSIP_AUTH_ALGORITHM_MD5
MD5 algorithm.
-
enumerator PJSIP_AUTH_ALGORITHM_SHA256
SHA-256 algorithm.
-
enumerator PJSIP_AUTH_ALGORITHM_SHA512_256
SHA-512/256 algorithm
-
enumerator PJSIP_AUTH_ALGORITHM_AKAV1_MD5
AKA v1 with MD5 algorithm.
-
enumerator PJSIP_AUTH_ALGORITHM_AKAV2_MD5
AKA v2 with MD5 algorithm.
-
enumerator PJSIP_AUTH_ALGORITHM_COUNT
Number of algorithms.
-
enumerator PJSIP_AUTH_ALGORITHM_NOT_SET
-
enum pjsip_cred_data_type
Type of data in the credential information in pjsip_cred_info.
Values:
-
enumerator PJSIP_CRED_DATA_PLAIN_PASSWD
Plain text password.
-
enumerator PJSIP_CRED_DATA_DIGEST
Hashed digest.
-
enumerator PJSIP_CRED_DATA_EXT_AKA
Extended AKA info is available
-
enumerator PJSIP_CRED_DATA_PLAIN_PASSWD
-
enum pjsip_auth_qop_type
Authentication’s quality of protection (qop) type.
Values:
-
enumerator PJSIP_AUTH_QOP_NONE
No quality of protection.
-
enumerator PJSIP_AUTH_QOP_AUTH
Authentication.
-
enumerator PJSIP_AUTH_QOP_AUTH_INT
Authentication with integrity protection.
-
enumerator PJSIP_AUTH_QOP_UNKNOWN
Unknown protection.
-
enumerator PJSIP_AUTH_QOP_NONE
Functions
-
const pjsip_auth_algorithm *pjsip_auth_get_algorithm_by_type(pjsip_auth_algorithm_type algorithm_type)
Get a pjsip_auth_algorithm structure by type.
- Parameters:
algorithm_type – The algorithm type
- Returns:
A pointer to a pjsip_auth_algorithm structure or NULL if not found.
-
const pjsip_auth_algorithm *pjsip_auth_get_algorithm_by_iana_name(const pj_str_t *iana_name)
Get a pjsip_auth_algorithm by IANA name.
- Parameters:
iana_name – The IANA name (MD5, SHA-256, SHA-512-256)
- Returns:
A pointer to a pjsip_auth_algorithm structure or NULL if not found.
-
pj_bool_t pjsip_auth_is_algorithm_supported(pjsip_auth_algorithm_type algorithm_type)
Check if a digest algorithm is supported. Algorithms that require support from OpenSSL will be checked at runtime to determine if they are actually available in the current version of OpenSSL.
- Parameters:
algorithm_type – The algorithm type
- Returns:
PJ_TRUE if the algorithm is supported, PJ_FALSE otherwise.
-
void pjsip_auth_clt_pref_dup(pj_pool_t *pool, pjsip_auth_clt_pref *dst, const pjsip_auth_clt_pref *src)
Duplicate a client authentication preference setting.
- Parameters:
pool – The memory pool.
dst – Destination client authentication preference.
src – Source client authentication preference.
-
void pjsip_cred_info_dup(pj_pool_t *pool, pjsip_cred_info *dst, const pjsip_cred_info *src)
Duplicate a credential info.
- Parameters:
pool – The memory pool.
dst – Destination credential.
src – Source credential.
-
int pjsip_cred_info_cmp(const pjsip_cred_info *cred1, const pjsip_cred_info *cred2)
Compare two credential infos.
- Parameters:
cred1 – The credential info to compare.
cred2 – The credential info to compare.
- Returns:
0 if both credentials are equal.
-
pj_status_t pjsip_auth_clt_init(pjsip_auth_clt_sess *sess, pjsip_endpoint *endpt, pj_pool_t *pool, unsigned options)
Initialize client authentication session data structure, and set the session to use pool for its subsequent memory allocation. The argument options should be set to zero for this PJSIP version.
- Parameters:
sess – The client authentication session.
endpt – Endpoint where this session belongs.
pool – Pool to use.
options – Must be zero.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_deinit(pjsip_auth_clt_sess *sess)
Deinitialize client authentication session data structure.
- Parameters:
sess – The client authentication session.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_clone(pj_pool_t *pool, pjsip_auth_clt_sess *sess, const pjsip_auth_clt_sess *rhs)
Clone client initialization session.
- Parameters:
pool – Pool to use.
sess – Structure to put the duplicated session.
rhs – The client session to be cloned.
- Returns:
PJ_SUCCESS on success;
-
pj_status_t pjsip_auth_clt_set_credentials(pjsip_auth_clt_sess *sess, int cred_cnt, const pjsip_cred_info *c)
Set the credentials to be used during the session. This will duplicate the specified credentials using client authentication’s pool.
Note
If pjsip_cred_info::data_type is set to PJSIP_CRED_DATA_DIGEST and pjsip_cred_info::algorithm_type is left unset (0), algorithm_type will default to PJSIP_AUTH_ALGORITHM_MD5.
- Parameters:
sess – The client authentication session.
cred_cnt – Number of credentials.
c – Array of credentials.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_set_prefs(pjsip_auth_clt_sess *sess, const pjsip_auth_clt_pref *p)
Set the preference for the client authentication session.
- Parameters:
sess – The client authentication session.
p – Preference.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_get_prefs(pjsip_auth_clt_sess *sess, pjsip_auth_clt_pref *p)
Get the preference for the client authentication session.
- Parameters:
sess – The client authentication session.
p – Pointer to receive the preference.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_init_req(pjsip_auth_clt_sess *sess, pjsip_tx_data *tdata)
Initialize new request message with authorization headers. This function will put Authorization/Proxy-Authorization headers to the outgoing request message. If caching is enabled (PJSIP_AUTH_HEADER_CACHING) and the session has previously sent Authorization/Proxy-Authorization header with the same method, then the same Authorization/Proxy-Authorization header will be resent from the cache only if qop is not present. If the stack is configured to automatically generate next Authorization/Proxy-Authorization headers (PJSIP_AUTH_AUTO_SEND_NEXT flag), then new Authorization/Proxy- Authorization headers are calculated and generated when they are not present in the case or if authorization session has qop.
If both PJSIP_AUTH_HEADER_CACHING flag and PJSIP_AUTH_AUTO_SEND_NEXT flag are not set, this function will do nothing. The stack then will only send Authorization/Proxy-Authorization to respond 401/407 response.
- Parameters:
sess – The client authentication session.
tdata – The request message to be initialized.
- Returns:
PJ_SUCCESS if successfull.
-
pj_status_t pjsip_auth_clt_reinit_req(pjsip_auth_clt_sess *sess, const pjsip_rx_data *rdata, pjsip_tx_data *old_request, pjsip_tx_data **new_request)
Call this function when a transaction failed with 401 or 407 response. This function will reinitialize the original request message with the authentication challenge found in the response message, and add the new authorization header in the authorization cache.
Note that upon return the reference counter of the new transmit data will be set to 1.
- Parameters:
sess – The client authentication session.
rdata – The response message containing 401/407 status.
old_request – The original request message, which will be re- created with authorization info.
new_request – Pointer to receive new request message which will contain all required authorization headers.
- Returns:
PJ_SUCCESS if new request can be successfully created to respond all the authentication challenges.
-
pj_status_t pjsip_auth_srv_init(pj_pool_t *pool, pjsip_auth_srv *auth_srv, const pj_str_t *realm, pjsip_auth_lookup_cred *lookup, unsigned options)
Initialize server authorization session data structure to serve the specified realm and to use lookup_func function to look for the credential info.
- Parameters:
pool – Pool used to initialize the authentication server.
auth_srv – The authentication server structure.
realm – Realm to be served by the server.
lookup – Account lookup function.
options – Options, bitmask of:
PJSIP_AUTH_SRV_IS_PROXY: to specify that the server will authorize clients as a proxy server (instead of as UAS), which means that Proxy-Authenticate will be used instead of WWW-Authenticate.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_set_parent(pjsip_auth_clt_sess *sess, pjsip_auth_clt_sess *p)
Set a parent session to be used instead of the current. This allows a central caching of authorization headers over multiple dialogs.
- Parameters:
sess – Session that will be delegating the requests.
p – Parent that will be shared.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_srv_init2(pj_pool_t *pool, pjsip_auth_srv *auth_srv, const pjsip_auth_srv_init_param *param)
Initialize server authorization session data structure to serve the specified realm and to use lookup_func function to look for the credential info.
- Parameters:
pool – Pool used to initialize the authentication server.
auth_srv – The authentication server structure.
param – The initialization param.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_srv_verify(pjsip_auth_srv *auth_srv, pjsip_rx_data *rdata, int *status_code)
Request the authorization server framework to verify the authorization information in the specified request in rdata.
- Parameters:
auth_srv – The server authentication structure.
rdata – Incoming request to be authenticated.
status_code – When not null, it will be filled with suitable status code to be sent to the client.
- Returns:
PJ_SUCCESS if request is successfully authenticated. Otherwise the function may return one of the following error codes:
PJSIP_EAUTHNOAUTH
PJSIP_EINVALIDAUTHSCHEME
PJSIP_EAUTHACCNOTFOUND
PJSIP_EAUTHACCDISABLED
PJSIP_EAUTHINVALIDREALM
PJSIP_EAUTHINVALIDDIGEST
-
pj_status_t pjsip_auth_srv_challenge(pjsip_auth_srv *auth_srv, const pj_str_t *qop, const pj_str_t *nonce, const pj_str_t *opaque, pj_bool_t stale, pjsip_tx_data *tdata)
Add authentication challenge headers to the outgoing response in tdata. Application may specify its customized nonce and opaque for the challenge, or can leave the value to NULL to make the function fills them in with random characters. The digest algorithm defaults to MD5. If you need to specify a different algorithm, use pjsip_auth_srv_challenge2.
- Parameters:
auth_srv – The server authentication structure.
qop – Optional qop value.
nonce – Optional nonce value.
opaque – Optional opaque value.
stale – Stale indication.
tdata – The outgoing response message. The response must have 401 or 407 response code.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_srv_challenge2(pjsip_auth_srv *auth_srv, const pj_str_t *qop, const pj_str_t *nonce, const pj_str_t *opaque, pj_bool_t stale, pjsip_tx_data *tdata, const pjsip_auth_algorithm_type algorithm_type)
Add authentication challenge headers to the outgoing response in tdata. Application may specify its customized nonce and opaque for the challenge, or can leave the value to NULL to make the function fills them in with random characters. Application must specify the algorithm to use.
- Parameters:
auth_srv – The server authentication structure.
qop – Optional qop value.
nonce – Optional nonce value.
opaque – Optional opaque value.
stale – Stale indication.
tdata – The outgoing response message. The response must have 401 or 407 response code.
algorithm_type – One of the pjsip_auth_algorithm_type values.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_create_digest(pj_str_t *result, const pj_str_t *nonce, const pj_str_t *nc, const pj_str_t *cnonce, const pj_str_t *qop, const pj_str_t *uri, const pj_str_t *realm, const pjsip_cred_info *cred_info, const pj_str_t *method)
Helper function to create a digest out of the specified parameters.
- Deprecated:
Use pjsip_auth_create_digest2 with algorithm_type = PJSIP_AUTH_ALGORITHM_MD5.
pjsip_cred_info::data_type must be PJSIP_CRED_DATA_PLAIN_PASSWD or PJSIP_CRED_DATA_DIGEST.
Warning
Because of ambiguities in the API, this function should only be used for backward compatibility with the MD5 digest algorithm. New code should use pjsip_auth_create_digest2
Note
If pjsip_cred_info::data_type is set to PJSIP_CRED_DATA_DIGEST and pjsip_cred_info::algorithm_type is left unset (0), algorithm_type will default to PJSIP_AUTH_ALGORITHM_MD5.
- Parameters:
result – String to store the response digest. This string must have been preallocated by caller with the buffer at least PJSIP_MD5STRLEN (32 bytes) in size.
nonce – Optional nonce.
nc – Nonce count.
cnonce – Optional cnonce.
qop – Optional qop.
uri – URI.
realm – Realm.
cred_info – Credential info.
method – SIP method.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_create_digestSHA256(pj_str_t *result, const pj_str_t *nonce, const pj_str_t *nc, const pj_str_t *cnonce, const pj_str_t *qop, const pj_str_t *uri, const pj_str_t *realm, const pjsip_cred_info *cred_info, const pj_str_t *method)
Helper function to create SHA-256 digest out of the specified parameters.
- Deprecated:
Use pjsip_auth_create_digest2 with algorithm_type = PJSIP_AUTH_ALGORITHM_SHA256.
pjsip_cred_info::data_type must be PJSIP_CRED_DATA_PLAIN_PASSWD or PJSIP_CRED_DATA_DIGEST.
Warning
Because of ambiguities in the API, this function should only be used for backward compatibility with the SHA256 digest algorithm. New code should use pjsip_auth_create_digest2
Note
If pjsip_cred_info::data_type is set to PJSIP_CRED_DATA_DIGEST and pjsip_cred_info::algorithm_type is left unset (0), algorithm_type will default to PJSIP_AUTH_ALGORITHM_SHA256.
- Parameters:
result – String to store the response digest. This string must have been preallocated by caller with the buffer at least PJSIP_SHA256STRLEN (64 bytes) in size.
nonce – Optional nonce.
nc – Nonce count.
cnonce – Optional cnonce.
qop – Optional qop.
uri – URI.
realm – Realm.
cred_info – Credential info.
method – SIP method.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_create_digest2(pj_str_t *result, const pj_str_t *nonce, const pj_str_t *nc, const pj_str_t *cnonce, const pj_str_t *qop, const pj_str_t *uri, const pj_str_t *realm, const pjsip_cred_info *cred_info, const pj_str_t *method, const pjsip_auth_algorithm_type algorithm_type)
Helper function to create a digest out of the specified parameters.
pjsip_cred_info::data_type must be PJSIP_CRED_DATA_PLAIN_PASSWD or PJSIP_CRED_DATA_DIGEST.
If pjsip_cred_info::data_type is #PJSIP_CRED_DATA_PLAIN_PASSWORD, pjsip_cred_info::username + “:” + realm + “:” + pjsip_cred_info::data will be hashed using the algorithm_type specified by the last parameter passed to this function to create the “ha1” hash.
If pjsip_cred_info::data_type is PJSIP_CRED_DATA_DIGEST, pjsip_cred_info::data must contain the value of username + “:” + realm + “:” + password pre-hashed with the algorithm specifed by pjsip_cred_info::algorithm_type and will be used as the “ha1” hash directly. In this case pjsip_cred_info::algorithm_type MUST match the algorithm_type passed as the last parameter to this function.
- Parameters:
result – String to store the response digest. This string must have been preallocated by the caller with the buffer at least as large as the digest_str_length member of the appropriate pjsip_auth_algorithm.
nonce – Optional nonce.
nc – Nonce count.
cnonce – Optional cnonce.
qop – Optional qop.
uri – URI.
realm – Realm.
cred_info – Credential info.
method – SIP method.
algorithm_type – The hash algorithm to use.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjsip_auth_clt_async_impl_on_challenge(pjsip_auth_clt_sess *sess, pjsip_auth_clt_async_impl_token *token, const pjsip_auth_clt_async_on_chal_param *param)
-
struct pjsip_auth_algorithm
- #include <sip_auth.h>
Authentication Digest Algorithm
This structure describes a digest algorithm used in SIP authentication.
Public Members
-
pjsip_auth_algorithm_type algorithm_type
Digest algorithm type
-
const char *openssl_name
The name used by OpenSSL’s EVP_get_digestbyname()
-
unsigned digest_length
Length of the raw digest in bytes
-
unsigned digest_str_length
Length of the digest HEX representation
-
pjsip_auth_algorithm_type algorithm_type
-
struct pjsip_cred_info
- #include <sip_auth.h>
This structure describes credential information. A credential information is a static, persistent information that identifies credentials required to authorize to a specific realm.
Note that since PJSIP 0.7.0.1, it is possible to make a credential that is valid for any realms, by setting the realm to star/wildcard character, i.e. realm = pj_str(“*”);.
You should always fill this structure with zeros using PJ_POOL_ZALLOC_T() or pj_bzero() before setting any fields.
Forward declaration for credential.
Public Members
-
pj_str_t realm
Realm. Use “*” to make a credential that can be used to authenticate against any challenges.
-
int data_type
Type of data pjsip_cred_data_type
-
pjsip_auth_algorithm_type algorithm_type
If the data_type is PJSIP_CRED_DATA_DIGEST and the digest algorithm used is not MD5 (the default), then this field MUST be set to the appropriate digest algorithm type. Digest algorithm type
-
pjsip_cred_cb cb
Callback to create AKA digest.
-
struct pjsip_cred_info::[anonymous]::[anonymous] aka
Digest AKA credential information. Note that when AKA credential is being used, the data field of this pjsip_cred_info is not used, but it still must be initialized to an empty string. Please see Digest AKAv1 and AKAv2 Authentication API for more information.
-
union pjsip_cred_info::[anonymous] ext
Extended data
-
pj_str_t realm
-
struct pjsip_cached_auth_hdr
- #include <sip_auth.h>
This structure describes cached value of previously sent Authorization or Proxy-Authorization header. The authentication framework keeps a list of this structure and will resend the same header to the same server as long as the method, uri, and nonce stays the same.
Public Functions
-
PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth_hdr)
Standard list member
Public Members
-
pjsip_method method
To quickly see the method.
-
pjsip_authorization_hdr *hdr
The cached header.
-
PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth_hdr)
-
struct pjsip_cached_auth
- #include <sip_auth.h>
This structure describes authentication information for the specified realm. Each instance of this structure describes authentication “session” between this endpoint and remote server. This “session” information is usefull to keep information that persists for more than one challenge, such as nonce-count and cnonce value.
Other than that, this structure also keeps the last authorization headers that have been sent in the cache list.
Public Functions
-
PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth)
Standard list member
Public Members
-
pjsip_auth_qop_type qop_value
qop required by server.
-
unsigned stale_cnt
Number of stale retry.
-
pjsip_www_authenticate_hdr *last_chal
Last challenge seen.
-
pjsip_auth_algorithm_type challenge_algorithm_type
Challenge algorithm
-
PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth)
-
struct pjsip_auth_clt_pref
- #include <sip_auth.h>
This structure describes client authentication session preference. The preference can be set by calling pjsip_auth_clt_set_prefs().
-
struct pjsip_auth_clt_sess
- #include <sip_auth.h>
This structure describes client authentication sessions. It keeps all the information needed to authorize the client against all downstream servers.
Public Members
-
pjsip_endpoint *endpt
Endpoint where this belongs.
-
pjsip_auth_clt_pref pref
Preference/options.
-
unsigned cred_cnt
Number of credentials.
-
pjsip_cred_info *cred_info
Array of credential information
-
pjsip_cached_auth cached_auth
Cached authorization info.
-
pj_lock_t *lock
Prevent concurrent usage when using a shared parent. Is only used in parent. Set up by pjsip_auth_clt_set_parent
-
struct pjsip_auth_clt_sess *parent
Allow a common parent for multiple sessions.
-
pjsip_auth_clt_async_setting *async_opt
Optional asynchronous client authentication settings for this session.
-
pjsip_endpoint *endpt
-
struct pjsip_auth_lookup_cred_param
- #include <sip_auth.h>
This structure describes input param for credential lookup.
Public Members
-
pjsip_rx_data *rdata
Incoming request to be authenticated.
-
pjsip_authorization_hdr *auth_hdr
Authorization header to be authenticated.
-
pjsip_rx_data *rdata
-
struct pjsip_auth_srv
- #include <sip_auth.h>
This structure describes server authentication information.
Public Members
-
pjsip_auth_lookup_cred *lookup
Lookup function.
-
pjsip_auth_lookup_cred2 *lookup2
Lookup function with additional info in its input param.
-
pjsip_auth_lookup_cred *lookup
-
struct pjsip_auth_srv_init_param
- #include <sip_auth.h>
This structure describes initialization settings of server authorization session.
Public Members
-
pjsip_auth_lookup_cred2 *lookup2
Account lookup function.
-
unsigned options
Options, bitmask of:
PJSIP_AUTH_SRV_IS_PROXY: to specify that the server will authorize clients as a proxy server (instead of as UAS), which means that Proxy-Authenticate will be used instead of WWW-Authenticate.
-
pjsip_auth_lookup_cred2 *lookup2
-
struct pjsip_auth_clt_async_impl_token
Public Members
-
void *user_data
User data to be passed to the send_impl/abandon_impl callbacks.
-
pjsip_auth_clt_async_impl_send *send_impl
Callback for sending the new request with authentication response.
-
pjsip_auth_clt_async_impl_abandon *abandon_impl
Optional callback invoked when the application abandons the pending challenge. May be NULL (treated as a no-op).
-
pj_grp_lock_t *grp_lock
Optional group lock whose reference count is decremented after the token is consumed (via send_req or abandon). This keeps the memory backing the token alive until consumption. May be NULL (no-op).
-
pj_uint8_t signature[4]
Signature for verifying the integrity of the token.
-
void *user_data
-
PJSIP_MD5STRLEN