Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
81e07ec9
Commit
81e07ec9
authored
Jun 19, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NAS Count handling in case of an RRC establishment failure
parent
34cc91e9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
10 deletions
+44
-10
src/ue/nas/mm/radio.cpp
src/ue/nas/mm/radio.cpp
+27
-10
src/ue/types.hpp
src/ue/types.hpp
+17
-0
No files found.
src/ue/nas/mm/radio.cpp
View file @
81e07ec9
...
...
@@ -216,13 +216,29 @@ void NasMm::handleRrcConnectionRelease()
void
NasMm
::
handleRrcEstablishmentFailure
()
{
// TODO
m_logger
->
err
(
"RRC Establishment failure"
);
/* Handle NAS count */
{
// "After each new or retransmitted outbound SECURITY PROTECTED 5GS NAS MESSAGE message, the sender shall
// increase the NAS COUNT number by one, except for the initial NAS messages if the lower layers indicated the
// failure to establish the RRC connection"
bool
hasNsCtx
=
m_usim
->
m_currentNsCtx
&&
(
m_usim
->
m_currentNsCtx
->
integrity
!=
nas
::
ETypeOfIntegrityProtectionAlgorithm
::
IA0
||
m_usim
->
m_currentNsCtx
->
ciphering
!=
nas
::
ETypeOfCipheringAlgorithm
::
EA0
);
if
(
hasNsCtx
&&
m_usim
->
m_currentNsCtx
->
uplinkCount
.
sqn
!=
0
&&
m_usim
->
m_currentNsCtx
->
uplinkCount
.
overflow
.
operator
int
()
!=
0
)
{
m_usim
->
m_currentNsCtx
->
rollbackCountOnEncrypt
();
}
}
/* Handle MM state changes */
{
if
(
m_mmState
==
EMmState
::
MM_REGISTERED_INITIATED
)
{
switchMmState
(
m_rmState
==
ERmState
::
RM_REGISTERED
?
EMmSubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
switchMmState
(
m_rmState
==
ERmState
::
RM_REGISTERED
?
EMmSubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
:
EMmSubState
::
MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED
);
}
else
if
(
m_mmState
==
EMmState
::
MM_SERVICE_REQUEST_INITIATED
)
...
...
@@ -232,6 +248,7 @@ void NasMm::handleRrcEstablishmentFailure()
else
if
(
m_mmState
==
EMmState
::
MM_DEREGISTERED_INITIATED
)
{
}
}
}
void
NasMm
::
handleRadioLinkFailure
()
...
...
src/ue/types.hpp
View file @
81e07ec9
...
...
@@ -446,6 +446,23 @@ struct NasSecurityContext
uplinkCount
.
overflow
=
octet2
(((
int
)
uplinkCount
.
overflow
+
1
)
&
0xFFFF
);
}
void
rollbackCountOnEncrypt
()
{
if
(
uplinkCount
.
sqn
==
0
)
{
uplinkCount
.
sqn
=
0xFF
;
if
((
int
)
uplinkCount
.
overflow
==
0
)
uplinkCount
.
overflow
=
octet2
{
0xFFFF
};
else
uplinkCount
.
overflow
=
octet2
{(
int
)
uplinkCount
.
overflow
-
1
};
}
else
{
uplinkCount
.
sqn
=
static_cast
<
uint8_t
>
(((
int
)
uplinkCount
.
sqn
-
1
)
&
0xFF
);
}
}
[[
nodiscard
]]
NasSecurityContext
deepCopy
()
const
{
NasSecurityContext
ctx
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment