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
96407574
Commit
96407574
authored
May 19, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
07ed4cbf
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
23 deletions
+29
-23
src/ue/nas/mm/access.cpp
src/ue/nas/mm/access.cpp
+4
-3
src/ue/nas/mm/auth.cpp
src/ue/nas/mm/auth.cpp
+10
-10
src/ue/nas/mm/dereg.cpp
src/ue/nas/mm/dereg.cpp
+2
-1
src/ue/nas/mm/radio.cpp
src/ue/nas/mm/radio.cpp
+0
-2
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+4
-4
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+1
-1
src/ue/nas/usim/usim.hpp
src/ue/nas/usim/usim.hpp
+0
-1
src/ue/types.cpp
src/ue/types.cpp
+5
-0
src/ue/types.hpp
src/ue/types.hpp
+3
-1
No files found.
src/ue/nas/mm/access.cpp
View file @
96407574
...
...
@@ -47,10 +47,11 @@ bool NasMm::isInNonAllowedArea()
{
if
(
!
m_usim
->
isValid
())
return
false
;
if
(
!
m_usim
->
m_currentPlmn
.
has_value
())
return
false
;
auto
&
plmn
=
*
m_usim
->
m_currentPlmn
;
auto
plmn
=
m_base
->
shCtx
.
getCurrentPlmn
();
if
(
!
plmn
.
hasValue
())
return
false
;
if
(
nas
::
utils
::
ServiceAreaListForbidsPlmn
(
m_storage
->
m_serviceAreaList
->
get
(),
nas
::
utils
::
PlmnFrom
(
plmn
)))
return
true
;
...
...
src/ue/nas/mm/auth.cpp
View file @
96407574
...
...
@@ -16,7 +16,7 @@ namespace nr::ue
void
NasMm
::
receiveAuthenticationRequest
(
const
nas
::
AuthenticationRequest
&
msg
)
{
m_logger
->
debug
(
"Authentication Request received
.
"
);
m_logger
->
debug
(
"Authentication Request received"
);
if
(
!
m_usim
->
isValid
())
{
...
...
@@ -111,7 +111,7 @@ void NasMm::receiveAuthenticationRequestEap(const nas::AuthenticationRequest &ms
return
;
}
auto
snn
=
keys
::
ConstructServingNetworkName
(
*
m_usim
->
m_currentPlmn
);
auto
snn
=
keys
::
ConstructServingNetworkName
(
m_base
->
shCtx
.
getCurrentPlmn
()
);
if
(
receivedEap
.
attributes
.
getKdfInput
()
!=
OctetString
::
FromAscii
(
snn
))
{
...
...
@@ -196,7 +196,7 @@ void NasMm::receiveAuthenticationRequestEap(const nas::AuthenticationRequest &ms
m_usim
->
m_nonCurrentNsCtx
->
keys
.
kAusf
=
keys
::
CalculateKAusfFor5gAka
(
milenage
.
ck
,
milenage
.
ik
,
snn
,
sqnXorAk
);
m_usim
->
m_nonCurrentNsCtx
->
keys
.
abba
=
msg
.
abba
.
rawData
.
copy
();
keys
::
DeriveKeysSeafAmf
(
*
m_base
->
config
,
*
m_usim
->
m_currentPlmn
,
*
m_usim
->
m_nonCurrentNsCtx
);
keys
::
DeriveKeysSeafAmf
(
*
m_base
->
config
,
m_base
->
shCtx
.
getCurrentPlmn
()
,
*
m_usim
->
m_nonCurrentNsCtx
);
// Send response
m_nwConsecutiveAuthFailure
=
0
;
...
...
@@ -346,7 +346,7 @@ void NasMm::receiveAuthenticationRequest5gAka(const nas::AuthenticationRequest &
auto
milenage
=
calculateMilenage
(
m_usim
->
m_sqnMng
->
getSqn
(),
rand
,
false
);
auto
ckIk
=
OctetString
::
Concat
(
milenage
.
ck
,
milenage
.
ik
);
auto
sqnXorAk
=
OctetString
::
Xor
(
m_usim
->
m_sqnMng
->
getSqn
(),
milenage
.
ak
);
auto
snn
=
keys
::
ConstructServingNetworkName
(
*
m_usim
->
m_currentPlmn
);
auto
snn
=
keys
::
ConstructServingNetworkName
(
m_base
->
shCtx
.
getCurrentPlmn
()
);
// Store the relevant parameters
m_usim
->
m_rand
=
rand
.
copy
();
...
...
@@ -359,7 +359,7 @@ void NasMm::receiveAuthenticationRequest5gAka(const nas::AuthenticationRequest &
m_usim
->
m_nonCurrentNsCtx
->
keys
.
kAusf
=
keys
::
CalculateKAusfFor5gAka
(
milenage
.
ck
,
milenage
.
ik
,
snn
,
sqnXorAk
);
m_usim
->
m_nonCurrentNsCtx
->
keys
.
abba
=
msg
.
abba
.
rawData
.
copy
();
keys
::
DeriveKeysSeafAmf
(
*
m_base
->
config
,
*
m_usim
->
m_currentPlmn
,
*
m_usim
->
m_nonCurrentNsCtx
);
keys
::
DeriveKeysSeafAmf
(
*
m_base
->
config
,
m_base
->
shCtx
.
getCurrentPlmn
()
,
*
m_usim
->
m_nonCurrentNsCtx
);
// Send response
m_nwConsecutiveAuthFailure
=
0
;
...
...
@@ -413,7 +413,7 @@ void NasMm::receiveAuthenticationResult(const nas::AuthenticationResult &msg)
void
NasMm
::
receiveAuthenticationReject
(
const
nas
::
AuthenticationReject
&
msg
)
{
m_logger
->
err
(
"Authentication Reject received
.
"
);
m_logger
->
err
(
"Authentication Reject received"
);
// The RAND and RES* values stored in the ME shall be deleted and timer T3516, if running, shall be stopped
m_usim
->
m_rand
=
{};
...
...
@@ -524,10 +524,10 @@ bool NasMm::networkFailingTheAuthCheck(bool hasChance)
m_logger
->
err
(
"Network failing the authentication check"
);
if
(
m_cmState
==
ECmState
::
CM_CONNECTED
)
{
localReleaseConnection
();
// TODO: treat the active cell as barred
}
{
localReleaseConnection
();
// TODO: treat the active cell as barred
}
m_timers
->
t3520
.
stop
();
return
true
;
...
...
src/ue/nas/mm/dereg.cpp
View file @
96407574
...
...
@@ -241,7 +241,8 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
)
{
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
*
m_usim
->
m_currentPlmn
));
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()));
}
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
...
...
src/ue/nas/mm/radio.cpp
View file @
96407574
...
...
@@ -175,7 +175,6 @@ void NasMm::handleServingCellChange(const UeCellInfo &servingCell)
resetRegAttemptCounter
();
m_usim
->
m_servingCell
=
servingCell
;
m_usim
->
m_currentPlmn
=
servingCell
.
cellId
.
plmn
;
m_usim
->
m_currentTai
=
nas
::
VTrackingAreaIdentity
{
nas
::
utils
::
PlmnFrom
(
servingCell
.
cellId
.
plmn
),
octet3
{
servingCell
.
tac
}};
}
...
...
@@ -198,7 +197,6 @@ void NasMm::handleRadioLinkFailure()
}
m_usim
->
m_servingCell
=
std
::
nullopt
;
m_usim
->
m_currentPlmn
=
std
::
nullopt
;
m_usim
->
m_currentTai
=
std
::
nullopt
;
handleRrcConnectionRelease
();
...
...
src/ue/nas/mm/register.cpp
View file @
96407574
...
...
@@ -246,7 +246,7 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
});
}
// .. in addition, the UE shall add to the stored list the PLMN code of the registered PLMN that sent the list
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_equivalentPlmnList
,
nas
::
utils
::
PlmnFrom
(
*
m_usim
->
m_currentPlmn
));
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_equivalentPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
// Upon receipt of the REGISTRATION ACCEPT message, the UE shall reset the registration attempt counter, enter state
// 5GMM-REGISTERED and set the 5GS update status to 5U1 UPDATED.
...
...
@@ -352,7 +352,7 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
});
}
// .. in addition, the UE shall add to the stored list the PLMN code of the registered PLMN that sent the list
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_equivalentPlmnList
,
nas
::
utils
::
PlmnFrom
(
*
m_usim
->
m_currentPlmn
));
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_equivalentPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
// Store the service area list
m_storage
->
m_serviceAreaList
->
set
(
msg
.
serviceAreaList
.
value_or
(
nas
::
IEServiceAreaList
{}));
...
...
@@ -574,7 +574,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
{
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
*
m_usim
->
m_currentPlmn
));
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
}
if
(
cause
==
nas
::
EMmCause
::
CONGESTION
)
...
...
@@ -738,7 +738,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
{
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
*
m_usim
->
m_currentPlmn
));
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
}
if
(
cause
==
nas
::
EMmCause
::
CONGESTION
)
...
...
src/ue/nas/mm/service.cpp
View file @
96407574
...
...
@@ -305,7 +305,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
{
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
*
m_usim
->
m_currentPlmn
));
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_forbiddenPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
}
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
)
...
...
src/ue/nas/usim/usim.hpp
View file @
96407574
...
...
@@ -36,7 +36,6 @@ class Usim
// Plmn related
std
::
optional
<
UeCellInfo
>
m_servingCell
{};
std
::
optional
<
Plmn
>
m_currentPlmn
{};
std
::
optional
<
nas
::
VTrackingAreaIdentity
>
m_currentTai
{};
std
::
optional
<
nas
::
IE5gsTrackingAreaIdentity
>
m_lastVisitedRegisteredTai
{};
nas
::
IE5gsTrackingAreaIdentityList
m_taiList
{};
...
...
src/ue/types.cpp
View file @
96407574
...
...
@@ -294,4 +294,9 @@ bool CurrentCellInfo::hasValue() const
return
cellId
!=
0
;
}
Plmn
UeSharedContext
::
getCurrentPlmn
()
{
return
currentCell
.
get
<
Plmn
>
([](
auto
&
value
)
{
return
value
.
plmn
;
});
}
}
// namespace nr::ue
src/ue/types.hpp
View file @
96407574
...
...
@@ -11,8 +11,8 @@
#include <array>
#include <atomic>
#include <memory>
#include <unordered_set>
#include <set>
#include <unordered_set>
#include <lib/app/monitor.hpp>
#include <lib/app/ue_ctl.hpp>
...
...
@@ -165,6 +165,8 @@ struct UeSharedContext
Locked
<
CurrentCellInfo
>
currentCell
;
Locked
<
std
::
vector
<
Tai
>>
forbiddenTaiRoaming
;
Locked
<
std
::
vector
<
Tai
>>
forbiddenTaiRps
;
Plmn
getCurrentPlmn
();
};
struct
TaskBase
...
...
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