~ubuntu-branches/ubuntu/utopic/moonshot-gss-eap/utopic-backports

« back to all changes in this revision

Viewing changes to libeap/src/eap_common/eap_gpsk_common.h

  • Committer: Package Import Robot
  • Author(s): Sam Hartman
  • Date: 2014-09-16 08:38:39 UTC
  • Revision ID: package-import@ubuntu.com-20140916083839-ipqco3thb1wcwvs0
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

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-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_GPSK_COMMON_H
 
16
#define EAP_GPSK_COMMON_H
 
17
 
 
18
#ifdef __cplusplus
 
19
extern "C" {
 
20
#endif
 
21
 
 
22
#define EAP_GPSK_OPCODE_GPSK_1 1
 
23
#define EAP_GPSK_OPCODE_GPSK_2 2
 
24
#define EAP_GPSK_OPCODE_GPSK_3 3
 
25
#define EAP_GPSK_OPCODE_GPSK_4 4
 
26
#define EAP_GPSK_OPCODE_FAIL 5
 
27
#define EAP_GPSK_OPCODE_PROTECTED_FAIL 6
 
28
 
 
29
/* Failure-Code in GPSK-Fail and GPSK-Protected-Fail */
 
30
#define EAP_GPSK_FAIL_PSK_NOT_FOUND 0x00000001
 
31
#define EAP_GPSK_FAIL_AUTHENTICATION_FAILURE 0x00000002
 
32
#define EAP_GPSK_FAIL_AUTHORIZATION_FAILURE 0x00000003
 
33
 
 
34
#define EAP_GPSK_RAND_LEN 32
 
35
#define EAP_GPSK_MAX_SK_LEN 32
 
36
#define EAP_GPSK_MAX_PK_LEN 32
 
37
#define EAP_GPSK_MAX_MIC_LEN 32
 
38
 
 
39
#define EAP_GPSK_VENDOR_IETF            0x00000000
 
40
#define EAP_GPSK_CIPHER_RESERVED        0x000000
 
41
#define EAP_GPSK_CIPHER_AES             0x000001
 
42
#define EAP_GPSK_CIPHER_SHA256          0x000002
 
43
 
 
44
 
 
45
#ifdef _MSC_VER
 
46
#pragma pack(push, 1)
 
47
#endif /* _MSC_VER */
 
48
 
 
49
struct eap_gpsk_csuite {
 
50
        u8 vendor[4];
 
51
        u8 specifier[2];
 
52
} STRUCT_PACKED;
 
53
 
 
54
#ifdef _MSC_VER
 
55
#pragma pack(pop)
 
56
#endif /* _MSC_VER */
 
57
 
 
58
int eap_gpsk_supported_ciphersuite(int vendor, int specifier);
 
59
int eap_gpsk_derive_keys(const u8 *psk, size_t psk_len, int vendor,
 
60
                         int specifier,
 
61
                         const u8 *rand_client, const u8 *rand_server,
 
62
                         const u8 *id_client, size_t id_client_len,
 
63
                         const u8 *id_server, size_t id_server_len,
 
64
                         u8 *msk, u8 *emsk, u8 *sk, size_t *sk_len,
 
65
                         u8 *pk, size_t *pk_len);
 
66
size_t eap_gpsk_mic_len(int vendor, int specifier);
 
67
int eap_gpsk_compute_mic(const u8 *sk, size_t sk_len, int vendor,
 
68
                         int specifier, const u8 *data, size_t len, u8 *mic);
 
69
 
 
70
#ifdef __cplusplus
 
71
}
 
72
#endif
 
73
 
 
74
#endif /* EAP_GPSK_COMMON_H */