The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
base.c File Reference

Code common to EAP-SIM/AKA/AKA' clients and servers. More...

#include <freeradius-devel/util/sha1.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/server/module.h>
#include <freeradius-devel/tls/base.h>
#include <freeradius-devel/eap/types.h>
#include <freeradius-devel/eap_aka_sim/base.h>
#include <freeradius-devel/eap_aka_sim/attrs.h>
#include "crypto_priv.h"
+ Include dependency graph for base.c:

Go to the source code of this file.

Functions

static int dict_flag_encrypt (fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules)
 
size_t fr_aka_sim_attr_len (fr_pair_t const *vp)
 Return the on-the-wire length of an attribute value. More...
 
void fr_aka_sim_free (void)
 
int fr_aka_sim_init (void)
 
size_t fr_aka_sim_octets_prefix_len (fr_dict_attr_t const *da)
 Return the number of bytes before the octets value. More...
 

Variables

fr_dict_attr_t const * attr_eap_aka_sim_ak
 
fr_dict_attr_t const * attr_eap_aka_sim_any_id_req
 
fr_dict_attr_t const * attr_eap_aka_sim_autn
 
fr_dict_attr_t const * attr_eap_aka_sim_auts
 
fr_dict_attr_t const * attr_eap_aka_sim_bidding
 
fr_dict_attr_t const * attr_eap_aka_sim_checkcode
 
fr_dict_attr_t const * attr_eap_aka_sim_ck
 
fr_dict_attr_t const * attr_eap_aka_sim_client_error_code
 
fr_dict_attr_t const * attr_eap_aka_sim_counter
 
fr_dict_attr_t const * attr_eap_aka_sim_counter_too_small
 
fr_dict_attr_t const * attr_eap_aka_sim_encr_data
 
fr_dict_attr_t const * attr_eap_aka_sim_fullauth_id_req
 
fr_dict_attr_t const * attr_eap_aka_sim_hmac_extra_request
 
fr_dict_attr_t const * attr_eap_aka_sim_hmac_extra_response
 
fr_dict_attr_t const * attr_eap_aka_sim_identity
 
fr_dict_attr_t const * attr_eap_aka_sim_identity_type
 
fr_dict_attr_t const * attr_eap_aka_sim_ik
 
fr_dict_attr_t const * attr_eap_aka_sim_iv
 
fr_dict_attr_t const * attr_eap_aka_sim_k_aut
 
fr_dict_attr_t const * attr_eap_aka_sim_k_encr
 
fr_dict_attr_t const * attr_eap_aka_sim_k_re
 
fr_dict_attr_t const * attr_eap_aka_sim_kc
 
fr_dict_attr_t const * attr_eap_aka_sim_kdf
 
fr_dict_attr_t const * attr_eap_aka_sim_kdf_identity
 
fr_dict_attr_t const * attr_eap_aka_sim_kdf_input
 
fr_dict_attr_t const * attr_eap_aka_sim_mac
 
fr_dict_attr_t const * attr_eap_aka_sim_method_hint
 
fr_dict_attr_t const * attr_eap_aka_sim_mk
 
fr_dict_attr_t const * attr_eap_aka_sim_next_pseudonym
 
fr_dict_attr_t const * attr_eap_aka_sim_next_reauth_id
 
fr_dict_attr_t const * attr_eap_aka_sim_nonce_mt
 
fr_dict_attr_t const * attr_eap_aka_sim_nonce_s
 
fr_dict_attr_t const * attr_eap_aka_sim_notification
 
fr_dict_attr_t const * attr_eap_aka_sim_permanent_id_req
 
fr_dict_attr_t const * attr_eap_aka_sim_permanent_identity
 
fr_dict_attr_t const * attr_eap_aka_sim_rand
 
fr_dict_attr_t const * attr_eap_aka_sim_res
 
fr_dict_attr_t const * attr_eap_aka_sim_result_ind
 
fr_dict_attr_t const * attr_eap_aka_sim_selected_version
 
fr_dict_attr_t const * attr_eap_aka_sim_sres
 
fr_dict_attr_t const * attr_eap_aka_sim_subtype
 
fr_dict_attr_t const * attr_eap_aka_sim_version_list
 
fr_dict_attr_t const * attr_eap_aka_sim_xres
 
