Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
1
Merge Requests
1
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-RAN
Commits
3e27e53f
Commit
3e27e53f
authored
Nov 28, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle size in nas_protected_security_header_encode
parent
c37c5ad7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
openair3/NAS/NR_UE/5GS/fgs_nas_lib.c
openair3/NAS/NR_UE/5GS/fgs_nas_lib.c
+6
-3
openair3/NAS/NR_UE/nr_nas_msg.c
openair3/NAS/NR_UE/nr_nas_msg.c
+1
-1
No files found.
openair3/NAS/NR_UE/5GS/fgs_nas_lib.c
View file @
3e27e53f
...
...
@@ -115,10 +115,13 @@ int mm_msg_encode(const fgmm_nas_message_plain_t *p, uint8_t *buffer, uint32_t l
int
nas_protected_security_header_encode
(
uint8_t
*
buffer
,
const
fgs_nas_message_security_header_t
*
header
,
int
length
)
{
LOG_FUNC_IN
;
int
size
=
0
;
if
(
length
<
sizeof
(
fgs_nas_message_security_header_t
))
{
PRINT_NAS_ERROR
(
"Could not encode the NAS security header
\n
"
);
return
-
1
;
}
/* Encode the protocol discriminator) */
ENCODE_U8
(
buffer
,
header
->
protocol_discriminator
,
size
);
...
...
@@ -130,7 +133,7 @@ int nas_protected_security_header_encode(uint8_t *buffer, const fgs_nas_message_
/* Encode the sequence number */
ENCODE_U8
(
buffer
+
size
,
header
->
sequence_number
,
size
);
LOG_FUNC_RETURN
(
size
)
;
return
size
;
}
/**
...
...
openair3/NAS/NR_UE/nr_nas_msg.c
View file @
3e27e53f
...
...
@@ -667,7 +667,7 @@ static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initia
// encode the message
initialNasMsg
->
nas_data
=
malloc_or_fail
(
size
*
sizeof
(
*
initialNasMsg
->
nas_data
));
int
security_header_len
=
nas_protected_security_header_encode
(
initialNasMsg
->
nas_data
,
&
nas_msg
.
header
,
size
);
int
security_header_len
=
nas_protected_security_header_encode
(
initialNasMsg
->
nas_data
,
sp
,
size
);
initialNasMsg
->
length
=
security_header_len
...
...
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