~ubuntu-branches/ubuntu/vivid/wpasupplicant/vivid

« back to all changes in this revision

Viewing changes to src/rsn_supp/pmksa_cache.h

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2008-03-12 20:03:04 UTC
  • mfrom: (1.1.10 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080312200304-4331y9wj46pdd34z
Tags: 0.6.3-1
* New upstream release.
* Drop patches applied upstream:
  - debian/patches/30_wpa_gui_qt4_eventhistoryui_rework.patch
  - debian/patches/31_wpa_gui_qt4_eventhistory_always_scrollbar.patch
  - debian/patches/32_wpa_gui_qt4_eventhistory_scroll_with_events.patch
  - debian/patches/40_dbus_ssid_data.patch
* Tidy up the clean target of debian/rules. Now that the madwifi headers are
  handled differently we no longer need to do any cleanup.
* Fix formatting error in debian/ifupdown/wpa_action.8 to make lintian
  quieter.
* Add patch to fix formatting errors in manpages build from sgml source. Use
  <emphasis> tags to hightlight keywords instead of surrounding them in
  strong quotes.
  - debian/patches/41_manpage_format_fixes.patch
* wpasupplicant binary package no longer suggests pcscd, guessnet, iproute
  or wireless-tools, nor does it recommend dhcp3-client. These are not
  needed.
* Add debian/patches/10_silence_siocsiwauth_icotl_failure.patch to disable
  ioctl failure messages that occur under normal conditions.
* Cherry pick two upstream git commits concerning the dbus interface:
  - debian/patches/11_avoid_dbus_version_namespace.patch
  - debian/patches/12_fix_potential_use_after_free.patch
* Add debian/patches/42_manpage_explain_available_drivers.patch to explain
  that not all of the driver backends are available in the provided
  wpa_supplicant binary, and that the canonical list of supported driver
  backends can be retrieved from the wpa_supplicant -h (help) output.
  (Closes: #466910)
* Add debian/patches/20_wpa_gui_qt4_disable_link_prl.patch to remove
  link_prl CONFIG compile flag added by qmake-qt4 >= 4.3.4-2 to avoid excess
  linking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * wpa_supplicant - WPA2/RSN PMKSA cache functions
 
3
 * Copyright (c) 2003-2006, 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 PMKSA_CACHE_H
 
16
#define PMKSA_CACHE_H
 
17
 
 
18
/**
 
19
 * struct rsn_pmksa_cache_entry - PMKSA cache entry
 
20
 */
 
21
struct rsn_pmksa_cache_entry {
 
22
        struct rsn_pmksa_cache_entry *next;
 
23
        u8 pmkid[PMKID_LEN];
 
24
        u8 pmk[PMK_LEN];
 
25
        size_t pmk_len;
 
26
        os_time_t expiration;
 
27
        int akmp; /* WPA_KEY_MGMT_* */
 
28
        u8 aa[ETH_ALEN];
 
29
 
 
30
        os_time_t reauth_time;
 
31
 
 
32
        /**
 
33
         * network_ctx - Network configuration context
 
34
         *
 
35
         * This field is only used to match PMKSA cache entries to a specific
 
36
         * network configuration (e.g., a specific SSID and security policy).
 
37
         * This can be a pointer to the configuration entry, but PMKSA caching
 
38
         * code does not dereference the value and this could be any kind of
 
39
         * identifier.
 
40
         */
 
41
        void *network_ctx;
 
42
        int opportunistic;
 
43
};
 
44
 
 
45
struct rsn_pmksa_cache;
 
46
 
 
47
#if defined(IEEE8021X_EAPOL) && !defined(CONFIG_NO_WPA2)
 
48
 
 
49
struct rsn_pmksa_cache *
 
50
pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
 
51
                                 void *ctx, int replace),
 
52
                 void *ctx, struct wpa_sm *sm);
 
53
void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa);
 
54
struct rsn_pmksa_cache_entry * pmksa_cache_get(struct rsn_pmksa_cache *pmksa,
 
55
                                               const u8 *aa, const u8 *pmkid);
 
56
int pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
 
57
struct rsn_pmksa_cache_entry *
 
58
pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
 
59
                const u8 *aa, const u8 *spa, void *network_ctx);
 
60
void pmksa_cache_notify_reconfig(struct rsn_pmksa_cache *pmksa);
 
61
struct rsn_pmksa_cache_entry * pmksa_cache_get_current(struct wpa_sm *sm);
 
62
void pmksa_cache_clear_current(struct wpa_sm *sm);
 
63
int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
 
64
                            const u8 *bssid, void *network_ctx,
 
65
                            int try_opportunistic);
 
66
struct rsn_pmksa_cache_entry *
 
67
pmksa_cache_get_opportunistic(struct rsn_pmksa_cache *pmksa,
 
68
                              void *network_ctx, const u8 *aa);
 
69
 
 
70
#else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
 
71
 
 
72
static inline struct rsn_pmksa_cache *
 
73
pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
 
74
                                 void *ctx, int replace),
 
75
                 void *ctx, struct wpa_sm *sm)
 
76
{
 
77
        return (void *) -1;
 
78
}
 
79
 
 
80
static inline void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa)
 
81
{
 
82
}
 
83
 
 
84
static inline struct rsn_pmksa_cache_entry *
 
85
pmksa_cache_get(struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid)
 
86
{
 
87
        return NULL;
 
88
}
 
89
 
 
90
static inline struct rsn_pmksa_cache_entry *
 
91
pmksa_cache_get_current(struct wpa_sm *sm)
 
92
{
 
93
        return NULL;
 
94
}
 
95
 
 
96
static inline int pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len)
 
97
{
 
98
        return -1;
 
99
}
 
100
 
 
101
static inline struct rsn_pmksa_cache_entry *
 
102
pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
 
103
                const u8 *aa, const u8 *spa, void *network_ctx)
 
104
{
 
105
        return NULL;
 
106
}
 
107
 
 
108
static inline void pmksa_cache_notify_reconfig(struct rsn_pmksa_cache *pmksa)
 
109
{
 
110
}
 
111
 
 
112
static inline void pmksa_cache_clear_current(struct wpa_sm *sm)
 
113
{
 
114
}
 
115
 
 
116
static inline int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
 
117
                                          const u8 *bssid,
 
118
                                          void *network_ctx,
 
119
                                          int try_opportunistic)
 
120
{
 
121
        return -1;
 
122
}
 
123
 
 
124
#endif /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
 
125
 
 
126
#endif /* PMKSA_CACHE_H */