The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
vector.c File Reference

Retrieve or derive vectors for EAP-SIM. More...

#include <freeradius-devel/eap/base.h>
#include <freeradius-devel/eap/types.h>
#include <freeradius-devel/sim/common.h>
#include <freeradius-devel/sim/milenage.h>
#include <freeradius-devel/sim/ts_34_108.h>
#include <freeradius-devel/sim/comp128.h>
#include <freeradius-devel/protocol/freeradius/freeradius.internal.sim.h>
#include <freeradius-devel/util/rand.h>
#include "base.h"
#include "attrs.h"
#include <freeradius-devel/util/debug.h>
+ Include dependency graph for vector.c:

Go to the source code of this file.

Functions

int fr_aka_sim_umts_resync_from_attrs (uint64_t *new_sqn, request_t *request, fr_pair_t *auts_vp, fr_aka_sim_keys_t *keys)
 Perform milenage AUTS validation and resynchronisation. More...
 
int fr_aka_sim_vector_gsm_from_attrs (request_t *request, fr_pair_list_t *vps, int idx, fr_aka_sim_keys_t *keys, fr_aka_sim_vector_src_t *src)
 Retrieve GSM triplets from sets of attributes. More...
 
int fr_aka_sim_vector_gsm_umts_kdf_0_reauth_from_attrs (request_t *request, fr_pair_list_t *vps, fr_aka_sim_keys_t *keys)
 Populate a fr_aka_sim_keys_t structure from attributes in the session-state list. More...
 
int fr_aka_sim_vector_umts_from_attrs (request_t *request, fr_pair_list_t *vps, fr_aka_sim_keys_t *keys, fr_aka_sim_vector_src_t *src)
 Retrieve UMTS quintuplets from sets of attributes. More...
 
int fr_aka_sim_vector_umts_kdf_1_reauth_from_attrs (request_t *request, fr_pair_list_t *vps, fr_aka_sim_keys_t *keys)
 Populate a fr_aka_sim_keys_t structure from attributes in the session-state list. More...
 
void fr_aka_sim_vector_umts_reauth_clear (fr_aka_sim_keys_t *keys)
 Clear reauth data if reauthentication failed. More...
 
static int vector_gsm_from_ki (request_t *request, fr_pair_list_t *vps, int idx, fr_aka_sim_keys_t *keys)
 
static int vector_gsm_from_quintuplets (request_t *request, fr_pair_list_t *vps, int idx, fr_aka_sim_keys_t *keys)
 Derive triplets from quintuplets. More...
 
static int vector_gsm_from_triplets (request_t *request, fr_pair_list_t *vps, int idx, fr_aka_sim_keys_t *keys)
 
static int vector_opc_from_op (request_t *request, uint8_t const **out, uint8_t opc_buff[MILENAGE_OPC_SIZE], fr_pair_list_t *list, uint8_t const ki[MILENAGE_KI_SIZE])
 
static int vector_umts_from_ki (request_t *request, fr_pair_list_t *vps, fr_aka_sim_keys_t *keys)
 
static int vector_umts_from_quintuplets (request_t *request, fr_pair_list_t *vps, fr_aka_sim_keys_t *keys)
 Get one set of quintuplets from the request. More...
 

Detailed Description

Retrieve or derive vectors for EAP-SIM.

Id
82b6ad2e04adc92bf594689b7125b574b07121ec
Author
Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)

Definition in file vector.c.

Function Documentation

◆ fr_aka_sim_umts_resync_from_attrs()

int fr_aka_sim_umts_resync_from_attrs ( uint64_t *  new_sqn,
request_t request,
fr_pair_t auts_vp,
fr_aka_sim_keys_t keys 
)

Perform milenage AUTS validation and resynchronisation.

Parameters
[out]new_sqnThe new sequence number provided by the AUTS.
[in]requestThe current request.
[in]auts_vpThe AUTS response.
[in]keysUMTS keys.
Returns
  • 1 if we do not have sufficient data (lacking ki).
  • 0 on success.
  • -1 on validation failure.

Definition at line 935 of file vector.c.

+ Here is the call graph for this function:

◆ fr_aka_sim_vector_gsm_from_attrs()

int fr_aka_sim_vector_gsm_from_attrs ( request_t request,
fr_pair_list_t vps,
int  idx,
fr_aka_sim_keys_t keys,
fr_aka_sim_vector_src_t src 
)

Retrieve GSM triplets from sets of attributes.

