The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
eap_pwd.c File Reference
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/tls/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include "eap_pwd.h"
#include "const_time.h"
+ Include dependency graph for eap_pwd.c:

Go to the source code of this file.

Functions

int compute_keys (UNUSED request_t *request, pwd_session_t *session, uint8_t *peer_confirm, uint8_t *msk, uint8_t *emsk)
 
int compute_password_element (request_t *request, pwd_session_t *session, 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 *session, uint8_t *out, BN_CTX *bn_ctx)
 
int compute_scalar_element (request_t *request, pwd_session_t *session, BN_CTX *bn_ctx)
 
int compute_server_confirm (request_t *request, pwd_session_t *session, uint8_t *out, BN_CTX *bn_ctx)
 
static BIGNUM * consttime_BN (void)
 
static void do_equation (EC_GROUP *group, BIGNUM *y2, BIGNUM *x, BN_CTX *bnctx)
 
static void eap_pwd_kdf (uint8_t *key, int keylen, char const *label, int label_len, uint8_t *result, int result_bit_len)
 
static int is_quadratic_residue (BIGNUM *val, BIGNUM *p, BIGNUM *qr, BIGNUM *qnr, BN_CTX *bnctx)
 
static int legendre (BIGNUM *a, BIGNUM *p, BN_CTX *bnctx)
 
int process_peer_commit (request_t *request, pwd_session_t *session, uint8_t *in, size_t in_len, BN_CTX *bn_ctx)
 
static void pwd_hmac_final (EVP_MD_CTX *hmac_ctx, uint8_t digest[static SHA256_DIGEST_LENGTH])
 

Variables

static USES_APPLE_DEPRECATED_API uint8_t allzero [SHA256_DIGEST_LENGTH] = { 0x00 }
 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...
 

Function Documentation

◆ compute_keys()

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

Definition at line 889 of file eap_pwd.c.

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

◆ compute_password_element()

int compute_password_element ( request_t request,
pwd_session_t session,
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 session,
uint8_t out,
BN_CTX *  bn_ctx 
)

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 session,
BN_CTX *  bn_ctx 
)

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 session,
uint8_t out,
BN_CTX *  bn_ctx 
)

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:

◆ consttime_BN()

static BIGNUM* consttime_BN ( void  )
static

Definition at line 102 of file eap_pwd.c.

+ Here is the caller graph for this function:

◆ do_equation()

static void do_equation ( EC_GROUP *  group,
BIGNUM *  y2,
BIGNUM *  x,
BN_CTX *  bnctx 
)
static

Definition at line 143 of file eap_pwd.c.

+ Here is the caller graph for this function:

◆ eap_pwd_kdf()

static void eap_pwd_kdf ( uint8_t key,
int  keylen,
char const *  label,
int  label_len,
uint8_t result,
int  result_bit_len 
)
static

Definition at line 56 of file eap_pwd.c.

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

◆ is_quadratic_residue()

static int is_quadratic_residue ( BIGNUM *  val,
BIGNUM *  p,
BIGNUM *  qr,
BIGNUM *  qnr,
BN_CTX *  bnctx 
)
static

Definition at line 174 of file eap_pwd.c.

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

◆ legendre()

static int legendre ( BIGNUM *  a,
BIGNUM *  p,
BN_CTX *  bnctx 
)
static

Definition at line 114 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 session,
uint8_t in,
size_t  in_len,
BN_CTX *  bn_ctx 
)

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:

◆ pwd_hmac_final()

static void pwd_hmac_final ( EVP_MD_CTX *  hmac_ctx,
uint8_t  digest[static SHA256_DIGEST_LENGTH] 
)
static

Definition at line 47 of file eap_pwd.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ allzero

USES_APPLE_DEPRECATED_API uint8_t allzero[SHA256_DIGEST_LENGTH] = { 0x00 }
static

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 44 of file eap_pwd.c.