Commit e35401ef authored by Robert Schmidt's avatar Robert Schmidt

NAS refactor: no moduleID, group UICC and security in one context

parent 223fd28b
......@@ -1372,7 +1372,8 @@ static void rrc_ue_generate_RRCSetupComplete(
if (get_softmodem_params()->sa) {
as_nas_info_t initialNasMsg;
generateRegistrationRequest(&initialNasMsg, ctxt_pP->module_id);
nr_ue_nas_t *nas = get_ue_nas_info(ctxt_pP->module_id);
generateRegistrationRequest(&initialNasMsg, nas);
nas_msg = (char*)initialNasMsg.data;
nas_msg_length = initialNasMsg.length;
} else {
......
......@@ -371,7 +371,7 @@ typedef struct {
#define STATIC_ASSERT(test_for_true) _Static_assert((test_for_true), "(" #test_for_true ") failed")
#define myCalloc(var, type) type * var=(type*)calloc(sizeof(type),1);
#define arrayCpy(tO, FroM) STATIC_ASSERT(sizeof(tO) == sizeof(FroM)) ; memcpy(tO, FroM, sizeof(tO))
int resToresStar(uint8_t *msg, uicc_t* uicc);
int resToresStar(uint8_t *msg, const uicc_t* uicc);
int identityResponse(void **msg, nr_user_nas_t *UE);
int authenticationResponse(void **msg, nr_user_nas_t *UE);
......
......@@ -39,7 +39,7 @@ void servingNetworkName(uint8_t *msg, char * imsiStr, int nmc_size) {
memcpy(msg+13, imsiStr, 3);
}
int resToresStar(uint8_t *msg, uicc_t* uicc) {
int resToresStar(uint8_t *msg, const uicc_t* uicc) {
// TS 33.220 annex B.2 => FC=0x6B in TS 33.501 annex A.4
//input S to KDF
uint8_t S[128]= {0};
......
This diff is collapsed.
......@@ -39,6 +39,7 @@
#include "RegistrationComplete.h"
#include "as_message.h"
#include "FGSUplinkNasTransport.h"
#include <openair3/UICC/usim_interface.h>
#define PLAIN_5GS_MSG 0b0000
#define INTEGRITY_PROTECTED 0b0001
......@@ -80,6 +81,11 @@ typedef struct {
uint8_t kgnb[32];
} ue_sa_security_key_t;
typedef struct {
uicc_t *uicc;
ue_sa_security_key_t security;
} nr_ue_nas_t;
typedef enum fgs_protocol_discriminator_e {
/* Protocol discriminator identifier for 5GS Mobility Management */
FGS_MOBILITY_MANAGEMENT_MESSAGE = 0x7E,
......@@ -158,7 +164,8 @@ typedef struct {
fgs_sm_nas_msg_header_t sm_nas_msg_header;
} dl_nas_transport_t;
void generateRegistrationRequest(as_nas_info_t *initialNasMsg, int Mod_id);
nr_ue_nas_t *get_ue_nas_info(module_id_t module_id);
void generateRegistrationRequest(as_nas_info_t *initialNasMsg, nr_ue_nas_t *nas);
void *nas_nrue_task(void *args_p);
#endif /* __NR_NAS_MSG_SIM_H__*/
......
......@@ -116,9 +116,8 @@ uicc_t * checkUicc(int Mod_id) {
return (uicc_t*) uiccArray[Mod_id];
}
uint8_t getImeisvDigit(int Mod_id,uint8_t i)
uint8_t getImeisvDigit(const uicc_t *uicc, uint8_t i)
{
uicc_t * uicc=checkUicc(Mod_id);
uint8_t r = 0;
uint8_t l = strlen(uicc->imeisvStr);
if (l > IMEISV_STR_MAX_LENGTH) {
......
......@@ -73,6 +73,5 @@ typedef struct {
uicc_t *checkUicc(int Mod_id);
uicc_t *init_uicc(char *sectionName);
void uicc_milenage_generate(uint8_t * autn, uicc_t *uicc);
uicc_t * checkUicc(int Mod_id);
uint8_t getImeisvDigit(int Mod_id,uint8_t i);
uint8_t getImeisvDigit(const uicc_t *uicc, uint8_t i);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment