~ubuntu-branches/ubuntu/precise/wpasupplicant/precise-security

« back to all changes in this revision

Viewing changes to eap_gpsk_common.h

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.2.1 upstream) (2.1.14 edgy)
  • Revision ID: james.westby@ubuntu.com-20061005080401-myfwjtq7di70dyeo
* Update madwifi headers to latest SVN. (Closes: #388316)
* Remove failed attempt at action locking. [debian/functions.sh,
  debian/wpa_action.sh]
* Add hysteresis checking functions, to avoid "event loops" while
  using wpa-roam. [debian/functions.sh, debian/wpa_action.sh]
* Change of co-maintainer email address.
* Add ishex() function to functions.sh to determine wpa-psk value type in
  plaintext or hex. This effectively eliminates the need for the bogus and
  somewhat confusing wpa-passphrase contruct specific to our scripts and
  allows wpa-psk to work with either a 8 to 63 character long plaintext
  string or 64 character long hex string.
* Adjust README.modes to not refer to the redundant wpa-passphrase stuff.
* Add big fat NOTE about acceptable wpa-psk's to top of example gallery.
* Strip surrounding quotes from wpa-ssid if present, instead of just whining
  about them.
* Update email address in copyright blurb of functions.sh, ifupdown.sh and
  wpa_action.sh.  

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * EAP server/peer: EAP-GPSK shared routines
 
3
 * Copyright (c) 2006, Jouni Malinen <jkmaline@cc.hut.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_GPSK_COMMON_H
 
16
#define EAP_GPSK_COMMON_H
 
17
 
 
18
#define EAP_GPSK_OPCODE_GPSK_1 1
 
19
#define EAP_GPSK_OPCODE_GPSK_2 2
 
20
#define EAP_GPSK_OPCODE_GPSK_3 3
 
21
#define EAP_GPSK_OPCODE_GPSK_4 4
 
22
 
 
23
#define EAP_GPSK_RAND_LEN 32
 
24
#define EAP_GPSK_MAX_SK_LEN 32
 
25
#define EAP_GPSK_MAX_PK_LEN 32
 
26
#define EAP_GPSK_MAX_MIC_LEN 32
 
27
 
 
28
#define EAP_GPSK_VENDOR_IETF            0x000000
 
29
#define EAP_GPSK_CIPHER_RESERVED        0x000000
 
30
#define EAP_GPSK_CIPHER_AES             0x000001
 
31
#define EAP_GPSK_CIPHER_SHA256          0x000002
 
32
 
 
33
 
 
34
#ifdef _MSC_VER
 
35
#pragma pack(push, 1)
 
36
#endif /* _MSC_VER */
 
37
 
 
38
struct eap_gpsk_csuite {
 
39
        u8 vendor[3];
 
40
        u8 specifier[3];
 
41
} STRUCT_PACKED;
 
42
 
 
43
#ifdef _MSC_VER
 
44
#pragma pack(pop)
 
45
#endif /* _MSC_VER */
 
46
 
 
47
int eap_gpsk_supported_ciphersuite(int vendor, int specifier);
 
48
int eap_gpsk_derive_keys(const u8 *psk, size_t psk_len, int vendor,
 
49
                         int specifier,
 
50
                         const u8 *rand_client, const u8 *rand_server,
 
51
                         const u8 *id_client, size_t id_client_len,
 
52
                         const u8 *id_server, size_t id_server_len,
 
53
                         u8 *msk, u8 *sk, size_t *sk_len,
 
54
                         u8 *pk, size_t *pk_len);
 
55
size_t eap_gpsk_mic_len(int vendor, int specifier);
 
56
int eap_gpsk_compute_mic(const u8 *sk, size_t sk_len, int vendor,
 
57
                         int specifier, const u8 *data, size_t len, u8 *mic);
 
58
 
 
59
#endif /* EAP_GPSK_COMMON_H */