Addind replayed UE security capabilities.

master
Pedro Alvarez 7 years ago
parent 9a0b883296
commit 9d88d2b78f

@ -24,6 +24,7 @@
#include "srslte/common/security.h"
#include "srslte/asn1/gtpc_ies.h"
#include "srslte/asn1/liblte_s1ap.h"
#include "srslte/asn1/liblte_mme.h"
#include <netinet/sctp.h>
namespace srsepc{
@ -90,6 +91,7 @@ typedef struct{
struct sctp_sndrcvinfo enb_sri;
eps_security_ctx_t security_ctxt;
erab_ctx_t erabs_ctx[MAX_ERABS_PER_UE];
LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT ue_network_cap;
} ue_ctx_t;
}//namespace
#endif

@ -369,11 +369,16 @@ 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->info("Attach request from IMSI: %015lu\n", imsi);
//Get UE security capabilities
memcpy(&ue_ctx.ue_network_cap, &attach_req.ue_network_cap, sizeof(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT));
//FIXME use this info
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
m_s1ap_log->console("EPS Bearer id: %d\n", eps_bearer_id);
//Add eNB info to UE ctxt
memcpy(&ue_ctx.enb_sri, enb_sri, sizeof(struct sctp_sndrcvinfo));

@ -266,11 +266,29 @@ 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.nas_ksi.tsc_flag=LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE;
sm_cmd.nas_ksi.nas_ksi=0;
//FIXME UE security cap not used by srsUE.
//sm_cmd.ue_security_cap;
sm_cmd.nas_ksi.nas_ksi=6; //111 no key available
//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.eia,ue_ctx->ue_network_cap.eia,8*sizeof(bool));
sm_cmd.ue_security_cap.uea_present = ue_ctx->ue_network_cap.uea_present;
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;
memcpy(sm_cmd.ue_security_cap.uia,ue_ctx->ue_network_cap.uia,8*sizeof(bool));
sm_cmd.ue_security_cap.gea_present = false;
//memcpy(sm_cmd.ue_security_cap.gea,ue_ctx->ue_network_cap.gea,8*sizeof(bool));
/*
typedef struct{
bool eea[8];
bool eia[8];
bool uea[8];
bool uea_present;
bool uia[8];
bool uia_present;
bool gea[8];
bool gea_present;
}LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT;
*/
sm_cmd.imeisv_req_present=false;
sm_cmd.nonce_ue_present=false;
sm_cmd.nonce_mme_present=false;

Loading…
Cancel
Save