~ubuntu-branches/ubuntu/hardy/wpasupplicant/hardy

« back to all changes in this revision

Viewing changes to src/eap_server/eap_sim_db.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Alexander Sack
  • Date: 2007-08-26 16:06:57 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070826160657-2m8pxoweuxe8f93t
Tags: 0.6.0+0.5.8-0ubuntu1
* New upstream release
* remove patch 11_erroneous_manpage_ref, applied upstream
* remove patch 25_wpas_dbus_unregister_iface_fix, applied upstream

[ Alexander Sack ]
* bumping upstream version to replace development version 0.6.0 with
  this package from stable release branch.
* attempt to fix wierd timeout and high latency issues by going
  back to stable upstream version (0.5.9) (LP: #140763,
  LP: #141233).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * hostapd / EAP-SIM database/authenticator gateway
3
 
 * Copyright (c) 2005-2007, Jouni Malinen <j@w1.fi>
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License version 2 as
7
 
 * published by the Free Software Foundation.
8
 
 *
9
 
 * Alternatively, this software may be distributed under the terms of BSD
10
 
 * license.
11
 
 *
12
 
 * See README and COPYING for more details.
13
 
 */
14
 
 
15
 
#ifndef EAP_SIM_DB_H
16
 
#define EAP_SIM_DB_H
17
 
 
18
 
#ifdef EAP_SIM
19
 
 
20
 
#include "eap_common/eap_sim_common.h"
21
 
 
22
 
/* Identity prefixes */
23
 
#define EAP_SIM_PERMANENT_PREFIX '1'
24
 
#define EAP_SIM_PSEUDONYM_PREFIX '3'
25
 
#define EAP_SIM_REAUTH_ID_PREFIX '5'
26
 
#define EAP_AKA_PERMANENT_PREFIX '0'
27
 
#define EAP_AKA_PSEUDONYM_PREFIX '2'
28
 
#define EAP_AKA_REAUTH_ID_PREFIX '4'
29
 
 
30
 
void * eap_sim_db_init(const char *config,
31
 
                       void (*get_complete_cb)(void *ctx, void *session_ctx),
32
 
                       void *ctx);
33
 
 
34
 
void eap_sim_db_deinit(void *priv);
35
 
 
36
 
int eap_sim_db_get_gsm_triplets(void *priv, const u8 *identity,
37
 
                                size_t identity_len, int max_chal,
38
 
                                u8 *_rand, u8 *kc, u8 *sres,
39
 
                                void *cb_session_ctx);
40
 
 
41
 
#define EAP_SIM_DB_FAILURE -1
42
 
#define EAP_SIM_DB_PENDING -2
43
 
 
44
 
int eap_sim_db_identity_known(void *priv, const u8 *identity,
45
 
                              size_t identity_len);
46
 
 
47
 
char * eap_sim_db_get_next_pseudonym(void *priv, int aka);
48
 
 
49
 
char * eap_sim_db_get_next_reauth_id(void *priv, int aka);
50
 
 
51
 
int eap_sim_db_add_pseudonym(void *priv, const u8 *identity,
52
 
                             size_t identity_len, char *pseudonym);
53
 
 
54
 
int eap_sim_db_add_reauth(void *priv, const u8 *identity,
55
 
                          size_t identity_len, char *reauth_id, u16 counter,
56
 
                          const u8 *mk);
57
 
 
58
 
const u8 * eap_sim_db_get_permanent(void *priv, const u8 *identity,
59
 
                                    size_t identity_len, size_t *len);
60
 
 
61
 
struct eap_sim_reauth {
62
 
        struct eap_sim_reauth *next;
63
 
        u8 *identity;
64
 
        size_t identity_len;
65
 
        char *reauth_id;
66
 
        u16 counter;
67
 
        u8 mk[EAP_SIM_MK_LEN];
68
 
};
69
 
 
70
 
struct eap_sim_reauth *
71
 
eap_sim_db_get_reauth_entry(void *priv, const u8 *identity,
72
 
                            size_t identity_len);
73
 
 
74
 
void eap_sim_db_remove_reauth(void *priv, struct eap_sim_reauth *reauth);
75
 
 
76
 
int eap_sim_db_get_aka_auth(void *priv, const u8 *identity,
77
 
                            size_t identity_len, u8 *_rand, u8 *autn, u8 *ik,
78
 
                            u8 *ck, u8 *res, size_t *res_len,
79
 
                            void *cb_session_ctx);
80
 
 
81
 
int eap_sim_db_resynchronize(void *priv, const u8 *identity,
82
 
                             size_t identity_len, const u8 *auts,
83
 
                             const u8 *_rand);
84
 
 
85
 
#else /* EAP_SIM */
86
 
static inline void *
87
 
eap_sim_db_init(const char *config,
88
 
                void (*get_complete_cb)(void *ctx, void *session_ctx),
89
 
                void *ctx)
90
 
{
91
 
        return (void *) 1;
92
 
}
93
 
 
94
 
static inline void eap_sim_db_deinit(void *priv)
95
 
{
96
 
}
97
 
#endif /* EAP_SIM */
98
 
 
99
 
#endif /* EAP_SIM_DB_H */