eap_gpsk_common.c File Reference

EAP server/peer: EAP-GPSK shared routines. More...

#include "includes.h"
#include "common.h"
#include "eap_defs.h"
#include "aes_wrap.h"
#include "crypto.h"
#include "eap_gpsk_common.h"
Include dependency graph for eap_gpsk_common.c:

Go to the source code of this file.

Defines

#define EAP_GPSK_SK_LEN_AES   16
#define EAP_GPSK_PK_LEN_AES   16

Functions

int eap_gpsk_supported_ciphersuite (int vendor, int specifier)
 Check whether ciphersuite is supported.
int eap_gpsk_derive_keys (const u8 *psk, size_t psk_len, int vendor, int specifier, const u8 *rand_peer, const u8 *rand_server, const u8 *id_peer, size_t id_peer_len, const u8 *id_server, size_t id_server_len, u8 *msk, u8 *emsk, u8 *sk, size_t *sk_len, u8 *pk, size_t *pk_len)
 Derive EAP-GPSK keys.
size_t eap_gpsk_mic_len (int vendor, int specifier)
 Get the length of the MIC.
int eap_gpsk_compute_mic (const u8 *sk, size_t sk_len, int vendor, int specifier, const u8 *data, size_t len, u8 *mic)
 Compute EAP-GPSK MIC for an EAP packet.

Detailed Description

EAP server/peer: EAP-GPSK shared routines.

Copyright
Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

Definition in file eap_gpsk_common.c.


Function Documentation

int eap_gpsk_compute_mic ( const u8 *  sk,
size_t  sk_len,
int  vendor,
int  specifier,
const u8 *  data,
size_t  len,
u8 *  mic 
)

Compute EAP-GPSK MIC for an EAP packet.

Parameters:
sk Session key SK from eap_gpsk_derive_keys()
sk_len SK length in bytes from eap_gpsk_derive_keys()
vendor CSuite/Vendor
specifier CSuite/Specifier
data Input data to MIC
len Input data length in bytes
mic Buffer for the computed MIC, eap_gpsk_mic_len(cipher) bytes
Returns:
0 on success, -1 on failure

Definition at line 405 of file eap_gpsk_common.c.

Here is the call graph for this function:

int eap_gpsk_derive_keys ( const u8 *  psk,
size_t  psk_len,
int  vendor,
int  specifier,
const u8 *  rand_peer,
const u8 *  rand_server,
const u8 *  id_peer,
size_t  id_peer_len,
const u8 *  id_server,
size_t  id_server_len,
u8 *  msk,
u8 *  emsk,
u8 *  sk,
size_t *  sk_len,
u8 *  pk,
size_t *  pk_len 
)

Derive EAP-GPSK keys.

Parameters:
psk Pre-shared key
psk_len Length of psk in bytes
vendor CSuite/Vendor
specifier CSuite/Specifier
rand_peer 32-byte RAND_Peer
rand_server 32-byte RAND_Server
id_peer ID_Peer
id_peer_len Length of ID_Peer
id_server ID_Server
id_server_len Length of ID_Server
msk Buffer for 64-byte MSK
emsk Buffer for 64-byte EMSK
sk Buffer for SK (at least EAP_GPSK_MAX_SK_LEN bytes)
sk_len Buffer for returning length of SK
pk Buffer for PK (at least EAP_GPSK_MAX_PK_LEN bytes)
pk_len Buffer for returning length of PK
Returns:
0 on success, -1 on failure

Definition at line 290 of file eap_gpsk_common.c.

Here is the call graph for this function:

size_t eap_gpsk_mic_len ( int  vendor,
int  specifier 
)

Get the length of the MIC.

Parameters:
vendor CSuite/Vendor
specifier CSuite/Specifier
Returns:
MIC length in bytes

Definition at line 362 of file eap_gpsk_common.c.

int eap_gpsk_supported_ciphersuite ( int  vendor,
int  specifier 
)

Check whether ciphersuite is supported.

Parameters:
vendor CSuite/Vendor
specifier CSuite/Specifier
Returns:
1 if ciphersuite is support, or 0 if not

Definition at line 35 of file eap_gpsk_common.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:20:55 2009 for hostapd by  doxygen 1.6.1