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

« back to all changes in this revision

Viewing changes to src/eap_common/eap_sake_common.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
 * EAP server/peer: EAP-SAKE shared routines
 
3
 * Copyright (c) 2006-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_SAKE_COMMON_H
 
16
#define EAP_SAKE_COMMON_H
 
17
 
 
18
#define EAP_SAKE_VERSION 2
 
19
 
 
20
#define EAP_SAKE_SUBTYPE_CHALLENGE 1
 
21
#define EAP_SAKE_SUBTYPE_CONFIRM 2
 
22
#define EAP_SAKE_SUBTYPE_AUTH_REJECT 3
 
23
#define EAP_SAKE_SUBTYPE_IDENTITY 4
 
24
 
 
25
#define EAP_SAKE_AT_RAND_S 1
 
26
#define EAP_SAKE_AT_RAND_P 2
 
27
#define EAP_SAKE_AT_MIC_S 3
 
28
#define EAP_SAKE_AT_MIC_P 4
 
29
#define EAP_SAKE_AT_SERVERID 5
 
30
#define EAP_SAKE_AT_PEERID 6
 
31
#define EAP_SAKE_AT_SPI_S 7
 
32
#define EAP_SAKE_AT_SPI_P 8
 
33
#define EAP_SAKE_AT_ANY_ID_REQ 9
 
34
#define EAP_SAKE_AT_PERM_ID_REQ 10
 
35
#define EAP_SAKE_AT_ENCR_DATA 128
 
36
#define EAP_SAKE_AT_IV 129
 
37
#define EAP_SAKE_AT_PADDING 130
 
38
#define EAP_SAKE_AT_NEXT_TMPID 131
 
39
#define EAP_SAKE_AT_MSK_LIFE 132
 
40
 
 
41
#define EAP_SAKE_RAND_LEN 16
 
42
#define EAP_SAKE_MIC_LEN 16
 
43
#define EAP_SAKE_ROOT_SECRET_LEN 16
 
44
#define EAP_SAKE_SMS_LEN 16
 
45
#define EAP_SAKE_TEK_AUTH_LEN 16
 
46
#define EAP_SAKE_TEK_CIPHER_LEN 16
 
47
#define EAP_SAKE_TEK_LEN (EAP_SAKE_TEK_AUTH_LEN + EAP_SAKE_TEK_CIPHER_LEN)
 
48
 
 
49
#ifdef _MSC_VER
 
50
#pragma pack(push, 1)
 
51
#endif /* _MSC_VER */
 
52
 
 
53
struct eap_sake_hdr {
 
54
        u8 version; /* EAP_SAKE_VERSION */
 
55
        u8 session_id;
 
56
        u8 subtype;
 
57
} STRUCT_PACKED;
 
58
 
 
59
#ifdef _MSC_VER
 
60
#pragma pack(pop)
 
61
#endif /* _MSC_VER */
 
62
 
 
63
 
 
64
struct eap_sake_parse_attr {
 
65
        const u8 *rand_s;
 
66
        const u8 *rand_p;
 
67
        const u8 *mic_s;
 
68
        const u8 *mic_p;
 
69
        const u8 *serverid;
 
70
        size_t serverid_len;
 
71
        const u8 *peerid;
 
72
        size_t peerid_len;
 
73
        const u8 *spi_s;
 
74
        size_t spi_s_len;
 
75
        const u8 *spi_p;
 
76
        size_t spi_p_len;
 
77
        const u8 *any_id_req;
 
78
        const u8 *perm_id_req;
 
79
        const u8 *encr_data;
 
80
        size_t encr_data_len;
 
81
        const u8 *iv;
 
82
        size_t iv_len;
 
83
        const u8 *next_tmpid;
 
84
        size_t next_tmpid_len;
 
85
        const u8 *msk_life;
 
86
};
 
87
 
 
88
int eap_sake_parse_attributes(const u8 *buf, size_t len,
 
89
                              struct eap_sake_parse_attr *attr);
 
90
void eap_sake_derive_keys(const u8 *root_secret_a, const u8 *root_secret_b,
 
91
                          const u8 *rand_s, const u8 *rand_p,
 
92
                          u8 *tek, u8 *msk, u8 *emsk);
 
93
int eap_sake_compute_mic(const u8 *tek_auth,
 
94
                         const u8 *rand_s, const u8 *rand_p,
 
95
                         const u8 *serverid, size_t serverid_len,
 
96
                         const u8 *peerid, size_t peerid_len,
 
97
                         int peer, const u8 *eap, size_t eap_len,
 
98
                         const u8 *mic_pos, u8 *mic);
 
99
void eap_sake_add_attr(struct wpabuf *buf, u8 type, const u8 *data,
 
100
                       size_t len);
 
101
 
 
102
#endif /* EAP_SAKE_COMMON_H */