All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
eap_pwd.h File Reference
#include "eap.h"
#include <openssl/bn.h>
#include <openssl/sha.h>
#include <openssl/ec.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
+ Include dependency graph for eap_pwd.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _pwd_hdr
 
struct  _pwd_id_packet
 
struct  _pwd_session_t
 

Macros

#define EAP_PWD_DEF_PRF   1
 
#define EAP_PWD_DEF_RAND_FUN   1
 
#define EAP_PWD_EXCH_COMMIT   2
 
#define EAP_PWD_EXCH_CONFIRM   3
 
#define EAP_PWD_EXCH_ID   1
 
#define EAP_PWD_GET_EXCHANGE(x)   ((x)->lm_exchange & 0x3f)
 
#define EAP_PWD_GET_LENGTH_BIT(x)   ((x)->lm_exchange & 0x80)
 
#define EAP_PWD_GET_MORE_BIT(x)   ((x)->lm_exchange & 0x40)
 
#define EAP_PWD_PREP_MS   1
 
#define EAP_PWD_PREP_NONE   0
 
#define EAP_PWD_PREP_SASL   2
 
#define EAP_PWD_SET_EXCHANGE(x, y)   ((x)->lm_exchange |= (y))
 
#define EAP_PWD_SET_LENGTH_BIT(x)   ((x)->lm_exchange |= 0x80)
 
#define EAP_PWD_SET_MORE_BIT(x)   ((x)->lm_exchange |= 0x40)
 
#define PWD_STATE_COMMIT   2
 
#define PWD_STATE_CONFIRM   3
 
#define PWD_STATE_ID_REQ   1
 

Typedefs

typedef struct _pwd_session_t pwd_session_t
 

Functions

struct _pwd_hdr CC_HINT (packed) pwd_hdr
 
int compute_keys (pwd_session_t *sess, uint8_t *peer_confirm, uint8_t *msk, uint8_t *emsk)
 
int compute_password_element (pwd_session_t *sess, uint16_t grp_num, char const *password, int password_len, char const *id_server, int id_server_len, char const *id_peer, int id_peer_len, uint32_t *token)
 
int compute_peer_confirm (pwd_session_t *sess, uint8_t *out, BN_CTX *bnctx)
 
int compute_scalar_element (pwd_session_t *sess, BN_CTX *bnctx)
 
int compute_server_confirm (pwd_session_t *sess, uint8_t *out, BN_CTX *bnctx)
 
int process_peer_commit (pwd_session_t *sess, uint8_t *in, size_t in_len, BN_CTX *bnctx)
 

Variables

uint8_t data []
 
uint16_t group_num
 
char identity []
 
uint8_t lm_exchange
 
uint8_t prep
 
uint8_t prf
 
uint8_t random_function
 
uint8_t token [4]
 

Data Structure Documentation

struct _pwd_hdr

Definition at line 46 of file eap_pwd.h.

Data Fields
uint8_t data[]
uint8_t lm_exchange
struct _pwd_id_packet

Definition at line 62 of file eap_pwd.h.

Data Fields
uint16_t group_num
char identity[]
uint8_t prep
uint8_t prf
uint8_t random_function
uint8_t token[4]
struct _pwd_session_t

Definition at line 76 of file eap_pwd.h.

Data Fields
uint32_t ciphersuite
EC_GROUP * group
uint16_t group_num
uint8_t * in
size_t in_len
size_t in_pos
BIGNUM * k
size_t mtu
uint8_t my_confirm[SHA256_DIGEST_LENGTH]
EC_POINT * my_element
BIGNUM * my_scalar
BIGNUM * order
uint8_t * out
size_t out_len
size_t out_pos
EC_POINT * peer_element
char peer_id[MAX_STRING_LEN]
size_t peer_id_len
BIGNUM * peer_scalar
BIGNUM * prime
BIGNUM * private_value
EC_POINT * pwe
uint16_t state
uint32_t token

Macro Definition Documentation

#define EAP_PWD_DEF_PRF   1

