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
88bdd957
Commit
88bdd957
authored
Mar 07, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
6045239e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+2
-1
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+8
-8
src/amf-app/amf_sbi.cpp
src/amf-app/amf_sbi.cpp
+3
-3
No files found.
src/amf-app/amf_app.cpp
View file @
88bdd957
...
...
@@ -337,7 +337,8 @@ void amf_app::handle_itti_message(
uint8_t
nas
[
BUFFER_SIZE_1024
];
int
encoded_size
=
dl
->
Encode
(
nas
,
BUFFER_SIZE_1024
);
output_wrapper
::
print_buffer
(
"amf_app"
,
"n1n2 transfer"
,
nas
,
encoded_size
);
output_wrapper
::
print_buffer
(
"amf_app"
,
"N1N2 message transfer"
,
nas
,
encoded_size
);
std
::
shared_ptr
<
itti_downlink_nas_transfer
>
dl_msg
=
std
::
make_shared
<
itti_downlink_nas_transfer
>
(
TASK_AMF_APP
,
TASK_AMF_N1
);
...
...
src/amf-app/amf_n1.cpp
View file @
88bdd957
...
...
@@ -321,7 +321,7 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Authentication_5gaka
::
derive_kgnb
(
0
,
0x01
,
kamf
,
kgnb
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
k
amf"
,
kamf
,
32
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
K
amf"
,
kamf
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
csr
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
...
...
@@ -990,7 +990,7 @@ void amf_n1::service_request_handle(
uint8_t
kgnb
[
32
];
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Logger
::
amf_n1
().
debug
(
"uplink count(%d)"
,
secu
->
ul_count
.
seq_num
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
k
amf"
,
kamf
,
32
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
K
amf"
,
kamf
,
32
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
...
...
@@ -1039,7 +1039,7 @@ void amf_n1::service_request_handle(
uint8_t
kgnb
[
32
];
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Logger
::
amf_n1
().
debug
(
"uplink count(%d)"
,
secu
->
ul_count
.
seq_num
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
k
amf"
,
kamf
,
32
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
K
amf"
,
kamf
,
32
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
...
...
@@ -1899,12 +1899,12 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(
"amf_n1"
,
"5G AV: kseaf"
,
nc
->
_5g_av
[
0
].
kseaf
,
32
);
free_wrapper
((
void
**
)
&
kseaf_hex
);
Logger
::
amf_n1
().
debug
(
"Deriving
k
amf"
);
Logger
::
amf_n1
().
debug
(
"Deriving
K
amf"
);
for
(
int
i
=
0
;
i
<
MAX_5GS_AUTH_VECTORS
;
i
++
)
{
Authentication_5gaka
::
derive_kamf
(
nc
->
imsi
,
nc
->
_5g_av
[
i
].
kseaf
,
nc
->
kamf
[
i
],
0x0000
);
// second parameter: abba
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
k
amf"
,
nc
->
kamf
[
i
],
32
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
K
amf"
,
nc
->
kamf
[
i
],
32
);
}
}
catch
(
nlohmann
::
json
::
exception
&
e
)
{
Logger
::
amf_n1
().
info
(
"Could not get JSON content from AUSF response"
);
...
...
@@ -2733,7 +2733,7 @@ void amf_n1::security_mode_complete_handle(
uint8_t
kgnb
[
32
];
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Authentication_5gaka
::
derive_kgnb
(
0
,
0x01
,
kamf
,
kgnb
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
k
amf"
,
kamf
,
32
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
K
amf"
,
kamf
,
32
);
// Authentication_5gaka::derive_kgnb(ulcount, 0x01, kamf, kgnb);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
...
...
@@ -2934,7 +2934,7 @@ bool amf_n1::nas_message_integrity_protected(
uint8_t
mac
[
4
];
stream_cipher
.
key
=
nsc
->
knas_int
;
output_wrapper
::
print_buffer
(
"amf_n1"
,
"Parameters for NIA:
k
nas_int"
,
nsc
->
knas_int
,
"amf_n1"
,
"Parameters for NIA:
K
nas_int"
,
nsc
->
knas_int
,
AUTH_KNAS_INT_SIZE
);
stream_cipher
.
key_length
=
AUTH_KNAS_INT_SIZE
;
stream_cipher
.
count
=
*
(
input_nas
);
...
...
@@ -3474,7 +3474,7 @@ void amf_n1::run_mobility_registration_update_procedure(
uint8_t
kgnb
[
32
];
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
k
amf"
,
kamf
,
32
);
output_wrapper
::
print_buffer
(
"amf_n1"
,
"
K
amf"
,
kamf
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
...
...
src/amf-app/amf_sbi.cpp
View file @
88bdd957
...
...
@@ -794,7 +794,7 @@ void amf_sbi::handle_post_sm_context_response_error(
const
long
code
,
const
std
::
string
&
cause
,
bstring
n1sm
,
const
std
::
string
&
supi
,
const
uint8_t
pdu_session_id
)
{
output_wrapper
::
print_buffer
(
"amf_sbi"
,
"
n1 sm
"
,
(
uint8_t
*
)
bdata
(
n1sm
),
blength
(
n1sm
));
"amf_sbi"
,
"
N1 SM
"
,
(
uint8_t
*
)
bdata
(
n1sm
),
blength
(
n1sm
));
itti_n1n2_message_transfer_request
*
itti_msg
=
new
itti_n1n2_message_transfer_request
(
TASK_AMF_SBI
,
TASK_AMF_APP
);
itti_msg
->
n1sm
=
bstrcpy
(
n1sm
);
...
...
@@ -1266,7 +1266,7 @@ void amf_sbi::curl_http_client(
if
(
n1sm
.
size
()
>
0
)
{
conv
::
msg_str_2_msg_hex
(
n1sm
,
n1sm_hex
);
output_wrapper
::
print_buffer
(
"amf_sbi"
,
"Get response
n1sm
:"
,
(
uint8_t
*
)
bdata
(
n1sm_hex
),
"amf_sbi"
,
"Get response
N1 SM
:"
,
(
uint8_t
*
)
bdata
(
n1sm_hex
),
blength
(
n1sm_hex
));
itti_msg
->
n1sm
=
bstrcpy
(
n1sm_hex
);
itti_msg
->
is_n1sm_set
=
true
;
...
...
@@ -1274,7 +1274,7 @@ void amf_sbi::curl_http_client(
if
(
n2sm
.
size
()
>
0
)
{
conv
::
msg_str_2_msg_hex
(
n2sm
,
n2sm_hex
);
output_wrapper
::
print_buffer
(
"amf_sbi"
,
"Get response
n2sm
:"
,
(
uint8_t
*
)
bdata
(
n2sm_hex
),
"amf_sbi"
,
"Get response
N2 SM
:"
,
(
uint8_t
*
)
bdata
(
n2sm_hex
),
blength
(
n2sm_hex
));
itti_msg
->
n2sm
=
bstrcpy
(
n2sm_hex
);
itti_msg
->
is_n2sm_set
=
true
;
...
...
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