added replayed GRPS security capabilities. Moto G4 sends security mode complete.

master
Pedro Alvarez 7 years ago
parent 9d88d2b78f
commit 0884d35378

@ -19,7 +19,7 @@ mme_group = 0x0001
tac = 0x0001 tac = 0x0001
mcc = 001 mcc = 001
mnc = 01 mnc = 01
mme_bind_addr = 127.0.0.0/24 mme_bind_addr = 127.0.1.100
##################################################################### #####################################################################
# HSS configuration # HSS configuration
@ -40,5 +40,5 @@ db_file = user_db.csv
##################################################################### #####################################################################
[spgw] [spgw]
gtpu_bind_addr=127.0.0.2 gtpu_bind_addr=127.0.1.100
sgi_if_addr=172.0.0.1 sgi_if_addr=172.0.0.1

@ -92,6 +92,8 @@ typedef struct{
eps_security_ctx_t security_ctxt; eps_security_ctx_t security_ctxt;
erab_ctx_t erabs_ctx[MAX_ERABS_PER_UE]; erab_ctx_t erabs_ctx[MAX_ERABS_PER_UE];
LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT ue_network_cap; LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT ue_network_cap;
bool ms_network_cap_present;
LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT ms_network_cap;
} ue_ctx_t; } ue_ctx_t;
}//namespace }//namespace
#endif #endif

@ -369,16 +369,18 @@ s1ap::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *ini
m_s1ap_log->console("Attach request from IMSI: %015lu\n", imsi); m_s1ap_log->console("Attach request from IMSI: %015lu\n", imsi);
m_s1ap_log->info("Attach request from IMSI: %015lu\n", imsi); m_s1ap_log->info("Attach request from IMSI: %015lu\n", imsi);
//Get UE security capabilities //Get UE network capabilities
memcpy(&ue_ctx.ue_network_cap, &attach_req.ue_network_cap, sizeof(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT)); memcpy(&ue_ctx.ue_network_cap, &attach_req.ue_network_cap, sizeof(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT));
ue_ctx.ms_network_cap_present = attach_req.ms_network_cap_present;
if(attach_req.ms_network_cap_present)
{
memcpy(&ue_ctx.ms_network_cap, &attach_req.ms_network_cap, sizeof(LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT));
}
//FIXME use this info //FIXME use this info
uint8_t eps_bearer_id = pdn_con_req.eps_bearer_id; //TODO: Unused uint8_t eps_bearer_id = pdn_con_req.eps_bearer_id; //TODO: Unused
uint8_t proc_transaction_id = pdn_con_req.proc_transaction_id; //TODO: Transaction ID unused uint8_t proc_transaction_id = pdn_con_req.proc_transaction_id; //TODO: Transaction ID unused
m_s1ap_log->console("EPS Bearer id: %d\n", eps_bearer_id); m_s1ap_log->console("EPS Bearer id: %d\n", eps_bearer_id);
//Add eNB info to UE ctxt //Add eNB info to UE ctxt
memcpy(&ue_ctx.enb_sri, enb_sri, sizeof(struct sctp_sndrcvinfo)); memcpy(&ue_ctx.enb_sri, enb_sri, sizeof(struct sctp_sndrcvinfo));

@ -266,7 +266,7 @@ s1ap_nas_transport::pack_security_mode_command(srslte::byte_buffer_t *reply_msg,
sm_cmd.selected_nas_sec_algs.type_of_eia = LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_128_EIA1; sm_cmd.selected_nas_sec_algs.type_of_eia = LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_128_EIA1;
sm_cmd.nas_ksi.tsc_flag=LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE; sm_cmd.nas_ksi.tsc_flag=LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE;
sm_cmd.nas_ksi.nas_ksi=6; //111 no key available sm_cmd.nas_ksi.nas_ksi=0;
//Replay UE security cap //Replay UE security cap
memcpy(sm_cmd.ue_security_cap.eea,ue_ctx->ue_network_cap.eea,8*sizeof(bool)); memcpy(sm_cmd.ue_security_cap.eea,ue_ctx->ue_network_cap.eea,8*sizeof(bool));
@ -275,8 +275,8 @@ s1ap_nas_transport::pack_security_mode_command(srslte::byte_buffer_t *reply_msg,
memcpy(sm_cmd.ue_security_cap.uea,ue_ctx->ue_network_cap.uea,8*sizeof(bool)); memcpy(sm_cmd.ue_security_cap.uea,ue_ctx->ue_network_cap.uea,8*sizeof(bool));
sm_cmd.ue_security_cap.uia_present = ue_ctx->ue_network_cap.uia_present; sm_cmd.ue_security_cap.uia_present = ue_ctx->ue_network_cap.uia_present;
memcpy(sm_cmd.ue_security_cap.uia,ue_ctx->ue_network_cap.uia,8*sizeof(bool)); memcpy(sm_cmd.ue_security_cap.uia,ue_ctx->ue_network_cap.uia,8*sizeof(bool));
sm_cmd.ue_security_cap.gea_present = false; sm_cmd.ue_security_cap.gea_present = ue_ctx->ms_network_cap_present;
//memcpy(sm_cmd.ue_security_cap.gea,ue_ctx->ue_network_cap.gea,8*sizeof(bool)); memcpy(sm_cmd.ue_security_cap.gea,ue_ctx->ms_network_cap.gea,8*sizeof(bool));
/* /*
typedef struct{ typedef struct{
bool eea[8]; bool eea[8];

Loading…
Cancel
Save