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
8cf1bf83
Commit
8cf1bf83
authored
Aug 20, 2022
by
Tien Thinh NGUYEN
Committed by
sagar arora
Aug 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
3ccfa74b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
38 deletions
+44
-38
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+39
-36
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+5
-2
No files found.
src/amf-app/amf_n1.cpp
View file @
8cf1bf83
...
@@ -317,14 +317,13 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
...
@@ -317,14 +317,13 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Authentication_5gaka
::
derive_kgnb
(
0
,
0x01
,
kamf
,
kgnb
);
Authentication_5gaka
::
derive_kgnb
(
0
,
0x01
,
kamf
,
kgnb
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
bstring
kgnb_bs
=
blk2bstr
(
kgnb
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
csr
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
csr
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
std
::
make_shared
<
itti_initial_context_setup_request
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
TASK_AMF_N1
,
TASK_AMF_N2
);
csr
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
csr
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
csr
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
csr
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
csr
->
kgnb
=
kgnb_bs
;
csr
->
kgnb
=
blk2bstr
(
kgnb
,
32
)
;
csr
->
nas
=
protected_nas
;
csr
->
nas
=
protected_nas
;
csr
->
pdu_session_id
=
itti_msg
.
pdu_session_id
;
csr
->
pdu_session_id
=
itti_msg
.
pdu_session_id
;
csr
->
is_pdu_exist
=
true
;
csr
->
is_pdu_exist
=
true
;
...
@@ -499,8 +498,10 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind& nas_data_ind) {
...
@@ -499,8 +498,10 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind& nas_data_ind) {
nc
.
get
()
->
security_ctx
,
NAS_MESSAGE_UPLINK
,
ciphered
,
nc
.
get
()
->
security_ctx
,
NAS_MESSAGE_UPLINK
,
ciphered
,
decoded_plain_msg
))
{
decoded_plain_msg
))
{
Logger
::
amf_n1
().
error
(
"Decrypt NAS message failure"
);
Logger
::
amf_n1
().
error
(
"Decrypt NAS message failure"
);
bdestroy_wrapper
(
&
ciphered
);
return
;
return
;
}
}
bdestroy_wrapper
(
&
ciphered
);
}
break
;
}
break
;
default:
{
default:
{
Logger
::
amf_n1
().
error
(
"Unknown NAS Message Type"
);
Logger
::
amf_n1
().
error
(
"Unknown NAS Message Type"
);
...
@@ -884,12 +885,13 @@ void amf_n1::service_request_handle(
...
@@ -884,12 +885,13 @@ void amf_n1::service_request_handle(
bstring
plain_msg
=
nullptr
;
bstring
plain_msg
=
nullptr
;
if
(
service_request
->
getNasMessageContainer
(
plain_msg
))
{
if
(
service_request
->
getNasMessageContainer
(
plain_msg
))
{
if
(
blength
(
plain_msg
)
<
NAS_MESSAGE_MIN_LENGTH
)
{
if
(
blength
(
plain_msg
)
<
NAS_MESSAGE_MIN_LENGTH
)
{
Logger
::
amf_n1
().
debug
(
"NAS message too short!"
);
Logger
::
amf_n1
().
debug
(
"NAS message is too short!"
);
bdestroy_wrapper
(
&
plain_msg
);
return
;
return
;
}
}
uint8_t
*
buf_nas
=
(
uint8_t
*
)
bdata
(
plain_msg
);
// TODO
//
uint8_t* buf_nas = (uint8_t*) bdata(plain_msg); // TODO
uint8_t
message_type
=
*
(
buf_nas
+
2
);
uint8_t
message_type
=
*
(
(
uint8_t
*
)
bdata
(
plain_msg
)
+
2
);
Logger
::
amf_n1
().
debug
(
"NAS message type 0x%x"
,
message_type
);
Logger
::
amf_n1
().
debug
(
"NAS message type 0x%x"
,
message_type
);
switch
(
message_type
)
{
switch
(
message_type
)
{
...
@@ -905,7 +907,8 @@ void amf_n1::service_request_handle(
...
@@ -905,7 +907,8 @@ void amf_n1::service_request_handle(
std
::
make_unique
<
ServiceRequest
>
();
std
::
make_unique
<
ServiceRequest
>
();
service_request_nas
->
decodefrombuffer
(
service_request_nas
->
decodefrombuffer
(
nullptr
,
(
uint8_t
*
)
bdata
(
plain_msg
),
blength
(
plain_msg
));
nullptr
,
(
uint8_t
*
)
bdata
(
plain_msg
),
blength
(
plain_msg
));
// bdestroy_wrapper(&plain_msg);
bdestroy_wrapper
(
&
plain_msg
);
if
(
service_request_nas
->
getPduSessionStatus
()
>
0
)
{
if
(
service_request_nas
->
getPduSessionStatus
()
>
0
)
{
pdu_session_status
=
pdu_session_status
=
(
uint16_t
)
service_request_nas
->
getPduSessionStatus
();
(
uint16_t
)
service_request_nas
->
getPduSessionStatus
();
...
@@ -946,15 +949,14 @@ void amf_n1::service_request_handle(
...
@@ -946,15 +949,14 @@ void amf_n1::service_request_handle(
Logger
::
amf_n1
().
debug
(
"uplink count(%d)"
,
secu
->
ul_count
.
seq_num
);
Logger
::
amf_n1
().
debug
(
"uplink count(%d)"
,
secu
->
ul_count
.
seq_num
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
bstring
kgnb_bs
=
blk2bstr
(
kgnb
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
std
::
make_shared
<
itti_initial_context_setup_request
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
nas
=
protected_nas
;
itti_msg
->
nas
=
bstrcpy
(
protected_nas
)
;
itti_msg
->
kgnb
=
kgnb_bs
;
itti_msg
->
kgnb
=
blk2bstr
(
kgnb
,
32
)
;
itti_msg
->
is_sr
=
true
;
// Service Request indicator
itti_msg
->
is_sr
=
true
;
// Service Request indicator
itti_msg
->
is_pdu_exist
=
false
;
itti_msg
->
is_pdu_exist
=
false
;
...
@@ -964,6 +966,7 @@ void amf_n1::service_request_handle(
...
@@ -964,6 +966,7 @@ void amf_n1::service_request_handle(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
"Could not send ITTI message %s to task TASK_AMF_N2"
,
itti_msg
->
get_msg_name
());
itti_msg
->
get_msg_name
());
}
}
bdestroy_wrapper
(
&
protected_nas
);
return
;
return
;
}
else
{
}
else
{
...
@@ -996,20 +999,19 @@ void amf_n1::service_request_handle(
...
@@ -996,20 +999,19 @@ void amf_n1::service_request_handle(
Logger
::
amf_n1
().
debug
(
"uplink count(%d)"
,
secu
->
ul_count
.
seq_num
);
Logger
::
amf_n1
().
debug
(
"uplink count(%d)"
,
secu
->
ul_count
.
seq_num
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
bstring
kgnb_bs
=
blk2bstr
(
kgnb
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
std
::
make_shared
<
itti_initial_context_setup_request
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
nas
=
protected_nas
;
itti_msg
->
nas
=
bstrcpy
(
protected_nas
)
;
itti_msg
->
kgnb
=
kgnb_bs
;
itti_msg
->
kgnb
=
blk2bstr
(
kgnb
,
32
)
;
itti_msg
->
is_sr
=
true
;
// Service Request indicator
itti_msg
->
is_sr
=
true
;
// Service Request indicator
itti_msg
->
pdu_session_id
=
pdu_session_id
;
itti_msg
->
pdu_session_id
=
pdu_session_id
;
itti_msg
->
is_pdu_exist
=
true
;
itti_msg
->
is_pdu_exist
=
true
;
if
(
psc
.
get
()
->
is_n2sm_avaliable
)
{
if
(
psc
.
get
()
->
is_n2sm_avaliable
)
{
itti_msg
->
n2sm
=
psc
.
get
()
->
n2sm
;
itti_msg
->
n2sm
=
bstrcpy
(
psc
.
get
()
->
n2sm
)
;
itti_msg
->
is_n2sm_avaliable
=
true
;
itti_msg
->
is_n2sm_avaliable
=
true
;
}
else
{
}
else
{
itti_msg
->
is_n2sm_avaliable
=
false
;
itti_msg
->
is_n2sm_avaliable
=
false
;
...
@@ -1022,6 +1024,7 @@ void amf_n1::service_request_handle(
...
@@ -1022,6 +1024,7 @@ void amf_n1::service_request_handle(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
"Could not send ITTI message %s to task TASK_AMF_N2"
,
itti_msg
->
get_msg_name
());
itti_msg
->
get_msg_name
());
}
}
bdestroy_wrapper
(
&
protected_nas
);
}
}
}
}
...
@@ -1029,15 +1032,16 @@ void amf_n1::service_request_handle(
...
@@ -1029,15 +1032,16 @@ void amf_n1::service_request_handle(
void
amf_n1
::
registration_request_handle
(
void
amf_n1
::
registration_request_handle
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
uint32_t
ran_ue_ngap_id
,
std
::
shared_ptr
<
nas_context
>&
nc
,
const
uint32_t
ran_ue_ngap_id
,
const
long
amf_ue_ngap_id
,
const
std
::
string
&
snn
,
bstring
reg
)
{
const
long
amf_ue_ngap_id
,
const
std
::
string
&
snn
,
bstring
reg
)
{
// Decode
registration r
equest message
// Decode
Registration R
equest message
std
::
unique_ptr
<
RegistrationRequest
>
registration_request
=
std
::
unique_ptr
<
RegistrationRequest
>
registration_request
=
std
::
make_unique
<
RegistrationRequest
>
();
std
::
make_unique
<
RegistrationRequest
>
();
registration_request
->
decodefrombuffer
(
registration_request
->
decodefrombuffer
(
nullptr
,
(
uint8_t
*
)
bdata
(
reg
),
blength
(
reg
));
nullptr
,
(
uint8_t
*
)
bdata
(
reg
),
blength
(
reg
));
// TODO: Use set function
nc
->
registration_request
=
blk2bstr
((
uint8_t
*
)
bdata
(
reg
),
blength
(
reg
));
nc
->
registration_request
=
blk2bstr
((
uint8_t
*
)
bdata
(
reg
),
blength
(
reg
));
nc
->
registration_request_is_set
=
true
;
nc
->
registration_request_is_set
=
true
;
// bdestroy_wrapper(®); // free buffer
// Find UE context
// Find UE context
std
::
shared_ptr
<
ue_context
>
uc
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
...
@@ -1052,34 +1056,35 @@ void amf_n1::registration_request_handle(
...
@@ -1052,34 +1056,35 @@ void amf_n1::registration_request_handle(
uint8_t
mobility_id_type
=
registration_request
->
getMobilityIdentityType
();
uint8_t
mobility_id_type
=
registration_request
->
getMobilityIdentityType
();
switch
(
mobility_id_type
)
{
switch
(
mobility_id_type
)
{
case
SUCI
:
{
case
SUCI
:
{
nas
::
SUCI_imsi_t
imsi
;
nas
::
SUCI_imsi_t
imsi
=
{}
;
if
(
!
registration_request
->
getSuciSupiFormatImsi
(
imsi
))
{
if
(
!
registration_request
->
getSuciSupiFormatImsi
(
imsi
))
{
Logger
::
amf_n1
().
warn
(
"No SUCI and IMSI for SUPI Format"
);
Logger
::
amf_n1
().
warn
(
"No SUCI and IMSI for SUPI Format"
);
}
else
{
}
else
{
if
(
!
nc
.
get
()
)
{
if
(
!
nc
)
{
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"No existing nas_context with amf_ue_ngap_id ("
AMF_UE_NGAP_ID_FMT
"No existing nas_context with amf_ue_ngap_id ("
AMF_UE_NGAP_ID_FMT
") --> Create new one"
,
") --> Create new one"
,
amf_ue_ngap_id
);
amf_ue_ngap_id
);
nc
=
std
::
shared_ptr
<
nas_context
>
(
new
nas_context
);
nc
=
std
::
shared_ptr
<
nas_context
>
(
new
nas_context
);
set_amf_ue_ngap_id_2_nas_context
(
amf_ue_ngap_id
,
nc
);
set_amf_ue_ngap_id_2_nas_context
(
amf_ue_ngap_id
,
nc
);
nc
.
get
()
->
ctx_avaliability_ind
=
false
;
nc
->
ctx_avaliability_ind
=
false
;
// change UE connection status CM-IDLE -> CM-CONNECTED
// Change UE connection status CM-IDLE -> CM-CONNECTED
nc
.
get
()
->
nas_status
=
CM_CONNECTED
;
// TODO: Use set function with mutex
nc
.
get
()
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
nc
->
nas_status
=
CM_CONNECTED
;
nc
.
get
()
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
nc
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
nc
.
get
()
->
serving_network
=
snn
;
nc
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
nc
->
serving_network
=
snn
;
// Stop Mobile Reachable Timer/Implicit Deregistration Timer
// Stop Mobile Reachable Timer/Implicit Deregistration Timer
itti_inst
->
timer_remove
(
nc
.
get
()
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
.
get
()
->
implicit_deregistration_timer
);
itti_inst
->
timer_remove
(
nc
->
implicit_deregistration_timer
);
}
}
nc
.
get
()
->
is_imsi_present
=
true
;
nc
->
is_imsi_present
=
true
;
nc
.
get
()
->
imsi
=
imsi
.
mcc
+
imsi
.
mnc
+
imsi
.
msin
;
nc
->
imsi
=
imsi
.
mcc
+
imsi
.
mnc
+
imsi
.
msin
;
Logger
::
amf_n1
().
debug
(
"Received IMSI %s"
,
nc
.
get
()
->
imsi
.
c_str
());
Logger
::
amf_n1
().
debug
(
"Received IMSI %s"
,
nc
->
imsi
.
c_str
());
// Trigger UE Reachability Status Notify
// Trigger UE Reachability Status Notify
if
(
!
nc
.
get
()
->
imsi
.
empty
())
{
if
(
!
nc
->
imsi
.
empty
())
{
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"Signal the UE Reachability Status Event notification for SUPI "
"Signal the UE Reachability Status Event notification for SUPI "
...
@@ -2698,14 +2703,13 @@ void amf_n1::security_mode_complete_handle(
...
@@ -2698,14 +2703,13 @@ void amf_n1::security_mode_complete_handle(
Authentication_5gaka
::
derive_kgnb
(
0
,
0x01
,
kamf
,
kgnb
);
Authentication_5gaka
::
derive_kgnb
(
0
,
0x01
,
kamf
,
kgnb
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
// Authentication_5gaka::derive_kgnb(ulcount, 0x01, kamf, kgnb);
// Authentication_5gaka::derive_kgnb(ulcount, 0x01, kamf, kgnb);
bstring
kgnb_bs
=
blk2bstr
(
kgnb
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
std
::
make_shared
<
itti_initial_context_setup_request
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
kgnb
=
kgnb_bs
;
itti_msg
->
kgnb
=
blk2bstr
(
kgnb
,
32
)
;
itti_msg
->
nas
=
protected_nas
;
itti_msg
->
nas
=
protected_nas
;
itti_msg
->
is_pdu_exist
=
false
;
// no pdu context
itti_msg
->
is_pdu_exist
=
false
;
// no pdu context
itti_msg
->
is_sr
=
false
;
// TODO: for Service Request procedure
itti_msg
->
is_sr
=
false
;
// TODO: for Service Request procedure
...
@@ -2822,8 +2826,8 @@ void amf_n1::encode_nas_message_protected(
...
@@ -2822,8 +2826,8 @@ void amf_n1::encode_nas_message_protected(
encoded_size
=
7
+
input_nas_len
;
encoded_size
=
7
+
input_nas_len
;
}
}
//
bdestroy_wrapper(&input);
bdestroy_wrapper
(
&
input
);
//
bdestroy_wrapper(&ciphered);
bdestroy_wrapper
(
&
ciphered
);
}
break
;
}
break
;
case
INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX
:
{
case
INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX
:
{
...
@@ -2835,7 +2839,7 @@ void amf_n1::encode_nas_message_protected(
...
@@ -2835,7 +2839,7 @@ void amf_n1::encode_nas_message_protected(
protected_nas_buf
[
1
]
=
INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX
;
protected_nas_buf
[
1
]
=
INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX
;
protected_nas_buf
[
6
]
=
(
uint8_t
)
nsc
->
dl_count
.
seq_num
;
protected_nas_buf
[
6
]
=
(
uint8_t
)
nsc
->
dl_count
.
seq_num
;
memcpy
(
&
protected_nas_buf
[
7
],
input_nas_buf
,
input_nas_len
);
memcpy
(
&
protected_nas_buf
[
7
],
input_nas_buf
,
input_nas_len
);
uint32_t
mac32
;
uint32_t
mac32
=
{}
;
if
(
!
(
nas_message_integrity_protected
(
if
(
!
(
nas_message_integrity_protected
(
nsc
,
NAS_MESSAGE_DOWNLINK
,
protected_nas_buf
+
6
,
nsc
,
NAS_MESSAGE_DOWNLINK
,
protected_nas_buf
+
6
,
input_nas_len
+
1
,
mac32
)))
{
input_nas_len
+
1
,
mac32
)))
{
...
@@ -3342,14 +3346,13 @@ void amf_n1::run_mobility_registration_update_procedure(
...
@@ -3342,14 +3346,13 @@ void amf_n1::run_mobility_registration_update_procedure(
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
Authentication_5gaka
::
derive_kgnb
(
ulcount
,
0x01
,
kamf
,
kgnb
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
comUt
::
print_buffer
(
"amf_n1"
,
"kamf"
,
kamf
,
32
);
bstring
kgnb_bs
=
blk2bstr
(
kgnb
,
32
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
itti_msg
=
std
::
make_shared
<
itti_initial_context_setup_request
>
(
std
::
make_shared
<
itti_initial_context_setup_request
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
ran_ue_ngap_id
=
nc
.
get
()
->
ran_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
nc
.
get
()
->
ran_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
nc
.
get
()
->
amf_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
nc
.
get
()
->
amf_ue_ngap_id
;
itti_msg
->
kgnb
=
kgnb_bs
;
itti_msg
->
kgnb
=
blk2bstr
(
kgnb
,
32
)
;
itti_msg
->
nas
=
protected_nas
;
itti_msg
->
nas
=
protected_nas
;
itti_msg
->
is_sr
=
true
;
// service request indicator, to be verified
itti_msg
->
is_sr
=
true
;
// service request indicator, to be verified
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
8cf1bf83
...
@@ -839,6 +839,7 @@ int RegistrationRequest::decodefrombuffer(
...
@@ -839,6 +839,7 @@ int RegistrationRequest::decodefrombuffer(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
)
{
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Decoding RegistrationRequest message"
);
Logger
::
nas_mm
().
debug
(
"Decoding RegistrationRequest message"
);
int
decoded_size
=
3
;
int
decoded_size
=
3
;
int
decoded_result
=
0
;
plain_header
=
header
;
plain_header
=
header
;
ie_5gsregistrationtype
=
new
_5GSRegistrationType
();
ie_5gsregistrationtype
=
new
_5GSRegistrationType
();
decoded_size
+=
ie_5gsregistrationtype
->
decodefrombuffer
(
decoded_size
+=
ie_5gsregistrationtype
->
decodefrombuffer
(
...
@@ -857,8 +858,10 @@ int RegistrationRequest::decodefrombuffer(
...
@@ -857,8 +858,10 @@ int RegistrationRequest::decodefrombuffer(
case
0xC
:
{
case
0xC
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0xC)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0xC)"
);
ie_non_current_native_nas_ksi
=
new
NasKeySetIdentifier
();
ie_non_current_native_nas_ksi
=
new
NasKeySetIdentifier
();
decoded_size
+=
ie_non_current_native_nas_ksi
->
decodefrombuffer
(
if
((
decoded_result
=
ie_non_current_native_nas_ksi
->
decodefrombuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
,
false
);
buf
+
decoded_size
,
len
-
decoded_size
,
true
,
false
))
<=
0
)
return
decoded_result
;
decoded_size
+=
decoded_result
;
octet
=
*
(
buf
+
decoded_size
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
}
break
;
...
...
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