Hunt for a source of SIM triplets

Parameters
[in]requestThe current subrequest.
[in]vpsList to hunt for triplets in.
[in]idxTo write EAP-SIM triplets to.
[in]keysEAP session keys.
[in]srcForces triplets to be retrieved from a particular src and ensures if multiple triplets are being retrieved that they all come from the same src.
Returns
  • 1 Vector could not be retrieved from the specified src.
  • 0 Vector was retrieved OK and written to the specified index.
  • -1 Error retrieving vector from the specified src.

Definition at line 330 of file vector.c.

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

◆ fr_aka_sim_vector_gsm_umts_kdf_0_reauth_from_attrs()

int fr_aka_sim_vector_gsm_umts_kdf_0_reauth_from_attrs ( request_t request,
fr_pair_list_t vps,
fr_aka_sim_keys_t keys 
)

Populate a fr_aka_sim_keys_t structure from attributes in the session-state list.

Parameters
[in]requestThe current request.
[in]vpsSession-state list
[in]keyskey structure to populate.
Returns
  • 1 if we do not have sufficient data.
  • 0 on success.
  • -1 on validation failure.

Definition at line 824 of file vector.c.

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

◆ fr_aka_sim_vector_umts_from_attrs()

int fr_aka_sim_vector_umts_from_attrs ( request_t request,
fr_pair_list_t vps,
fr_aka_sim_keys_t keys,
fr_aka_sim_vector_src_t src 
)

Retrieve UMTS quintuplets from sets of attributes.

Hunt for a source of UMTS quintuplets

Parameters
requestThe current request.
vpsList to hunt for triplets in.
keysUMTS keys.
srcForces quintuplets to be retrieved from a particular src.
Returns
  • 1 Vector could not be retrieved from the specified src.
  • 0 Vector was retrieved OK and written to the specified index.
  • -1 Error retrieving vector from the specified src.

Definition at line 755 of file vector.c.

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

◆ fr_aka_sim_vector_umts_kdf_1_reauth_from_attrs()

int fr_aka_sim_vector_umts_kdf_1_reauth_from_attrs ( request_t request,
fr_pair_list_t vps,
fr_aka_sim_keys_t keys 
)

Populate a fr_aka_sim_keys_t structure from attributes in the session-state list.

Parameters
[in]requestThe current request.
[in]vpsSession-state list
[in]keyskey structure to populate.
Returns
  • 1 if we do not have sufficient data.
  • 0 on success.
  • -1 on validation failure.

Definition at line 873 of file vector.c.

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

◆ fr_aka_sim_vector_umts_reauth_clear()

void fr_aka_sim_vector_umts_reauth_clear ( fr_aka_sim_keys_t keys)

Clear reauth data if reauthentication failed.

Parameters
[in]keyskey structure to clear.

Definition at line 917 of file vector.c.

+ Here is the caller graph for this function:

◆ vector_gsm_from_ki()

static int vector_gsm_from_ki ( request_t request,
fr_pair_list_t vps,
int  idx,
fr_aka_sim_keys_t keys 
)
static

Definition at line 79 of file vector.c.

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

◆ vector_gsm_from_quintuplets()

static int vector_gsm_from_quintuplets ( request_t request,
fr_pair_list_t vps,
int  idx,
fr_aka_sim_keys_t keys 
)
static

Derive triplets from quintuplets.

Definition at line 237 of file vector.c.

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

◆ vector_gsm_from_triplets()

static int vector_gsm_from_triplets ( request_t request,
fr_pair_list_t vps,
int  idx,
fr_aka_sim_keys_t keys 
)
static

Definition at line 177 of file vector.c.

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

◆ vector_opc_from_op()

static int vector_opc_from_op ( request_t request,
uint8_t const **  out,
uint8_t  opc_buff[MILENAGE_OPC_SIZE],
fr_pair_list_t list,
uint8_t const  ki[MILENAGE_KI_SIZE] 
)
static

Definition at line 43 of file vector.c.

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

◆ vector_umts_from_ki()

static int vector_umts_from_ki ( request_t request,
fr_pair_list_t vps,
fr_aka_sim_keys_t keys 
)
static

Definition at line 396 of file vector.c.

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

◆ vector_umts_from_quintuplets()

static int vector_umts_from_quintuplets ( request_t request,
fr_pair_list_t vps,
fr_aka_sim_keys_t keys 
)
static

Get one set of quintuplets from the request.

Definition at line 593 of file vector.c.

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