Loading...
Searching...
No Matches
auth_digest.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef AUTH_DIGEST_H
#define AUTH_DIGEST_H
#ifndef SU_ALLOC_H
#include <sofia-sip/su_alloc.h>
#endif
SOFIA_BEGIN_DECLS
typedef struct {
int ac_size;
char const *ac_realm;
char const *ac_domain;
char const *ac_nonce;
char const *ac_opaque;
char const *ac_algorithm;
char const *ac_qop;
unsigned ac_stale : 1;
unsigned ac_md5 : 1;
unsigned ac_md5sess : 1;
unsigned ac_sha1 : 1;
unsigned ac_auth : 1;
unsigned ac_auth_int : 1;
unsigned : 0;
} auth_challenge_t;
typedef struct {
int ar_size;
char const *ar_username;
char const *ar_realm;
char const *ar_nonce;
char const *ar_uri;
char const *ar_response;
char const *ar_algorithm;
char const *ar_cnonce;
char const *ar_opaque;
char const *ar_qop;
char const *ar_nc;
unsigned ar_md5 : 1;
unsigned ar_md5sess : 1;
unsigned ar_sha1 : 1;
unsigned ar_auth : 1;
unsigned ar_auth_int : 1;
unsigned : 0;
} auth_response_t;
typedef char auth_hexmd5_t[33];
SOFIAPUBFUN issize_t auth_digest_challenge_get(su_home_t *, auth_challenge_t *,
char const * const params[]);
SOFIAPUBFUN void auth_digest_challenge_free_params(su_home_t *home,
auth_challenge_t *ac);
SOFIAPUBFUN issize_t auth_digest_response_get(su_home_t *, auth_response_t *,
char const * const params[]);
SOFIAPUBFUN int auth_digest_ha1(auth_hexmd5_t ha1,
char const *username,
char const *realm,
char const *secret);
SOFIAPUBFUN int auth_digest_a1(auth_response_t *ar,
auth_hexmd5_t ha1,
char const *secret);
SOFIAPUBFUN int auth_digest_a1sess(auth_response_t *ar,
auth_hexmd5_t ha1sess,
char const *ha1);
SOFIAPUBFUN int auth_digest_sessionkey(auth_response_t *, auth_hexmd5_t ha1,
char const *secret);
SOFIAPUBFUN int auth_digest_response(auth_response_t *, auth_hexmd5_t response,
auth_hexmd5_t const ha1,
char const *method_name,
void const *data, isize_t dlen);
SOFIAPUBFUN int auth_struct_copy(void *dst, void const *src, isize_t s_size);
SOFIAPUBFUN int auth_strcmp(char const *quoted, char const *unquoted);
SOFIA_END_DECLS
#endif
auth_digest_challenge_get
issize_t auth_digest_challenge_get(su_home_t *, auth_challenge_t *, char const *const params[])
Get digest-challenge parameters.
Definition auth_digest.c:61
auth_digest_response_get
issize_t auth_digest_response_get(su_home_t *, auth_response_t *, char const *const params[])
Get digest-response parameters.
Definition auth_digest.c:138
auth_strcmp
int auth_strcmp(char const *quoted, char const *unquoted)
Compare two strings, even if they are quoted.
Definition auth_common.c:180
auth_digest_ha1
int auth_digest_ha1(auth_hexmd5_t ha1, char const *username, char const *realm, char const *secret)
Generate the hex A1 hash for digest authentication.
Definition auth_digest.c:208
auth_digest_sessionkey
int auth_digest_sessionkey(auth_response_t *, auth_hexmd5_t ha1, char const *secret)
Generate MD5 session key for digest authentication.
Definition auth_digest.c:263
auth_digest_challenge_free_params
void auth_digest_challenge_free_params(su_home_t *home, auth_challenge_t *ac)
Free challenge parameters.
Definition auth_digest.c:111
auth_digest_a1
int auth_digest_a1(auth_response_t *ar, auth_hexmd5_t ha1, char const *secret)
Generate A1 hash for digest authentication.
Definition auth_digest.c:233
auth_digest_response
int auth_digest_response(auth_response_t *, auth_hexmd5_t response, auth_hexmd5_t const ha1, char const *method_name, void const *data, isize_t dlen)
Generate response for digest authentication.
Definition auth_digest.c:288
auth_challenge_t
Parameters for digest-challenge.
Definition auth_digest.h:75
auth_challenge_t::ac_auth_int
unsigned ac_auth_int
qop=auth-int
Definition auth_digest.h:88
auth_challenge_t::ac_md5
unsigned ac_md5
algorithm=MS5 (or missing)
Definition auth_digest.h:84
auth_challenge_t::ac_auth
unsigned ac_auth
qop=auth
Definition auth_digest.h:87
auth_challenge_t::ac_algorithm
char const * ac_algorithm
algorithm
Definition auth_digest.h:81
auth_challenge_t::ac_opaque
char const * ac_opaque
opaque
Definition auth_digest.h:80
auth_challenge_t::ac_sha1
unsigned ac_sha1
algorithm=sha1 (SSA Hash)
Definition auth_digest.h:86
auth_challenge_t::ac_stale
unsigned ac_stale
stale=true
Definition auth_digest.h:83
auth_challenge_t::ac_md5sess
unsigned ac_md5sess
algorithm=MD5-sess
Definition auth_digest.h:85
auth_challenge_t::ac_nonce
char const * ac_nonce
nonce
Definition auth_digest.h:79
auth_challenge_t::ac_domain
char const * ac_domain
domain
Definition auth_digest.h:78
auth_challenge_t::ac_realm
char const * ac_realm
realm
Definition auth_digest.h:77
auth_challenge_t::ac_qop
char const * ac_qop
qop
Definition auth_digest.h:82
auth_response_t
Digest parameters for digest-response in Authorize.
Definition auth_digest.h:117
auth_response_t::ar_uri
char const * ar_uri
uri
Definition auth_digest.h:122
auth_response_t::ar_auth
unsigned ar_auth
qop=auth
Definition auth_digest.h:132
auth_response_t::ar_algorithm
char const * ar_algorithm
algorithm
Definition auth_digest.h:124
auth_response_t::ar_nc
char const * ar_nc
nonce count
Definition auth_digest.h:128
auth_response_t::ar_md5
unsigned ar_md5
MS5 algorithm.
Definition auth_digest.h:129
auth_response_t::ar_realm
char const * ar_realm
realm
Definition auth_digest.h:120
auth_response_t::ar_auth_int
unsigned ar_auth_int
qop=auth-int
Definition auth_digest.h:133
auth_response_t::ar_qop
char const * ar_qop
qop
Definition auth_digest.h:127
auth_response_t::ar_nonce
char const * ar_nonce
nonce
Definition auth_digest.h:121
auth_response_t::ar_cnonce
char const * ar_cnonce
cnonce
Definition auth_digest.h:125
auth_response_t::ar_response
char const * ar_response
response
Definition auth_digest.h:123
auth_response_t::ar_md5sess
unsigned ar_md5sess
MD5-sess algorithm.
Definition auth_digest.h:130
auth_response_t::ar_opaque
char const * ar_opaque
opaque
Definition auth_digest.h:126
auth_response_t::ar_sha1
unsigned ar_sha1
SHA1 algorithm.
Definition auth_digest.h:131
su_alloc.h
su_home_t
SU_HOME_T su_home_t
SOFIAPUBFUN
#define SOFIAPUBFUN

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.