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
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
spbro
OpenXG-RAN
Commits
ea0185f8
Commit
ea0185f8
authored
Jan 23, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced define for uint8_t integrity and ciphering keys data structures
- the goal is to improve maintanability
parent
08051056
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
16 deletions
+17
-16
openair2/RRC/NR/nr_rrc_common.h
openair2/RRC/NR/nr_rrc_common.h
+1
-0
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+6
-6
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+3
-3
openair2/RRC/NR/rrc_gNB_nsa.c
openair2/RRC/NR/rrc_gNB_nsa.c
+2
-2
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+5
-5
No files found.
openair2/RRC/NR/nr_rrc_common.h
View file @
ea0185f8
...
...
@@ -29,6 +29,7 @@
#define NR_RRC_HEADER_SIZE_MAX 64
#define NR_RRC_BUFFER_SIZE_MAX 1024
#define NR_NUM_SRB 4
#define NR_K_KEY_SIZE 16
/* K keys have 128 bits length */
typedef
struct
{
char
Payload
[
NR_RRC_BUFFER_SIZE_MAX
];
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
ea0185f8
...
...
@@ -408,8 +408,8 @@ static void activate_srb(gNB_RRC_UE_t *UE, int srb_id)
if
(
srb_id
==
1
)
{
nr_pdcp_add_srbs
(
true
,
UE
->
rrc_ue_id
,
list
,
0
,
NULL
,
NULL
);
}
else
{
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
uint8_t
kRRCenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kRRCint
[
NR_K_KEY_SIZE
]
=
{
0
};
nr_derive_key
(
RRC_ENC_ALG
,
UE
->
ciphering_algorithm
,
UE
->
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
UE
->
integrity_algorithm
,
UE
->
kgnb
,
kRRCint
);
...
...
@@ -904,13 +904,13 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context
LOG_I
(
NR_RRC
,
"[RAPROC] UE %04x Logical Channel DL-DCCH, Generating NR_RRCReestablishment (bytes %d)
\n
"
,
ue_p
->
rnti
,
size
);
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
uint8_t
kUPenc
[
16
]
=
{
0
};
/* Ciphering and Integrity according to TS 33.501 */
uint8_t
kRRCenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kRRCint
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kUPenc
[
NR_K_KEY_SIZE
]
=
{
0
};
/* Derive the keys from kgnb */
if
(
ue_p
->
Srb
[
1
].
Active
)
nr_derive_key
(
UP_ENC_ALG
,
ue_p
->
ciphering_algorithm
,
ue_p
->
kgnb
,
kUPenc
);
nr_derive_key
(
RRC_ENC_ALG
,
ue_p
->
ciphering_algorithm
,
ue_p
->
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
ue_p
->
integrity_algorithm
,
ue_p
->
kgnb
,
kRRCint
);
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
ea0185f8
...
...
@@ -130,9 +130,9 @@ nr_rrc_pdcp_config_security(
)
//------------------------------------------------------------------------------
{
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
uint8_t
kUPenc
[
16
]
=
{
0
};
uint8_t
kRRCenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kRRCint
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kUPenc
[
NR_K_KEY_SIZE
]
=
{
0
};
//uint8_t *k_kdf = NULL;
static
int
print_keys
=
1
;
gNB_RRC_UE_t
*
UE
=
&
ue_context_pP
->
ue_context
;
...
...
openair2/RRC/NR/rrc_gNB_nsa.c
View file @
ea0185f8
...
...
@@ -126,8 +126,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
gtpv1u_enb_create_tunnel_req_t
create_tunnel_req
;
gtpv1u_enb_create_tunnel_resp_t
create_tunnel_resp
;
protocol_ctxt_t
ctxt
=
{
0
};
uint8_t
kUPenc
[
16
]
=
{
0
};
uint8_t
kUPint
[
16
]
=
{
0
};
uint8_t
kUPenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kUPint
[
NR_K_KEY_SIZE
]
=
{
0
};
int
i
;
gNB_RRC_UE_t
*
UE
=
&
ue_context_p
->
ue_context
;
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
ea0185f8
...
...
@@ -987,9 +987,9 @@ static void nr_rrc_ue_process_securityModeCommand(NR_UE_RRC_INST_t *ue_rrc,
c1
->
present
=
NR_UL_DCCH_MessageType__c1_PR_securityModeComplete
;
}
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kUPenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
uint8_t
kRRCenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kUPenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kRRCint
[
NR_K_KEY_SIZE
]
=
{
0
};
nr_derive_key
(
UP_ENC_ALG
,
ue_rrc
->
cipheringAlgorithm
,
ue_rrc
->
kgnb
,
kUPenc
);
nr_derive_key
(
RRC_ENC_ALG
,
ue_rrc
->
cipheringAlgorithm
,
ue_rrc
->
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
ue_rrc
->
integrityProtAlgorithm
,
ue_rrc
->
kgnb
,
kRRCint
);
...
...
@@ -1167,8 +1167,8 @@ static void nr_rrc_ue_process_RadioBearerConfig(NR_UE_RRC_INST_t *ue_rrc,
if
(
radioBearerConfig
->
srb3_ToRelease
)
nr_pdcp_release_srb
(
ue_rrc
->
ue_id
,
3
);
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
uint8_t
kRRCenc
[
NR_K_KEY_SIZE
]
=
{
0
};
uint8_t
kRRCint
[
NR_K_KEY_SIZE
]
=
{
0
};
if
(
ue_rrc
->
as_security_activated
)
{
if
(
radioBearerConfig
->
securityConfig
!=
NULL
)
{
// When the field is not included, continue to use the currently configured keyToUse
...
...
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