most function is implemeted related Attach Request

Except ATTACH_REQEST integrity check after NAS_Decode
This commit is contained in:
Sukchan Lee 2017-07-28 14:19:43 +09:00
parent 0315c6d109
commit 916d8032dc
7 changed files with 20 additions and 22 deletions

View File

@ -134,7 +134,7 @@ void emm_handle_attach_request(
else
{
/* if Security Context is Existed */
if (!enb_ue->mac_failed)
if (!mme_ue->mac_failed)
{
/* MAC verified */
emm_handle_attach_accept(mme_ue);
@ -189,7 +189,7 @@ void emm_handle_attach_request(
else
{
/* if Security Context is Existed */
if (!enb_ue->mac_failed)
if (!mme_ue->mac_failed)
{
/* MAC verified */
emm_handle_attach_accept(mme_ue);
@ -298,7 +298,7 @@ void emm_handle_identity_response(
else
{
/* if Security Context is Existed */
if (!enb_ue->mac_failed)
if (!mme_ue->mac_failed)
{
/* MAC verified */
emm_handle_attach_accept(mme_ue);
@ -739,7 +739,7 @@ void emm_handle_delete_session_response(mme_bearer_t *bearer)
enb_ue_t *enb_ue = mme_ue->enb_ue;
d_assert(enb_ue, return, "Null param");
if (mme_ue->security_context_available && enb_ue->mac_failed)
if (mme_ue->security_context_available && mme_ue->mac_failed)
{
mme_s6a_send_air(mme_ue);
}
@ -748,7 +748,7 @@ void emm_handle_delete_session_response(mme_bearer_t *bearer)
d_error("invalid security parameter"
"(available:%d, mac_failed:%d)",
mme_ue->security_context_available,
enb_ue->mac_failed);
mme_ue->mac_failed);
}
break;
}

View File

@ -1113,15 +1113,10 @@ mme_ue_t* mme_ue_find_by_message(nas_message_t *message)
guti.mme_code = nas_guti->mme_code;
guti.m_tmsi = nas_guti->m_tmsi;
d_trace(3,"Search mme_ue by GUTI[G:%d,C:%d,M_TMSI:0x%x]\n",
guti.mme_gid,
guti.mme_code,
guti.m_tmsi);
mme_ue = mme_ue_find_by_guti(&guti);
if (mme_ue)
{
d_warn("Known UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]",
d_trace(3, "Known UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]\n",
guti.mme_gid,
guti.mme_code,
guti.m_tmsi);

View File

@ -128,9 +128,6 @@ struct _enb_ue_t {
/* Connected enodeB */
mme_enb_t *enb;
/* Last NAS Authentication state */
int mac_failed;
};
struct _mme_ue_t {
@ -155,8 +152,11 @@ struct _mme_ue_t {
#endif
plmn_id_t visited_plmn_id;
/* Security Context */
/* Security Context Status */
int security_context_available;
int mac_failed; /* Last NAS Authentication state */
/* Security Context Parameter */
nas_ue_network_capability_t ue_network_capability;
nas_ms_network_capability_t ms_network_capability;
c_uint8_t xres[MAX_RES_LEN];

View File

@ -156,7 +156,7 @@ int mme_s6a_send_air(mme_ue_t *mme_ue)
/* Reset Security Parameter */
mme_ue->security_context_available = 0;
enb_ue->mac_failed = 0;
mme_ue->mac_failed = 0;
/* Create the random value to store with the session */
pool_alloc_node(&sess_state_pool, &mi);

View File

@ -19,7 +19,6 @@ static void event_s1ap_to_nas(enb_ue_t *enb_ue, S1ap_NAS_PDU_t *nasPdu)
nas_esm_header_t *h = NULL;
pkbuf_t *nasbuf = NULL;
event_t e;
int mac_failed = 0;
d_assert(enb_ue, return, "Null param");
d_assert(nasPdu, return, "Null param");
@ -32,9 +31,12 @@ static void event_s1ap_to_nas(enb_ue_t *enb_ue, S1ap_NAS_PDU_t *nasPdu)
if (enb_ue->mme_ue)
{
int mac_failed = 0;
d_assert(nas_security_decode(
enb_ue->mme_ue, nasbuf, &mac_failed) == CORE_OK,
pkbuf_free(nasbuf);return, "nas_security_decode failed");
enb_ue->mme_ue->mac_failed = mac_failed;
}
else
{
@ -50,13 +52,12 @@ static void event_s1ap_to_nas(enb_ue_t *enb_ue, S1ap_NAS_PDU_t *nasPdu)
break;
}
default:
mac_failed = 1;
d_warn("Security Protected (securiry header type:0x%x)",
d_warn("Not Implmeneted : "
"Security Protected (securiry header type:0x%x)",
sh->security_header_type);
pkbuf_header(nasbuf, -hsize);
}
}
enb_ue->mac_failed = mac_failed;
h = nasbuf->payload;
d_assert(h, pkbuf_free(nasbuf); return, "Null param");

View File

@ -265,7 +265,9 @@ static void nas_sm_test1(abts_case *tc, void *data)
ABTS_TRUE(tc, memcmp(recvbuf->payload+43, tmp+43, 3) == 0);
pkbuf_free(recvbuf);
/* Send Initial-UE Message */
/*****************************************************************
* Attach Request : GUTI, Integrity Protected
* Send Initial-UE Message + Attach Request + PDN Connectivity */
rv = tests1ap_build_initial_ue_msg(&sendbuf, msgindex+1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);

View File

@ -122,7 +122,7 @@ status_t tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf, int i)
"00004300060000f1 105ba00064400800 00f1101079baf000 86400130",
"000c40809c00"
"0005000800030001 00001a0073721711 a73a12070741020b f600f11000020100"
"0005000800030002 00001a0073721711 a73a12070741020b f600f11000020100"
"00000105e060c040 0100210221d011d1 271a808021100100 0010810600000000"
"830600000000000d 00000a005255f501 10225c0a003103e5 c03e1355f501aaaa"
"11035758a6200b60 1404ef65233b8878 d290400804026004 00021f025d0107e0"