Commit f02456ca authored by aligungr's avatar aligungr

Security mode command procedure improvement

parent 3c313a65
...@@ -55,7 +55,7 @@ void NasMm::receiveSecurityModeCommand(const nas::SecurityModeCommand &msg) ...@@ -55,7 +55,7 @@ void NasMm::receiveSecurityModeCommand(const nas::SecurityModeCommand &msg)
{ {
if (!hasEmergency()) if (!hasEmergency())
{ {
m_logger->err("IA0 and EA0 cannot be accepted as the UE does not have an emergency"); m_logger->err("[IA0, EA0] cannot be accepted as the UE does not have an emergency");
reject(nas::EMmCause::SEC_MODE_REJECTED_UNSPECIFIED); reject(nas::EMmCause::SEC_MODE_REJECTED_UNSPECIFIED);
return; return;
} }
...@@ -101,9 +101,16 @@ void NasMm::receiveSecurityModeCommand(const nas::SecurityModeCommand &msg) ...@@ -101,9 +101,16 @@ void NasMm::receiveSecurityModeCommand(const nas::SecurityModeCommand &msg)
reject(nas::EMmCause::UE_SECURITY_CAP_MISMATCH); reject(nas::EMmCause::UE_SECURITY_CAP_MISMATCH);
return; return;
} }
if (integrity == nas::ETypeOfIntegrityProtectionAlgorithm::IA0 && !hasEmergency())
{
m_logger->err("[IA0] cannot be accepted as the UE does not have an emergency");
reject(nas::EMmCause::SEC_MODE_REJECTED_UNSPECIFIED);
return;
}
} }
// ============================ Process the security context. ============================ // ============================ Process the security context ============================
// Assign ABBA (if any) // Assign ABBA (if any)
if (msg.abba.has_value()) if (msg.abba.has_value())
...@@ -127,11 +134,6 @@ void NasMm::receiveSecurityModeCommand(const nas::SecurityModeCommand &msg) ...@@ -127,11 +134,6 @@ void NasMm::receiveSecurityModeCommand(const nas::SecurityModeCommand &msg)
nsCtx->uplinkCount.overflow = octet2{0}; nsCtx->uplinkCount.overflow = octet2{0};
} }
if (msg.selectedNasSecurityAlgorithms.integrity != nas::ETypeOfIntegrityProtectionAlgorithm::IA0)
{
// TODO
}
// Set the new NAS Security Context as current one. (If it is not already the current one) // Set the new NAS Security Context as current one. (If it is not already the current one)
if (whichCtx == 1) if (whichCtx == 1)
m_usim->m_currentNsCtx = std::make_unique<NasSecurityContext>(nsCtx->deepCopy()); m_usim->m_currentNsCtx = std::make_unique<NasSecurityContext>(nsCtx->deepCopy());
......
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