nas: delete security context when receiving attach reject with cause 3, 6, or 35

This commit is contained in:
Andre Puschmann 2020-02-26 21:52:47 +01:00
parent 32c347fbb1
commit 5b31c1db43
2 changed files with 13 additions and 1 deletions

View File

@ -692,6 +692,7 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8** ie_ptr, LIBLTE_MME_
#define LIBLTE_MME_EMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED 0x18
#define LIBLTE_MME_EMM_CAUSE_NOT_AUTHORIZED_FOR_THIS_CSG 0x19
#define LIBLTE_MME_EMM_CAUSE_NON_EPS_AUTHENTICATION_UNACCEPTABLE 0x1A
#define LIBLTE_MME_EMM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_AUTHORIZED 0x23
#define LIBLTE_MME_EMM_CAUSE_CS_SERVICE_TEMPORARILY_NOT_AVAILABLE 0x27
#define LIBLTE_MME_EMM_CAUSE_NO_EPS_BEARER_CONTEXT_ACTIVATED 0x28
#define LIBLTE_MME_EMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 0x5F

View File

@ -1119,8 +1119,19 @@ void nas::parse_attach_reject(uint32_t lcid, unique_byte_buffer_t pdu)
t3410.stop();
}
// 5.5.1.2.5
if (attach_rej.emm_cause == LIBLTE_MME_EMM_CAUSE_ILLEGAL_UE ||
attach_rej.emm_cause == LIBLTE_MME_EMM_CAUSE_ILLEGAL_ME ||
attach_rej.emm_cause == LIBLTE_MME_EMM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_AUTHORIZED) {
// delete security context
have_guti = false;
have_ctxt = false;
ctxt = {};
}
// TODO: handle other relevant reject causes
enter_emm_deregistered();
// TODO: Command RRC to release?
}
void nas::parse_authentication_request(uint32_t lcid, unique_byte_buffer_t pdu, const uint8_t sec_hdr_type)