The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
eap_pwd.h File Reference
#include <freeradius-devel/eap/base.h>
#include <freeradius-devel/tls/openssl_user_macros.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_t
 
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 EC_POINT_get_affine_coordinates   EC_POINT_get_affine_coordinates_GFp
 copyright holder grants permission for redistribution and use in source and binary forms, with or without modification, provided that the following conditions are met: More...
 
#define EC_POINT_set_affine_coordinates   EC_POINT_set_affine_coordinates_GFp
 
#define PWD_STATE_COMMIT   2
 
#define PWD_STATE_CONFIRM   3
 
#define PWD_STATE_ID_REQ   1
 

Functions

int compute_keys (request_t *request, pwd_session_t *sess, uint8_t *peer_confirm, uint8_t *msk, uint8_t *emsk)
 
int compute_password_element (request_t *request, 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, BN_CTX *bnctx)
 
int compute_peer_confirm (request_t *request, pwd_session_t *sess, uint8_t *out, BN_CTX *bnctx)
 
int compute_scalar_element (request_t *request, pwd_session_t *sess, BN_CTX *bnctx)
 
int compute_server_confirm (request_t *request, pwd_session_t *sess, uint8_t *out, BN_CTX *bnctx)
 
int process_peer_commit (request_t *request, pwd_session_t *sess, uint8_t *in, size_t in_len, BN_CTX *bnctx)
 

Data Structure Documentation

◆ pwd_hdr

struct pwd_hdr

Definition at line 49 of file eap_pwd.h.

Data Fields
uint8_t data[]
uint8_t lm_exchange

◆ pwd_id_packet_t

struct pwd_id_packet_t

Definition at line 65 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]

◆ pwd_session_t

struct pwd_session_t

Definition at line 79 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[FR_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

◆ EAP_PWD_DEF_PRF

#define EAP_PWD_DEF_PRF   1

Definition at line 70 of file eap_pwd.h.

◆ EAP_PWD_DEF_RAND_FUN

#define EAP_PWD_DEF_RAND_FUN   1

Definition at line 68 of file eap_pwd.h.

◆ EAP_PWD_EXCH_COMMIT

#define EAP_PWD_EXCH_COMMIT   2

Definition at line 52 of file eap_pwd.h.

◆ EAP_PWD_EXCH_CONFIRM

#define EAP_PWD_EXCH_CONFIRM   3

Definition at line 53 of file eap_pwd.h.

◆ EAP_PWD_EXCH_ID

#define EAP_PWD_EXCH_ID   1

Definition at line 51 of file eap_pwd.h.

◆ EAP_PWD_GET_EXCHANGE

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

Definition at line 62 of file eap_pwd.h.

◆ EAP_PWD_GET_LENGTH_BIT

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

Definition at line 58 of file eap_pwd.h.

◆ EAP_PWD_GET_MORE_BIT

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

Definition at line 60 of file eap_pwd.h.

◆ EAP_PWD_PREP_MS

#define EAP_PWD_PREP_MS   1

Definition at line 74 of file eap_pwd.h.

◆ EAP_PWD_PREP_NONE

#define EAP_PWD_PREP_NONE   0

Definition at line 73 of file eap_pwd.h.

◆ EAP_PWD_PREP_SASL

#define EAP_PWD_PREP_SASL   2

Definition at line 75 of file eap_pwd.h.

◆ EAP_PWD_SET_EXCHANGE

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

Definition at line 63 of file eap_pwd.h.

◆ EAP_PWD_SET_LENGTH_BIT

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

Definition at line 59 of file eap_pwd.h.

◆ EAP_PWD_SET_MORE_BIT

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

Definition at line 61 of file eap_pwd.h.

◆ EC_POINT_get_affine_coordinates

#define EC_POINT_get_affine_coordinates   EC_POINT_get_affine_coordinates_GFp

copyright holder grants permission for redistribution and use in source and binary forms, with or without modification, provided that the following conditions are met:

  1. Redistribution of source code must retain the above copyright notice, this list of conditions, and the following disclaimer in all source files.
  2. Redistribution in binary form must retain the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.

"DISCLAIMER OF LIABILITY

THIS SOFTWARE IS PROVIDED BY DAN HARKINS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INDUSTRIAL LOUNGE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."

This license and distribution terms cannot be changed. In other words, this code cannot simply be copied and put under a different distribution license (including the GNU public license).

Definition at line 45 of file eap_pwd.h.

◆ EC_POINT_set_affine_coordinates

#define EC_POINT_set_affine_coordinates   EC_POINT_set_affine_coordinates_GFp

Definition at line 46 of file eap_pwd.h.

◆ PWD_STATE_COMMIT

#define PWD_STATE_COMMIT   2

Definition at line 82 of file eap_pwd.h.

◆ PWD_STATE_CONFIRM

#define PWD_STATE_CONFIRM   3

Definition at line 83 of file eap_pwd.h.

◆ PWD_STATE_ID_REQ

#define PWD_STATE_ID_REQ   1

Definition at line 81 of file eap_pwd.h.

Function Documentation

◆ compute_keys()

int compute_keys ( request_t request,
pwd_session_t sess,
uint8_t peer_confirm,
uint8_t msk,
uint8_t emsk 
)

◆ compute_password_element()

int compute_password_element ( request_t request,
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,
BN_CTX *  bnctx 
)

Definition at line 253 of file eap_pwd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_peer_confirm()

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

Definition at line 787 of file eap_pwd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_scalar_element()

int compute_scalar_element ( request_t request,
pwd_session_t sess,
BN_CTX *  bnctx 
)

Definition at line 518 of file eap_pwd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_server_confirm()

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

Definition at line 684 of file eap_pwd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_peer_commit()

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

Definition at line 558 of file eap_pwd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: