libosmogsm 0.9.6-23.20170220git32ee5af8.fc42
Osmocom GSM library
Loading...
Searching...
No Matches
Auth

Functions

static LLIST_HEAD (osmo_auths)
 
int osmo_auth_register (struct osmo_auth_impl *impl)
 Register an authentication algorithm implementation with the core.
 
int osmo_auth_load (const char *path)
 Load all available authentication plugins from the given path.
 
int osmo_auth_supported (enum osmo_auth_algo algo)
 Determine if a given authentication algorithm is supported.
 
static void c5_function (uint8_t *ik, const uint8_t *kc)
 
void osmo_c4 (uint8_t *ck, const uint8_t *kc)
 
int osmo_auth_3g_from_2g (struct osmo_auth_vector *vec)
 Generate 3G CK + IK from 2G authentication vector.
 
int osmo_auth_gen_vec (struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand)
 Generate authentication vector.
 
int osmo_auth_gen_vec_auts (struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *auts, const uint8_t *rand_auts, const uint8_t *_rand)
 Generate authentication vector and re-sync sequence.
 
const char * osmo_auth_alg_name (enum osmo_auth_algo alg)
 Get human-readable name of authentication algorithm.
 
enum osmo_auth_algo osmo_auth_alg_parse (const char *name)
 Parse human-readable name of authentication algorithm.
 

Variables

static struct osmo_auth_impl * selected_auths [_OSMO_AUTH_ALG_NUM]
 
static const struct value_string auth_alg_vals []
 

Detailed Description

Function Documentation

◆ osmo_auth_3g_from_2g()

int osmo_auth_3g_from_2g ( struct osmo_auth_vector * vec)

Generate 3G CK + IK from 2G authentication vector.

Parameters
vecAuthentication Vector to be modified
Returns
1 if the vector was changed, 0 otherwise

This function performs the C5 and C4 functions to derive the UMTS key material from the GSM key material in the supplied vector, if the input vector doesn't yet have UMTS authentication capability.

◆ osmo_auth_gen_vec()

int osmo_auth_gen_vec ( struct osmo_auth_vector * vec,
struct osmo_sub_auth_data * aud,
const uint8_t * _rand )

Generate authentication vector.

Parameters
[out]vecGenerated authentication vector
[in]audSubscriber-specific key material
[in]_randRandom challenge to be used
Returns
0 on success, negative error on failure

This function performs the core cryptographic function of the AUC, computing authentication triples/quintuples based on the permanent subscriber data and a random value. The result is what is forwarded by the AUC via HLR and VLR to the MSC which will then be able to invoke authentication with the MS

◆ osmo_auth_gen_vec_auts()

int osmo_auth_gen_vec_auts ( struct osmo_auth_vector * vec,
struct osmo_sub_auth_data * aud,
const uint8_t * auts,
const uint8_t * rand_auts,
const uint8_t * _rand )

Generate authentication vector and re-sync sequence.

Parameters
[out]vecGenerated authentication vector
[in]audSubscriber-specific key material
[in]autsAUTS value sent by the SIM/MS
[in]rand_autsRAND value sent by the SIM/MS
[in]_randRandom challenge to be used to generate vector
Returns
0 on success, negative error on failure

This function performs a special variant of the core cryptographic function of the AUC: computing authentication triples/quintuples based on the permanent subscriber data, a random value as well as the AUTS and RAND values returned by the SIM/MS. This special variant is needed if the sequence numbers between MS and AUC have for some reason become diffrent.

◆ osmo_auth_load()

int osmo_auth_load ( const char * path)

Load all available authentication plugins from the given path.

Parameters
[in]pathPath name of the directory containing the plugins
Returns
number of plugins loaded in case of success, negative in case of error

This function will load all plugins contained in the specified path.

◆ osmo_auth_register()

int osmo_auth_register ( struct osmo_auth_impl * impl)

Register an authentication algorithm implementation with the core.

Parameters
[in]implStructure describing implementation and it's callbacks
Returns
0 on success, or a negative error code on failure

This function is called by an authentication implementation plugin to register itself with the authentication core.

◆ osmo_auth_supported()

int osmo_auth_supported ( enum osmo_auth_algo algo)

Determine if a given authentication algorithm is supported.

Parameters
[in]algoAlgorithm which should be checked
Returns
1 if algo is supported, 0 if not, negative error on failure

This function is used by an application to determine at runtime if a given authentication algorithm is supported or not.

Variable Documentation

◆ auth_alg_vals

const struct value_string auth_alg_vals[]
static
Initial value:
= {
{ OSMO_AUTH_ALG_NONE, "None" },
{ OSMO_AUTH_ALG_COMP128v1, "COMP128v1" },
{ OSMO_AUTH_ALG_COMP128v2, "COMP128v2" },
{ OSMO_AUTH_ALG_COMP128v3, "COMP128v3" },
{ OSMO_AUTH_ALG_XOR, "XOR" },
{ OSMO_AUTH_ALG_MILENAGE, "MILENAGE" },
{ 0, NULL }
}