fr_dict_attr_t const * attr_eap_identity
 
fr_dict_attr_t const * attr_eap_type
 
fr_dict_attr_t const * attr_ms_mppe_recv_key
 
fr_dict_attr_t const * attr_ms_mppe_send_key
 
fr_dict_attr_t const * attr_session_data
 
fr_dict_attr_t const * attr_session_id
 
fr_dict_attr_t const * attr_sim_algo_version
 
fr_dict_attr_t const * attr_sim_amf
 
fr_dict_attr_t const * attr_sim_ki
 
fr_dict_attr_t const * attr_sim_op
 
fr_dict_attr_t const * attr_sim_opc
 
fr_dict_attr_t const * attr_sim_sqn
 
fr_dict_t const * dict_eap_aka_sim
 
fr_dict_t const * dict_freeradius
 
fr_dict_t const * dict_radius
 
static fr_dict_flag_parser_t const eap_aka_sim_flags []
 
fr_value_box_t const * enum_eap_type_aka
 
fr_value_box_t const * enum_eap_type_aka_prime
 
fr_value_box_t const * enum_eap_type_sim
 
fr_value_box_t const * enum_kdf_prime_with_ck_prime_ik_prime
 
size_t const fr_aka_sim_attr_sizes [FR_TYPE_MAX+1][2]
 SIM AT on-the-wire format attribute sizes. More...
 
static uint32_t instance_count = 0
 
fr_dict_autoload_t libfreeradius_aka_sim_dict []
 
fr_dict_attr_autoload_t libfreeradius_aka_sim_dict_attr []
 
fr_dict_enum_autoload_t libfreeradius_aka_sim_dict_enum []
 
fr_dict_protocol_t libfreeradius_eap_aka_sim_dict_protocol
 

Detailed Description

Code common to EAP-SIM/AKA/AKA' clients and servers.