Definition at line 624 of file eap_pwd.h.

#define EAP_PWD_DEF_RAND_FUN   1

Definition at line 622 of file eap_pwd.h.

#define EAP_PWD_EXCH_COMMIT   2

Definition at line 622 of file eap_pwd.h.

#define EAP_PWD_EXCH_CONFIRM   3

Definition at line 623 of file eap_pwd.h.

#define EAP_PWD_EXCH_ID   1

Definition at line 621 of file eap_pwd.h.

#define EAP_PWD_GET_EXCHANGE (   x)    ((x)->lm_exchange & 0x3f)

Definition at line 59 of file eap_pwd.h.

#define EAP_PWD_GET_LENGTH_BIT (   x)    ((x)->lm_exchange & 0x80)

Definition at line 55 of file eap_pwd.h.

#define EAP_PWD_GET_MORE_BIT (   x)    ((x)->lm_exchange & 0x40)

Definition at line 57 of file eap_pwd.h.

#define EAP_PWD_PREP_MS   1

Definition at line 628 of file eap_pwd.h.

#define EAP_PWD_PREP_NONE   0

Definition at line 627 of file eap_pwd.h.

#define EAP_PWD_PREP_SASL   2

Definition at line 629 of file eap_pwd.h.

#define EAP_PWD_SET_EXCHANGE (   x,
 
)    ((x)->lm_exchange |= (y))

Definition at line 60 of file eap_pwd.h.

#define EAP_PWD_SET_LENGTH_BIT (   x)    ((x)->lm_exchange |= 0x80)

Definition at line 56 of file eap_pwd.h.

#define EAP_PWD_SET_MORE_BIT (   x)    ((x)->lm_exchange |= 0x40)

Definition at line 58 of file eap_pwd.h.

#define PWD_STATE_COMMIT   2

Definition at line 79 of file eap_pwd.h.

#define PWD_STATE_CONFIRM   3

Definition at line 80 of file eap_pwd.h.

#define PWD_STATE_ID_REQ   1

Definition at line 78 of file eap_pwd.h.

Typedef Documentation

typedef struct _pwd_session_t pwd_session_t

Function Documentation

struct _pwd_id_packet CC_HINT ( packed  )
int compute_keys ( pwd_session_t sess,
uint8_t *  peer_confirm,
uint8_t *  msk,
uint8_t *  emsk 
)

Definition at line 619 of file eap_pwd.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int compute_password_element ( pwd_session_t sess,
uint16_t  grp_num,
char const *  password,
int  password_len,
char const *  id_server,
int  id_server_len,
char const *  id_peer,
int  id_peer_len,
uint32_t *  token 
)

Definition at line 103 of file eap_pwd.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int compute_peer_confirm ( pwd_session_t sess,
uint8_t *  out,
BN_CTX *  bnctx 
)

Definition at line 520 of file eap_pwd.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int compute_scalar_element ( pwd_session_t sess,
BN_CTX *  bnctx 
)

Definition at line 273 of file eap_pwd.c.

+ Here is the caller graph for this function:

int compute_server_confirm ( pwd_session_t sess,
uint8_t *  out,
BN_CTX *  bnctx 
)

Definition at line 421 of file eap_pwd.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int process_peer_commit ( pwd_session_t sess,
uint8_t *  in,
size_t  in_len,
BN_CTX *  bnctx 
)

Definition at line 315 of file eap_pwd.c.

+ Here is the caller graph for this function:

Variable Documentation

uint8_t data[]

Definition at line 625 of file eap_pwd.h.

uint16_t group_num

Definition at line 620 of file eap_pwd.h.

char identity[]

Definition at line 630 of file eap_pwd.h.

uint8_t lm_exchange

Definition at line 620 of file eap_pwd.h.

uint8_t prep

Definition at line 626 of file eap_pwd.h.

uint8_t prf

Definition at line 623 of file eap_pwd.h.

uint8_t random_function

Definition at line 621 of file eap_pwd.h.

uint8_t token[4]

Definition at line 625 of file eap_pwd.h.