Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-AMF
Commits
51f06bad
Commit
51f06bad
authored
Jan 26, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for Service Accept (Get info from old Nas Context)
parent
f0f4337d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+30
-5
No files found.
src/amf-app/amf_n1.cpp
View file @
51f06bad
...
...
@@ -830,8 +830,36 @@ void amf_n1::service_request_handle(
return
;
}
// Decode Service Request to get 5G-TMSI
std
::
unique_ptr
<
ServiceRequest
>
service_request
=
std
::
make_unique
<
ServiceRequest
>
();
int
decoded_size
=
service_request
->
Decode
(
nullptr
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
// bdestroy_wrapper(&nas);
if
(
decoded_size
!=
KEncodeDecodeError
)
{
// TODO: get old security context if exist
uint16_t
amf_set_id
=
{};
uint8_t
amf_pointer
=
{};
string
tmsi
=
{};
if
(
service_request
->
Get5gSTmsi
(
amf_set_id
,
amf_pointer
,
tmsi
))
{
std
::
string
guti
=
uc
->
tai
.
mcc
+
uc
->
tai
.
mnc
+
amf_cfg
.
guami
.
regionID
+
std
::
to_string
(
amf_set_id
)
+
std
::
to_string
(
amf_pointer
)
+
tmsi
;
Logger
::
amf_app
().
debug
(
"GUTI %s, 5G-TMSI %s"
,
guti
.
c_str
(),
tmsi
.
c_str
());
std
::
shared_ptr
<
nas_context
>
old_nc
=
{};
if
(
is_guti_2_nas_context
(
guti
))
{
old_nc
=
guti_2_nas_context
(
guti
);
nc
->
security_ctx
=
old_nc
->
security_ctx
;
}
}
}
// If there's no appropriate context, send Service Reject
if
(
!
nc
or
!
uc
or
!
nc
->
security_ctx
)
{
if
(
!
nc
or
!
uc
or
!
nc
->
security_ctx
or
(
decoded_size
==
KEncodeDecodeError
))
{
// TODO: Try to get
Logger
::
amf_n1
().
debug
(
"Cannot find NAS/UE context, send Service Reject to UE"
);
...
...
@@ -871,10 +899,7 @@ void amf_n1::service_request_handle(
Logger
::
amf_n1
().
error
(
"No Security Context found"
);
return
;
}
std
::
unique_ptr
<
ServiceRequest
>
service_request
=
std
::
make_unique
<
ServiceRequest
>
();
service_request
->
Decode
(
nullptr
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
// bdestroy_wrapper(&nas);
std
::
unique_ptr
<
ServiceAccept
>
service_accept
=
std
::
make_unique
<
ServiceAccept
>
();
service_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
...
...
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