iptsec  1.12.11devel
 All Data Structures Files Functions Variables Typedefs Enumerator Macros Groups Pages
auth_digest.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef AUTH_DIGEST_H
26 
27 #define AUTH_DIGEST_H
28 
46 #ifndef SU_ALLOC_H
47 #include <sofia-sip/su_alloc.h>
48 #endif
49 
50 SOFIA_BEGIN_DECLS
51 
75 typedef struct {
76  int ac_size;
77  char const *ac_realm;
78  char const *ac_domain;
79  char const *ac_nonce;
80  char const *ac_opaque;
81  char const *ac_algorithm;
82  char const *ac_qop;
83  unsigned ac_stale : 1;
84  unsigned ac_md5 : 1;
85  unsigned ac_md5sess : 1;
86  unsigned ac_sha1 : 1;
87  unsigned ac_auth : 1;
88  unsigned ac_auth_int : 1;
89  unsigned : 0;
91 
117 typedef struct {
118  int ar_size;
119  char const *ar_username;
120  char const *ar_realm;
121  char const *ar_nonce;
122  char const *ar_uri;
123  char const *ar_response;
124  char const *ar_algorithm;
125  char const *ar_cnonce;
126  char const *ar_opaque;
127  char const *ar_qop;
128  char const *ar_nc;
129  unsigned ar_md5 : 1;
130  unsigned ar_md5sess : 1;
131  unsigned ar_sha1 : 1;
132  unsigned ar_auth : 1;
133  unsigned ar_auth_int : 1;
134  unsigned : 0;
136 
137 typedef char auth_hexmd5_t[33];
138 
140  char const * const params[]);
142  auth_challenge_t *ac);
144  char const * const params[]);
145 
146 SOFIAPUBFUN int auth_digest_ha1(auth_hexmd5_t ha1,
147  char const *username,
148  char const *realm,
149  char const *secret);
150 
152  auth_hexmd5_t ha1,
153  char const *secret);
154 
155 SOFIAPUBFUN int auth_digest_a1sess(auth_response_t *ar,
156  auth_hexmd5_t ha1sess,
157  char const *ha1);
158 
159 SOFIAPUBFUN int auth_digest_sessionkey(auth_response_t *, auth_hexmd5_t ha1,
160  char const *secret);
161 
162 SOFIAPUBFUN int auth_digest_response(auth_response_t *, auth_hexmd5_t response,
163  auth_hexmd5_t const ha1,
164  char const *method_name,
165  void const *data, isize_t dlen);
166 
167 SOFIAPUBFUN int auth_struct_copy(void *dst, void const *src, isize_t s_size);
168 
169 SOFIAPUBFUN int auth_strcmp(char const *quoted, char const *unquoted);
170 
171 SOFIA_END_DECLS
172 
173 #endif

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