|
|
@ -42,12 +42,10 @@
|
|
|
|
DEFINES
|
|
|
|
DEFINES
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
/*******************************************************************************
|
|
|
|
TYPEDEFS
|
|
|
|
TYPEDEFS
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
/*******************************************************************************
|
|
|
|
DECLARATIONS
|
|
|
|
DECLARATIONS
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
@ -59,9 +57,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
Document Reference: 35.206 v10.0.0 Annex 3
|
|
|
|
Document Reference: 35.206 v10.0.0 Annex 3
|
|
|
|
*********************************************************************/
|
|
|
|
*********************************************************************/
|
|
|
|
LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_compute_opc(uint8* k, uint8* op, uint8* op_c);
|
|
|
|
uint8 *op,
|
|
|
|
|
|
|
|
uint8 *op_c);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_generate_k_asme
|
|
|
|
Name: liblte_security_generate_k_asme
|
|
|
@ -74,13 +70,8 @@ LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k,
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_asme(uint8 *ck,
|
|
|
|
LIBLTE_ERROR_ENUM
|
|
|
|
uint8 *ik,
|
|
|
|
liblte_security_generate_k_asme(uint8* ck, uint8* ik, uint8* ak, uint8* sqn, uint16 mcc, uint16 mnc, uint8* k_asme);
|
|
|
|
uint8 *ak,
|
|
|
|
|
|
|
|
uint8 *sqn,
|
|
|
|
|
|
|
|
uint16 mcc,
|
|
|
|
|
|
|
|
uint16 mnc,
|
|
|
|
|
|
|
|
uint8 *k_asme);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_generate_k_enb
|
|
|
|
Name: liblte_security_generate_k_enb
|
|
|
@ -93,18 +84,11 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_asme(uint8 *ck,
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8 *k_asme,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8* k_asme, uint32 nas_count, uint8* k_enb);
|
|
|
|
uint32 nas_count,
|
|
|
|
|
|
|
|
uint8 *k_enb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_enb_star(uint8 *k_enb,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_enb_star(uint8* k_enb, uint32 pci, uint32_t earfcn, uint8* k_enb_star);
|
|
|
|
uint32 pci,
|
|
|
|
|
|
|
|
uint32_t earfcn,
|
|
|
|
|
|
|
|
uint8 *k_enb_star);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_nh( uint8_t *k_asme,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_nh(uint8_t* k_asme, uint8_t* sync, uint8_t* nh);
|
|
|
|
uint8_t *sync,
|
|
|
|
|
|
|
|
uint8_t *nh);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_generate_k_nas
|
|
|
|
Name: liblte_security_generate_k_nas
|
|
|
@ -121,18 +105,16 @@ typedef enum{
|
|
|
|
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA2,
|
|
|
|
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA2,
|
|
|
|
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS,
|
|
|
|
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS,
|
|
|
|
} LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM;
|
|
|
|
} LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM;
|
|
|
|
static const char liblte_security_ciphering_algorithm_id_text[LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS][20] = {"EEA0",
|
|
|
|
static const char liblte_security_ciphering_algorithm_id_text[LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS][20] = {
|
|
|
|
"128-EEA1",
|
|
|
|
"EEA0", "128-EEA1", "128-EEA2"};
|
|
|
|
"128-EEA2"};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
typedef enum {
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0 = 0,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0 = 0,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA1,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA1,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA2,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA2,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS,
|
|
|
|
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS,
|
|
|
|
} LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM;
|
|
|
|
} LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM;
|
|
|
|
static const char liblte_security_integrity_algorithm_id_text[LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = {"EIA0",
|
|
|
|
static const char liblte_security_integrity_algorithm_id_text[LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = {
|
|
|
|
"128-EIA1",
|
|
|
|
"EIA0", "128-EIA1", "128-EIA2"};
|
|
|
|
"128-EIA2"};
|
|
|
|
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8* k_asme,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8* k_asme,
|
|
|
@ -141,8 +123,6 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8
|
|
|
|
uint8* k_nas_enc,
|
|
|
|
uint8* k_nas_enc,
|
|
|
|
uint8* k_nas_int);
|
|
|
|
uint8* k_nas_int);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_generate_k_rrc
|
|
|
|
Name: liblte_security_generate_k_rrc
|
|
|
|
|
|
|
|
|
|
|
@ -193,19 +173,10 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_128_eia2(
|
|
|
|
uint32 count,
|
|
|
|
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* mac);
|
|
|
|
uint8 bearer,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_128_eia2(
|
|
|
|
uint8 direction,
|
|
|
|
uint8* key, uint32 count, uint8 bearer, uint8 direction, LIBLTE_BIT_MSG_STRUCT* msg, uint8* mac);
|
|
|
|
uint8 *msg,
|
|
|
|
|
|
|
|
uint32 msg_len,
|
|
|
|
|
|
|
|
uint8 *mac);
|
|
|
|
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key,
|
|
|
|
|
|
|
|
uint32 count,
|
|
|
|
|
|
|
|
uint8 bearer,
|
|
|
|
|
|
|
|
uint8 direction,
|
|
|
|
|
|
|
|
LIBLTE_BIT_MSG_STRUCT *msg,
|
|
|
|
|
|
|
|
uint8 *mac);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_encryption_eea1
|
|
|
|
Name: liblte_security_encryption_eea1
|
|
|
@ -217,13 +188,8 @@ LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key,
|
|
|
|
Specification of the 3GPP Confidentiality and
|
|
|
|
Specification of the 3GPP Confidentiality and
|
|
|
|
Integrity Algorithms UEA2 & UIA2 D1 v2.1
|
|
|
|
Integrity Algorithms UEA2 & UIA2 D1 v2.1
|
|
|
|
*********************************************************************/
|
|
|
|
*********************************************************************/
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8 *key,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(
|
|
|
|
uint32 count,
|
|
|
|
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out);
|
|
|
|
uint8 bearer,
|
|
|
|
|
|
|
|
uint8 direction,
|
|
|
|
|
|
|
|
uint8 *msg,
|
|
|
|
|
|
|
|
uint32 msg_len,
|
|
|
|
|
|
|
|
uint8 *out);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_decryption_eea1
|
|
|
|
Name: liblte_security_decryption_eea1
|
|
|
@ -235,13 +201,8 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8 *key,
|
|
|
|
Specification of the 3GPP Confidentiality and
|
|
|
|
Specification of the 3GPP Confidentiality and
|
|
|
|
Integrity Algorithms UEA2 & UIA2 D1 v2.1
|
|
|
|
Integrity Algorithms UEA2 & UIA2 D1 v2.1
|
|
|
|
*********************************************************************/
|
|
|
|
*********************************************************************/
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8 *key,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(
|
|
|
|
uint32 count,
|
|
|
|
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out);
|
|
|
|
uint8 bearer,
|
|
|
|
|
|
|
|
uint8 direction,
|
|
|
|
|
|
|
|
uint8 *ct,
|
|
|
|
|
|
|
|
uint32 ct_len,
|
|
|
|
|
|
|
|
uint8 *out);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_encryption_eea2
|
|
|
|
Name: liblte_security_encryption_eea2
|
|
|
@ -250,13 +211,8 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8 *key,
|
|
|
|
|
|
|
|
|
|
|
|
Document Reference: 33.401 v13.1.0 Annex B.1.3
|
|
|
|
Document Reference: 33.401 v13.1.0 Annex B.1.3
|
|
|
|
*********************************************************************/
|
|
|
|
*********************************************************************/
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8 *key,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(
|
|
|
|
uint32 count,
|
|
|
|
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out);
|
|
|
|
uint8 bearer,
|
|
|
|
|
|
|
|
uint8 direction,
|
|
|
|
|
|
|
|
uint8 *msg,
|
|
|
|
|
|
|
|
uint32 msg_len,
|
|
|
|
|
|
|
|
uint8 *out);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_decryption_eea2
|
|
|
|
Name: liblte_security_decryption_eea2
|
|
|
@ -265,14 +221,8 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8 *key,
|
|
|
|
|
|
|
|
|
|
|
|
Document Reference: 33.401 v13.1.0 Annex B.1.3
|
|
|
|
Document Reference: 33.401 v13.1.0 Annex B.1.3
|
|
|
|
*********************************************************************/
|
|
|
|
*********************************************************************/
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8 *key,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(
|
|
|
|
uint32 count,
|
|
|
|
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out);
|
|
|
|
uint8 bearer,
|
|
|
|
|
|
|
|
uint8 direction,
|
|
|
|
|
|
|
|
uint8 *ct,
|
|
|
|
|
|
|
|
uint32 ct_len,
|
|
|
|
|
|
|
|
uint8 *out);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_milenage_f1
|
|
|
|
Name: liblte_security_milenage_f1
|
|
|
@ -288,12 +238,7 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8 *key,
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8 *k,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8* k, uint8* op, uint8* rand, uint8* sqn, uint8* amf, uint8* mac_a);
|
|
|
|
uint8 *op,
|
|
|
|
|
|
|
|
uint8 *rand,
|
|
|
|
|
|
|
|
uint8 *sqn,
|
|
|
|
|
|
|
|
uint8 *amf,
|
|
|
|
|
|
|
|
uint8 *mac_a);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_milenage_f1_star
|
|
|
|
Name: liblte_security_milenage_f1_star
|
|
|
@ -309,12 +254,8 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8 *k,
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_milenage_f1_star(uint8 *k,
|
|
|
|
LIBLTE_ERROR_ENUM
|
|
|
|
uint8 *op,
|
|
|
|
liblte_security_milenage_f1_star(uint8* k, uint8* op, uint8* rand, uint8* sqn, uint8* amf, uint8* mac_s);
|
|
|
|
uint8 *rand,
|
|
|
|
|
|
|
|
uint8 *sqn,
|
|
|
|
|
|
|
|
uint8 *amf,
|
|
|
|
|
|
|
|
uint8 *mac_s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_milenage_f2345
|
|
|
|
Name: liblte_security_milenage_f2345
|
|
|
@ -330,13 +271,8 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f1_star(uint8 *k,
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_milenage_f2345(uint8 *k,
|
|
|
|
LIBLTE_ERROR_ENUM
|
|
|
|
uint8 *op,
|
|
|
|
liblte_security_milenage_f2345(uint8* k, uint8* op, uint8* rand, uint8* res, uint8* ck, uint8* ik, uint8* ak);
|
|
|
|
uint8 *rand,
|
|
|
|
|
|
|
|
uint8 *res,
|
|
|
|
|
|
|
|
uint8 *ck,
|
|
|
|
|
|
|
|
uint8 *ik,
|
|
|
|
|
|
|
|
uint8 *ak);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
/*********************************************************************
|
|
|
|
Name: liblte_security_milenage_f5_star
|
|
|
|
Name: liblte_security_milenage_f5_star
|
|
|
@ -351,9 +287,6 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f2345(uint8 *k,
|
|
|
|
// Enums
|
|
|
|
// Enums
|
|
|
|
// Structs
|
|
|
|
// Structs
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8 *k,
|
|
|
|
LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8* k, uint8* op, uint8* rand, uint8* ak);
|
|
|
|
uint8 *op,
|
|
|
|
|
|
|
|
uint8 *rand,
|
|
|
|
|
|
|
|
uint8 *ak);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SRSLTE_LIBLTE_SECURITY_H
|
|
|
|
#endif // SRSLTE_LIBLTE_SECURITY_H
|
|
|
|