libosmogsm  1.9.2
Osmocom GSM library
milenage.h
Go to the documentation of this file.
1 
4 /*
5  * Copyright (c) 2006-2007 <j@w1.fi>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * Alternatively, this software may be distributed under the terms of BSD
12  * license.
13  *
14  * SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause
15  *
16  * See README and COPYING for more details.
17  */
18 
19 #pragma once
20 
21 void milenage_generate(const u8 *opc, const u8 *amf, const u8 *k,
22  const u8 *sqn, const u8 *_rand, u8 *autn, u8 *ik,
23  u8 *ck, u8 *res, size_t *res_len);
24 int milenage_auts(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts,
25  u8 *sqn);
26 int gsm_milenage(const u8 *opc, const u8 *k, const u8 *_rand, u8 *sres,
27  u8 *kc);
28 int milenage_check(const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand,
29  const u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len,
30  u8 *auts);
31 int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand,
32  const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s);
33 int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand,
34  u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar);
35 
36 int milenage_opc_gen(u8 *opc, const u8 *k, const u8 *op);
milenage_generate
void milenage_generate(const u8 *opc, const u8 *amf, const u8 *k, const u8 *sqn, const u8 *_rand, u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len)
milenage_generate - Generate AKA AUTN,IK,CK,RES @opc: OPc = 128-bit operator variant algorithm config...
Definition: milenage.c:182
sres
uint8_t sres[4]
Definition: gsm_04_08.h:806
milenage_f1
int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s)
milenage_f1 - Milenage f1 and f1* algorithms @opc: OPc = 128-bit value derived from OP and K @k: K = ...
Definition: milenage.c:45
wpa_hexdump
#define wpa_hexdump(x, args...)
Definition: common.h:11
wpa_hexdump_key
#define wpa_hexdump_key(x, args...)
Definition: common.h:12
MSG_DEBUG
#define MSG_DEBUG
Definition: common.h:10
includes.h
milenage_check
int milenage_check(const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand, const u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len, u8 *auts)
milenage_generate - Generate AKA AUTN,IK,CK,RES @opc: OPc = 128-bit operator variant algorithm config...
Definition: milenage.c:272
gsm_milenage
int gsm_milenage(const u8 *opc, const u8 *k, const u8 *_rand, u8 *sres, u8 *kc)
gsm_milenage - Generate GSM-Milenage (3GPP TS 55.205) authentication triplet @opc: OPc = 128-bit oper...
Definition: milenage.c:244
milenage_opc_gen
int milenage_opc_gen(u8 *opc, const u8 *k, const u8 *op)
Definition: milenage.c:327
milenage_auts
int milenage_auts(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts, u8 *sqn)
milenage_auts - Milenage AUTS validation @opc: OPc = 128-bit operator variant algorithm configuration...
Definition: milenage.c:217
milenage_opc_gen
int milenage_opc_gen(u8 *opc, const u8 *k, const u8 *op)
Definition: milenage.c:327
osmo_auth_c2
void osmo_auth_c2(uint8_t sres[4], const uint8_t *res, size_t res_len, uint8_t sres_deriv_func)
Derive GSM SRES from UMTS [X]RES (auth function c2 from 3GPP TS 33.103 Section 6.8....
Definition: auth_core.c:373
wpa_printf
#define wpa_printf(x, args...)
Definition: common.h:13
osmo_auth_c3
void osmo_auth_c3(uint8_t kc[], const uint8_t ck[], const uint8_t ik[])
Definition: auth_core.c:360
os_memcmp
#define os_memcmp(x, y, z)
Definition: common.h:16
milenage_check
int milenage_check(const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand, const u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len, u8 *auts)
milenage_generate - Generate AKA AUTN,IK,CK,RES @opc: OPc = 128-bit operator variant algorithm config...
Definition: milenage.c:272
os_memcpy
#define os_memcpy(x, y, z)
Definition: common.h:15
res
uint8_t res
u8
uint8_t u8
Definition: common.h:27
common.h
gsm_milenage
int gsm_milenage(const u8 *opc, const u8 *k, const u8 *_rand, u8 *sres, u8 *kc)
gsm_milenage - Generate GSM-Milenage (3GPP TS 55.205) authentication triplet @opc: OPc = 128-bit oper...
Definition: milenage.c:244
milenage.h
milenage_f1
int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s)
milenage_f1 - Milenage f1 and f1* algorithms @opc: OPc = 128-bit value derived from OP and K @k: K = ...
Definition: milenage.c:45
milenage_f2345
int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand, u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar)
milenage_f2345 - Milenage f2, f3, f4, f5, f5* algorithms @opc: OPc = 128-bit value derived from OP an...
Definition: milenage.c:97
milenage_f2345
int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand, u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar)
milenage_f2345 - Milenage f2, f3, f4, f5, f5* algorithms @opc: OPc = 128-bit value derived from OP an...
Definition: milenage.c:97
auth.h
milenage_generate
void milenage_generate(const u8 *opc, const u8 *amf, const u8 *k, const u8 *sqn, const u8 *_rand, u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len)
milenage_generate - Generate AKA AUTN,IK,CK,RES @opc: OPc = 128-bit operator variant algorithm config...
Definition: milenage.c:182
aes_wrap.h
aes_128_encrypt_block
int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out)
aes_128_encrypt_block - Perform one AES 128-bit block operation @key: Key for AES @in: Input data (16...
Definition: aes-encblock.c:31
milenage_auts
int milenage_auts(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts, u8 *sqn)
milenage_auts - Milenage AUTS validation @opc: OPc = 128-bit operator variant algorithm configuration...
Definition: milenage.c:217