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
216e3f0b
Commit
216e3f0b
authored
Apr 26, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE authentication procedure improvements
parent
eca3b993
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
src/ue/nas/usim/sqn_mng.cpp
src/ue/nas/usim/sqn_mng.cpp
+13
-3
src/ue/nas/usim/sqn_mng.hpp
src/ue/nas/usim/sqn_mng.hpp
+3
-2
No files found.
src/ue/nas/usim/sqn_mng.cpp
View file @
216e3f0b
...
@@ -18,6 +18,8 @@ SqnManager::SqnManager(uint64_t indBitLen, uint64_t wrappingDelta)
...
@@ -18,6 +18,8 @@ SqnManager::SqnManager(uint64_t indBitLen, uint64_t wrappingDelta)
{
{
if
(
m_indBitLen
<
2
||
m_indBitLen
>
16
)
if
(
m_indBitLen
<
2
||
m_indBitLen
>
16
)
throw
std
::
runtime_error
(
"bad indBitLen"
);
throw
std
::
runtime_error
(
"bad indBitLen"
);
m_sqnArr
[
0
]
=
0xFFFFFFFFFFFFULL
;
}
}
uint64_t
SqnManager
::
getSeqFromSqn
(
uint64_t
sqn
)
const
uint64_t
SqnManager
::
getSeqFromSqn
(
uint64_t
sqn
)
const
...
@@ -35,10 +37,15 @@ uint64_t SqnManager::getIndFromSqn(uint64_t sqn) const
...
@@ -35,10 +37,15 @@ uint64_t SqnManager::getIndFromSqn(uint64_t sqn) const
uint64_t
SqnManager
::
getSeqMs
()
const
uint64_t
SqnManager
::
getSeqMs
()
const
{
{
return
getSeqFromSqn
(
getSqnUL
());
return
getSeqFromSqn
(
getSqnValue
());
}
uint64_t
&
SqnManager
::
getSqnRef
()
{
return
*
std
::
max_element
(
m_sqnArr
.
begin
(),
m_sqnArr
.
end
());
}
}
uint64_t
SqnManager
::
getSqn
UL
()
const
uint64_t
SqnManager
::
getSqn
Value
()
const
{
{
return
*
std
::
max_element
(
m_sqnArr
.
begin
(),
m_sqnArr
.
end
());
return
*
std
::
max_element
(
m_sqnArr
.
begin
(),
m_sqnArr
.
end
());
}
}
...
@@ -49,7 +56,10 @@ bool SqnManager::checkSqn(uint64_t sqn)
...
@@ -49,7 +56,10 @@ bool SqnManager::checkSqn(uint64_t sqn)
uint64_t
ind
=
getIndFromSqn
(
sqn
);
uint64_t
ind
=
getIndFromSqn
(
sqn
);
if
(
seq
-
getSeqMs
()
>
m_wrappingDelta
)
if
(
seq
-
getSeqMs
()
>
m_wrappingDelta
)
{
getSqnRef
()
-=
m_wrappingDelta
;
return
false
;
return
false
;
}
if
(
seq
<=
getSeqFromSqn
(
m_sqnArr
[
ind
]))
if
(
seq
<=
getSeqFromSqn
(
m_sqnArr
[
ind
]))
return
false
;
return
false
;
...
@@ -67,7 +77,7 @@ bool SqnManager::checkSqn(const OctetString &sqn)
...
@@ -67,7 +77,7 @@ bool SqnManager::checkSqn(const OctetString &sqn)
OctetString
SqnManager
::
getSqn
()
const
OctetString
SqnManager
::
getSqn
()
const
{
{
return
OctetString
::
FromOctet8
(
getSqn
UL
()).
subCopy
(
2
);
return
OctetString
::
FromOctet8
(
getSqn
Value
()).
subCopy
(
2
);
}
}
}
// namespace nr::ue
}
// namespace nr::ue
src/ue/nas/usim/sqn_mng.hpp
View file @
216e3f0b
...
@@ -32,11 +32,12 @@ class SqnManager
...
@@ -32,11 +32,12 @@ class SqnManager
[[
nodiscard
]]
uint64_t
getSeqFromSqn
(
uint64_t
sqn
)
const
;
[[
nodiscard
]]
uint64_t
getSeqFromSqn
(
uint64_t
sqn
)
const
;
[[
nodiscard
]]
uint64_t
getIndFromSqn
(
uint64_t
sqn
)
const
;
[[
nodiscard
]]
uint64_t
getIndFromSqn
(
uint64_t
sqn
)
const
;
[[
nodiscard
]]
uint64_t
getSeqMs
()
const
;
[[
nodiscard
]]
uint64_t
getSeqMs
()
const
;
[[
nodiscard
]]
uint64_t
&
getSqnRef
();
[[
nodiscard
]]
uint64_t
getSqnValue
()
const
;
bool
checkSqn
(
uint64_t
sqn
);
public:
public:
[[
nodiscard
]]
uint64_t
getSqnUL
()
const
;
[[
nodiscard
]]
OctetString
getSqn
()
const
;
[[
nodiscard
]]
OctetString
getSqn
()
const
;
bool
checkSqn
(
uint64_t
sqn
);
bool
checkSqn
(
const
OctetString
&
sqn
);
bool
checkSqn
(
const
OctetString
&
sqn
);
};
};
...
...
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