Classes | Defines | Functions | Variables
eap_fast_pac.c File Reference
#include "includes.h"
#include "common.h"
#include "eap_config.h"
#include "eap_i.h"
#include "eap_fast_pac.h"
Include dependency graph for eap_fast_pac.c:

Go to the source code of this file.

Classes

struct  eap_fast_read_ctx

Defines

#define EAP_FAST_PAC_BINARY_FORMAT_VERSION   0
#define EAP_FAST_PAC_BINARY_MAGIC   0x6ae4920c

Functions

int eap_fast_add_pac (struct eap_fast_pac **pac_root, struct eap_fast_pac **pac_current, struct eap_fast_pac *entry)
static int eap_fast_add_pac_data (struct eap_fast_pac *pac, char **buf, char **pos, size_t *buf_len)
static int eap_fast_copy_buf (u8 **dst, size_t *dst_len, const u8 *src, size_t src_len)
static void eap_fast_deinit_pac_data (struct eap_fast_read_ctx *rc)
void eap_fast_free_pac (struct eap_fast_pac *pac)
struct eap_fast_paceap_fast_get_pac (struct eap_fast_pac *pac_root, const u8 *a_id, size_t a_id_len, u16 pac_type)
static int eap_fast_init_pac_data (struct eap_sm *sm, const char *pac_file, struct eap_fast_read_ctx *rc)
int eap_fast_load_pac (struct eap_sm *sm, struct eap_fast_pac **pac_root, const char *pac_file)
int eap_fast_load_pac_bin (struct eap_sm *sm, struct eap_fast_pac **pac_root, const char *pac_file)
static void eap_fast_pac_get_a_id (struct eap_fast_pac *pac)
size_t eap_fast_pac_list_truncate (struct eap_fast_pac *pac_root, size_t max_len)
static const char * eap_fast_parse_a_id (struct eap_fast_pac *pac, char *pos)
static const char * eap_fast_parse_a_id_info (struct eap_fast_pac *pac, char *pos)
static const char * eap_fast_parse_end (struct eap_fast_pac **pac_root, struct eap_fast_pac **pac)
static u8 * eap_fast_parse_hex (const char *value, size_t *len)
static const char * eap_fast_parse_i_id (struct eap_fast_pac *pac, char *pos)
static const char * eap_fast_parse_pac_key (struct eap_fast_pac *pac, char *pos)
static const char * eap_fast_parse_pac_opaque (struct eap_fast_pac *pac, char *pos)
static const char * eap_fast_parse_pac_type (struct eap_fast_pac *pac, char *pos)
static const char * eap_fast_parse_start (struct eap_fast_pac **pac)
static int eap_fast_read_line (struct eap_fast_read_ctx *rc, char **value)
static void eap_fast_remove_pac (struct eap_fast_pac **pac_root, struct eap_fast_pac **pac_current, const u8 *a_id, size_t a_id_len, u16 pac_type)
int eap_fast_save_pac (struct eap_sm *sm, struct eap_fast_pac *pac_root, const char *pac_file)
int eap_fast_save_pac_bin (struct eap_sm *sm, struct eap_fast_pac *pac_root, const char *pac_file)
static void eap_fast_write (char **buf, char **pos, size_t *buf_len, const char *field, const u8 *data, size_t len, int txt)
static int eap_fast_write_pac (struct eap_sm *sm, const char *pac_file, char *buf, size_t len)

Variables

static const char * pac_file_hdr = "wpa_supplicant EAP-FAST PAC file - version 1"

Define Documentation

Definition at line 46 of file eap_fast_pac.c.

#define EAP_FAST_PAC_BINARY_MAGIC   0x6ae4920c

Definition at line 45 of file eap_fast_pac.c.


Function Documentation

int eap_fast_add_pac ( struct eap_fast_pac **  pac_root,
struct eap_fast_pac **  pac_current,
struct eap_fast_pac entry 
)

eap_fast_add_pac - Add a copy of a PAC entry to a list : Pointer to PAC list root pointer : Pointer to the current PAC pointer : New entry to clone and add to the list Returns: 0 on success, -1 on failure

This function makes a clone of the given PAC entry and adds this copied entry to the list (pac_root). If an old entry for the same A-ID is found, it will be removed from the PAC list and in this case, pac_current entry is set to NULL if it was the removed entry.

Definition at line 145 of file eap_fast_pac.c.

static int eap_fast_add_pac_data ( struct eap_fast_pac pac,
char **  buf,
char **  pos,
size_t *  buf_len 
) [static]

Definition at line 573 of file eap_fast_pac.c.

static int eap_fast_copy_buf ( u8 **  dst,
size_t *  dst_len,
const u8 *  src,
size_t  src_len 
) [static]

Definition at line 119 of file eap_fast_pac.c.

static void eap_fast_deinit_pac_data ( struct eap_fast_read_ctx rc) [static]

Definition at line 297 of file eap_fast_pac.c.

void eap_fast_free_pac ( struct eap_fast_pac pac)

eap_fast_free_pac - Free PAC data : Pointer to the PAC entry

Note that the PAC entry must not be in a list since this function does not remove the list links.

Definition at line 56 of file eap_fast_pac.c.

struct eap_fast_pac* eap_fast_get_pac ( struct eap_fast_pac pac_root,
const u8 *  a_id,
size_t  a_id_len,
u16  pac_type 
) [read]

eap_fast_get_pac - Get a PAC entry based on A-ID : Pointer to root of the PAC list : A-ID to search for : Length of A-ID : PAC-Type to search for Returns: Pointer to the PAC entry, or NULL if A-ID not found

Definition at line 75 of file eap_fast_pac.c.

static int eap_fast_init_pac_data ( struct eap_sm sm,
const char *  pac_file,
struct eap_fast_read_ctx rc 
) [static]

Definition at line 260 of file eap_fast_pac.c.

int eap_fast_load_pac ( struct eap_sm sm,
struct eap_fast_pac **  pac_root,
const char *  pac_file 
)

eap_fast_load_pac - Load PAC entries (text format) : Pointer to EAP state machine allocated with eap_peer_sm_init() : Pointer to root of the PAC list (to be filled) : Name of the PAC file/blob to load Returns: 0 on success, -1 on failure

Definition at line 416 of file eap_fast_pac.c.

int eap_fast_load_pac_bin ( struct eap_sm sm,
struct eap_fast_pac **  pac_root,
const char *  pac_file 
)

eap_fast_load_pac_bin - Load PAC entries (binary format) : Pointer to EAP state machine allocated with eap_peer_sm_init() : Pointer to root of the PAC list (to be filled) : Name of the PAC file/blob to load Returns: 0 on success, -1 on failure

Definition at line 749 of file eap_fast_pac.c.

static void eap_fast_pac_get_a_id ( struct eap_fast_pac pac) [static]

Definition at line 703 of file eap_fast_pac.c.

size_t eap_fast_pac_list_truncate ( struct eap_fast_pac pac_root,
size_t  max_len 
)

eap_fast_pac_list_truncate - Truncate a PAC list to the given length : Root of the PAC list : Maximum length of the list (>= 1) Returns: Number of PAC entries removed

Definition at line 668 of file eap_fast_pac.c.

static const char* eap_fast_parse_a_id ( struct eap_fast_pac pac,
char *  pos 
) [static]

Definition at line 378 of file eap_fast_pac.c.

static const char* eap_fast_parse_a_id_info ( struct eap_fast_pac pac,
char *  pos 
) [static]

Definition at line 398 of file eap_fast_pac.c.

static const char* eap_fast_parse_end ( struct eap_fast_pac **  pac_root,
struct eap_fast_pac **  pac 
) [static]

Definition at line 318 of file eap_fast_pac.c.

static u8* eap_fast_parse_hex ( const char *  value,
size_t *  len 
) [static]

Definition at line 238 of file eap_fast_pac.c.

static const char* eap_fast_parse_i_id ( struct eap_fast_pac pac,
char *  pos 
) [static]

Definition at line 388 of file eap_fast_pac.c.

static const char* eap_fast_parse_pac_key ( struct eap_fast_pac pac,
char *  pos 
) [static]

Definition at line 349 of file eap_fast_pac.c.

static const char* eap_fast_parse_pac_opaque ( struct eap_fast_pac pac,
char *  pos 
) [static]

Definition at line 367 of file eap_fast_pac.c.

static const char* eap_fast_parse_pac_type ( struct eap_fast_pac pac,
char *  pos 
) [static]

Definition at line 336 of file eap_fast_pac.c.

static const char* eap_fast_parse_start ( struct eap_fast_pac **  pac) [static]

Definition at line 305 of file eap_fast_pac.c.

static int eap_fast_read_line ( struct eap_fast_read_ctx rc,
char **  value 
) [static]

Definition at line 195 of file eap_fast_pac.c.

static void eap_fast_remove_pac ( struct eap_fast_pac **  pac_root,
struct eap_fast_pac **  pac_current,
const u8 *  a_id,
size_t  a_id_len,
u16  pac_type 
) [static]

Definition at line 92 of file eap_fast_pac.c.

int eap_fast_save_pac ( struct eap_sm sm,
struct eap_fast_pac pac_root,
const char *  pac_file 
)

eap_fast_save_pac - Save PAC entries (text format) : Pointer to EAP state machine allocated with eap_peer_sm_init() : Root of the PAC list : Name of the PAC file/blob Returns: 0 on success, -1 on failure

Definition at line 617 of file eap_fast_pac.c.

int eap_fast_save_pac_bin ( struct eap_sm sm,
struct eap_fast_pac pac_root,
const char *  pac_file 
)

eap_fast_save_pac_bin - Save PAC entries (binary format) : Pointer to EAP state machine allocated with eap_peer_sm_init() : Root of the PAC list : Name of the PAC file/blob Returns: 0 on success, -1 on failure

Definition at line 866 of file eap_fast_pac.c.

static void eap_fast_write ( char **  buf,
char **  pos,
size_t *  buf_len,
const char *  field,
const u8 *  data,
size_t  len,
int  txt 
) [static]

Definition at line 477 of file eap_fast_pac.c.

static int eap_fast_write_pac ( struct eap_sm sm,
const char *  pac_file,
char *  buf,
size_t  len 
) [static]

Definition at line 534 of file eap_fast_pac.c.


Variable Documentation

const char* pac_file_hdr = "wpa_supplicant EAP-FAST PAC file - version 1" [static]

Definition at line 26 of file eap_fast_pac.c.



wpa_supplicant
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:34:38