The development of the EAP-SIM support was funded by Internet Foundation Austria (http://www.nic.at/ipa).

Definition in file base.c.

Function Documentation

◆ dict_flag_encrypt()

static int dict_flag_encrypt ( fr_dict_attr_t **  da_p,
char const *  value,
UNUSED fr_dict_flag_parser_rule_t const *  rules 
)
static

Definition at line 227 of file base.c.

+ Here is the call graph for this function:

◆ fr_aka_sim_attr_len()

size_t fr_aka_sim_attr_len ( fr_pair_t const *  vp)

Return the on-the-wire length of an attribute value.

Parameters
[in]vpto return the length of.
Returns
the length of the attribute.

Definition at line 257 of file base.c.

◆ fr_aka_sim_free()

void fr_aka_sim_free ( void  )

Definition at line 315 of file base.c.

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

◆ fr_aka_sim_init()

int fr_aka_sim_init ( void  )

Definition at line 284 of file base.c.

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

◆ fr_aka_sim_octets_prefix_len()

size_t fr_aka_sim_octets_prefix_len ( fr_dict_attr_t const *  da)

Return the number of bytes before the octets value.

Definition at line 276 of file base.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ attr_eap_aka_sim_ak

fr_dict_attr_t const* attr_eap_aka_sim_ak

Definition at line 59 of file base.c.

◆ attr_eap_aka_sim_any_id_req

fr_dict_attr_t const* attr_eap_aka_sim_any_id_req

Definition at line 60 of file base.c.

◆ attr_eap_aka_sim_autn

fr_dict_attr_t const* attr_eap_aka_sim_autn

Definition at line 61 of file base.c.

◆ attr_eap_aka_sim_auts

fr_dict_attr_t const* attr_eap_aka_sim_auts

Definition at line 62 of file base.c.

◆ attr_eap_aka_sim_bidding

fr_dict_attr_t const* attr_eap_aka_sim_bidding

Definition at line 63 of file base.c.

◆ attr_eap_aka_sim_checkcode

fr_dict_attr_t const* attr_eap_aka_sim_checkcode

Definition at line 64 of file base.c.

◆ attr_eap_aka_sim_ck

fr_dict_attr_t const* attr_eap_aka_sim_ck

Definition at line 65 of file base.c.

◆ attr_eap_aka_sim_client_error_code

fr_dict_attr_t const* attr_eap_aka_sim_client_error_code

Definition at line 66 of file base.c.

◆ attr_eap_aka_sim_counter

fr_dict_attr_t const* attr_eap_aka_sim_counter

Definition at line 67 of file base.c.

◆ attr_eap_aka_sim_counter_too_small

fr_dict_attr_t const* attr_eap_aka_sim_counter_too_small

Definition at line 68 of file base.c.

◆ attr_eap_aka_sim_encr_data

fr_dict_attr_t const* attr_eap_aka_sim_encr_data

Definition at line 69 of file base.c.

◆ attr_eap_aka_sim_fullauth_id_req

fr_dict_attr_t const* attr_eap_aka_sim_fullauth_id_req

Definition at line 70 of file base.c.

◆ attr_eap_aka_sim_hmac_extra_request

fr_dict_attr_t const* attr_eap_aka_sim_hmac_extra_request

Definition at line 71 of file base.c.

◆ attr_eap_aka_sim_hmac_extra_response

fr_dict_attr_t const* attr_eap_aka_sim_hmac_extra_response

Definition at line 72 of file base.c.

◆ attr_eap_aka_sim_identity

fr_dict_attr_t const* attr_eap_aka_sim_identity

Definition at line 73 of file base.c.

◆ attr_eap_aka_sim_identity_type

fr_dict_attr_t const* attr_eap_aka_sim_identity_type

Definition at line 74 of file base.c.

◆ attr_eap_aka_sim_ik

fr_dict_attr_t const* attr_eap_aka_sim_ik

Definition at line 75 of file base.c.

◆ attr_eap_aka_sim_iv

fr_dict_attr_t const* attr_eap_aka_sim_iv

Definition at line 76 of file base.c.

◆ attr_eap_aka_sim_k_aut

fr_dict_attr_t const* attr_eap_aka_sim_k_aut

Definition at line 77 of file base.c.

◆ attr_eap_aka_sim_k_encr

fr_dict_attr_t const* attr_eap_aka_sim_k_encr

Definition at line 78 of file base.c.

◆ attr_eap_aka_sim_k_re

fr_dict_attr_t const* attr_eap_aka_sim_k_re

Definition at line 79 of file base.c.

◆ attr_eap_aka_sim_kc

fr_dict_attr_t const* attr_eap_aka_sim_kc

Definition at line 80 of file base.c.

◆ attr_eap_aka_sim_kdf

fr_dict_attr_t const* attr_eap_aka_sim_kdf

Definition at line 81 of file base.c.

◆ attr_eap_aka_sim_kdf_identity

fr_dict_attr_t const* attr_eap_aka_sim_kdf_identity

Definition at line 82 of file base.c.

◆ attr_eap_aka_sim_kdf_input

fr_dict_attr_t const* attr_eap_aka_sim_kdf_input

Definition at line 83 of file base.c.

◆ attr_eap_aka_sim_mac

fr_dict_attr_t const* attr_eap_aka_sim_mac

Definition at line 84 of file base.c.

◆ attr_eap_aka_sim_method_hint

fr_dict_attr_t const* attr_eap_aka_sim_method_hint

Definition at line 85 of file base.c.

◆ attr_eap_aka_sim_mk

fr_dict_attr_t const* attr_eap_aka_sim_mk

Definition at line 86 of file base.c.

◆ attr_eap_aka_sim_next_pseudonym

fr_dict_attr_t const* attr_eap_aka_sim_next_pseudonym

Definition at line 87 of file base.c.

◆ attr_eap_aka_sim_next_reauth_id

fr_dict_attr_t const* attr_eap_aka_sim_next_reauth_id

Definition at line 88 of file base.c.

◆ attr_eap_aka_sim_nonce_mt

fr_dict_attr_t const* attr_eap_aka_sim_nonce_mt

Definition at line 89 of file base.c.

◆ attr_eap_aka_sim_nonce_s

fr_dict_attr_t const* attr_eap_aka_sim_nonce_s

Definition at line 90 of file base.c.

◆ attr_eap_aka_sim_notification

fr_dict_attr_t const* attr_eap_aka_sim_notification

Definition at line 91 of file base.c.

◆ attr_eap_aka_sim_permanent_id_req

fr_dict_attr_t const* attr_eap_aka_sim_permanent_id_req

Definition at line 92 of file base.c.

◆ attr_eap_aka_sim_permanent_identity

fr_dict_attr_t const* attr_eap_aka_sim_permanent_identity

Definition at line 93 of file base.c.

◆ attr_eap_aka_sim_rand

fr_dict_attr_t const* attr_eap_aka_sim_rand

Definition at line 94 of file base.c.

◆ attr_eap_aka_sim_res

fr_dict_attr_t const* attr_eap_aka_sim_res

Definition at line 95 of file base.c.

◆ attr_eap_aka_sim_result_ind

fr_dict_attr_t const* attr_eap_aka_sim_result_ind

Definition at line 96 of file base.c.

◆ attr_eap_aka_sim_selected_version

fr_dict_attr_t const* attr_eap_aka_sim_selected_version

Definition at line 97 of file base.c.

◆ attr_eap_aka_sim_sres

fr_dict_attr_t const* attr_eap_aka_sim_sres

Definition at line 98 of file base.c.

◆ attr_eap_aka_sim_subtype

fr_dict_attr_t const* attr_eap_aka_sim_subtype

Definition at line 99 of file base.c.

◆ attr_eap_aka_sim_version_list

fr_dict_attr_t const* attr_eap_aka_sim_version_list

Definition at line 100 of file base.c.

◆ attr_eap_aka_sim_xres

fr_dict_attr_t const* attr_eap_aka_sim_xres

Definition at line 101 of file base.c.

◆ attr_eap_identity

fr_dict_attr_t const* attr_eap_identity

Definition at line 108 of file base.c.

◆ attr_eap_type

fr_dict_attr_t const* attr_eap_type

Definition at line 109 of file base.c.

◆ attr_ms_mppe_recv_key

fr_dict_attr_t const* attr_ms_mppe_recv_key

Definition at line 105 of file base.c.

◆ attr_ms_mppe_send_key

fr_dict_attr_t const* attr_ms_mppe_send_key

Definition at line 106 of file base.c.

◆ attr_session_data

fr_dict_attr_t const* attr_session_data

Definition at line 102 of file base.c.

◆ attr_session_id

fr_dict_attr_t const* attr_session_id

Definition at line 103 of file base.c.

◆ attr_sim_algo_version

fr_dict_attr_t const* attr_sim_algo_version

Definition at line 110 of file base.c.

◆ attr_sim_amf

fr_dict_attr_t const* attr_sim_amf

Definition at line 111 of file base.c.

◆ attr_sim_ki

fr_dict_attr_t const* attr_sim_ki

Definition at line 112 of file base.c.

◆ attr_sim_op

fr_dict_attr_t const* attr_sim_op

Definition at line 113 of file base.c.

◆ attr_sim_opc

fr_dict_attr_t const* attr_sim_opc

Definition at line 114 of file base.c.

◆ attr_sim_sqn

fr_dict_attr_t const* attr_sim_sqn

Definition at line 115 of file base.c.

◆ dict_eap_aka_sim

fr_dict_t const* dict_eap_aka_sim

Definition at line 48 of file base.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius

Definition at line 46 of file base.c.

◆ dict_radius

fr_dict_t const* dict_radius

Definition at line 47 of file base.c.

◆ eap_aka_sim_flags

fr_dict_flag_parser_t const eap_aka_sim_flags[]
static
Initial value:
= {
{ L("encrypt"), { .func = dict_flag_encrypt, .needs_value = true} }
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition: build.h:207
static int dict_flag_encrypt(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules)
Definition: base.c:227

Definition at line 248 of file base.c.

◆ enum_eap_type_aka

fr_value_box_t const* enum_eap_type_aka

Definition at line 186 of file base.c.

◆ enum_eap_type_aka_prime

fr_value_box_t const* enum_eap_type_aka_prime

Definition at line 187 of file base.c.

◆ enum_eap_type_sim

fr_value_box_t const* enum_eap_type_sim

Definition at line 185 of file base.c.

◆ enum_kdf_prime_with_ck_prime_ik_prime

fr_value_box_t const* enum_kdf_prime_with_ck_prime_ik_prime

Definition at line 189 of file base.c.

◆ fr_aka_sim_attr_sizes

size_t const fr_aka_sim_attr_sizes[FR_TYPE_MAX+1][2]
Initial value:
= {
[FR_TYPE_NULL] = {~0, 0},
[FR_TYPE_STRING] = {0, ~0},
[FR_TYPE_OCTETS] = {0, ~0},
[FR_TYPE_BOOL] = {2, 2},
[FR_TYPE_UINT8] = {1, 1},
[FR_TYPE_UINT16] = {2, 2},
[FR_TYPE_UINT32] = {4, 4},
[FR_TYPE_UINT64] = {8, 8},
[FR_TYPE_TLV] = {2, ~0},
[FR_TYPE_MAX] = {~0, 0}
}
@ FR_TYPE_TLV
Contains nested attributes.
Definition: merged_model.c:118
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_MAX
Number of defined data types.
Definition: merged_model.c:130
@ FR_TYPE_NULL
Invalid (uninitialised) attribute type.
Definition: merged_model.c:81
@ FR_TYPE_UINT16
16 Bit unsigned integer.
Definition: merged_model.c:98
@ FR_TYPE_UINT8
8 Bit unsigned integer.
Definition: merged_model.c:97
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
@ FR_TYPE_UINT64
64 Bit unsigned integer.
Definition: merged_model.c:100
@ FR_TYPE_BOOL
A truth value.
Definition: merged_model.c:95
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84

SIM AT on-the-wire format attribute sizes.

Holds the min/max sizes of all supported SIM AT attribute values as they would be found in a SIM AT packet.

These sizes may be different than the sizes of INTERNAL formats, PRESENTATION formats and generic NETWORK formats.

Definition at line 210 of file base.c.

◆ instance_count

uint32_t instance_count = 0
static

Definition at line 44 of file base.c.

◆ libfreeradius_aka_sim_dict

fr_dict_autoload_t libfreeradius_aka_sim_dict
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ .out = &dict_radius, .proto = "radius" },
{ .out = &dict_eap_aka_sim, .base_dir = "eap/aka-sim", .proto = "eap-aka-sim" },
{ NULL }
}
fr_dict_t const * dict_freeradius
Definition: base.c:77
fr_dict_t const * dict_radius
Definition: base.c:78
fr_dict_t const * dict_eap_aka_sim
Definition: base.c:48

Definition at line 51 of file base.c.

◆ libfreeradius_aka_sim_dict_attr

fr_dict_attr_autoload_t libfreeradius_aka_sim_dict_attr

Definition at line 118 of file base.c.

◆ libfreeradius_aka_sim_dict_enum

fr_dict_enum_autoload_t libfreeradius_aka_sim_dict_enum
Initial value:
= {
{ .out = &enum_eap_type_sim, .name = "SIM", .attr = &attr_eap_type },
{ .out = &enum_eap_type_aka, .name = "AKA", .attr = &attr_eap_type },
{ .out = &enum_eap_type_aka_prime, .name = "AKA-Prime", .attr = &attr_eap_type },
{ .out = &enum_kdf_prime_with_ck_prime_ik_prime, .name = "Prime-With-CK-Prime-IK-Prime", .attr = &attr_eap_aka_sim_kdf },
{ NULL }
}
fr_dict_attr_t const * attr_eap_type
Definition: base.c:90
fr_dict_attr_t const * attr_eap_aka_sim_kdf
Definition: base.c:81
fr_value_box_t const * enum_kdf_prime_with_ck_prime_ik_prime
Definition: base.c:189
fr_value_box_t const * enum_eap_type_aka
Definition: base.c:186
fr_value_box_t const * enum_eap_type_sim
Definition: base.c:185
fr_value_box_t const * enum_eap_type_aka_prime
Definition: base.c:187

Definition at line 192 of file base.c.

◆ libfreeradius_eap_aka_sim_dict_protocol

fr_dict_protocol_t libfreeradius_eap_aka_sim_dict_protocol
Initial value:
= {
.name = "eap_aka_sim",
.default_type_size = 1,
.default_type_length = 1,
.attr = {
.flags = {
.len = sizeof(fr_aka_sim_attr_flags_t)
}
}
}
#define NUM_ELEMENTS(_t)
Definition: build.h:335
static fr_dict_flag_parser_t const eap_aka_sim_flags[]
Definition: base.c:248

Definition at line 327 of file base.c.