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
598eeb79
Commit
598eeb79
authored
Nov 24, 2020
by
Xue Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Derive keys from kgnb
parent
ac902811
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
155 additions
and
44 deletions
+155
-44
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+4
-9
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+106
-35
openair2/UTIL/OSA/osa_defs.h
openair2/UTIL/OSA/osa_defs.h
+15
-0
openair2/UTIL/OSA/osa_internal.h
openair2/UTIL/OSA/osa_internal.h
+2
-0
openair2/UTIL/OSA/osa_key_deriver.c
openair2/UTIL/OSA/osa_key_deriver.c
+28
-0
No files found.
openair2/RRC/NR/nr_rrc_defs.h
View file @
598eeb79
...
...
@@ -182,13 +182,6 @@ typedef enum nr_e_rab_satus_e {
NR_E_RAB_STATUS_FAILED
,
}
nr_e_rab_status_t
;
typedef
enum
nr_pdu_session_status_e
{
NR_PDU_SESSION_STATUS_NEW
,
NR_PDU_SESSION_STATUS_DONE
,
// from the gNB perspective
NR_PDU_SESSION_STATUS_ESTABLISHED
,
// get the reconfigurationcomplete form UE
NR_PDU_SESSION_STATUS_FAILED
,
}
nr_pdu_session_status_t
;
typedef
struct
nr_e_rab_param_s
{
e_rab_t
param
;
uint8_t
status
;
...
...
@@ -265,8 +258,10 @@ typedef struct nr_rrc_guami_s {
}
nr_rrc_guami_t
;
typedef
enum
pdu_session_satus_e
{
PDU_SESSION_STATUS_NEW
//TODO
PDU_SESSION_STATUS_NEW
,
PDU_SESSION_STATUS_DONE
,
PDU_SESSION_STATUS_ESTABLISHED
,
PDU_SESSION_STATUS_FAILED
,
}
pdu_session_status_t
;
typedef
struct
pdu_session_param_s
{
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
598eeb79
This diff is collapsed.
Click to expand it.
openair2/UTIL/OSA/osa_defs.h
View file @
598eeb79
...
...
@@ -55,6 +55,8 @@ typedef enum {
int
derive_key
(
algorithm_type_dist_t
nas_alg_type
,
uint8_t
nas_enc_alg_id
,
const
uint8_t
key
[
32
],
uint8_t
**
out
);
int
nr_derive_key
(
algorithm_type_dist_t
alg_type
,
uint8_t
alg_id
,
const
uint8_t
key
[
32
],
uint8_t
**
out
);
//#define derive_key_nas_enc(aLGiD, kEY, kNAS) derive_key(NAS_ENC_ALG, aLGiD, kEY, kNAS)
...
...
@@ -72,6 +74,19 @@ int derive_key(algorithm_type_dist_t nas_alg_type, uint8_t nas_enc_alg_id,
#define derive_key_up_int(aLGiD, kEY, kNAS) \
derive_key(UP_INT_ALG, aLGiD, kEY, kNAS)
// 5G SA
#define nr_derive_key_rrc_enc(aLGiD, kEY, kRRC) \
nr_derive_key(RRC_ENC_ALG, aLGiD, kEY, kRRC)
#define nr_derive_key_rrc_int(aLGiD, kEY, kRRC) \
nr_derive_key(RRC_INT_ALG, aLGiD, kEY, kRRC)
#define nr_derive_key_up_enc(aLGiD, kEY, kUP) \
nr_derive_key(UP_ENC_ALG, aLGiD, kEY, kUP)
#define nr_derive_key_up_int(aLGiD, kEY, kUP) \
nr_derive_key(UP_INT_ALG, aLGiD, kEY, kUP)
typedef
struct
{
uint8_t
*
key
;
uint32_t
key_length
;
...
...
openair2/UTIL/OSA/osa_internal.h
View file @
598eeb79
...
...
@@ -36,6 +36,8 @@
#define FC_ALG_KEY_DER (0x15)
#define FC_KASME_TO_CK (0x16)
#define NR_FC_ALG_KEY_DER (0x69)
#ifndef hton_int32
# define hton_int32(x) \
(((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | \
...
...
openair2/UTIL/OSA/osa_key_deriver.c
View file @
598eeb79
...
...
@@ -97,6 +97,34 @@ int derive_key(algorithm_type_dist_t alg_type, uint8_t alg_id,
return
0
;
}
int
nr_derive_key
(
algorithm_type_dist_t
alg_type
,
uint8_t
alg_id
,
const
uint8_t
key
[
32
],
uint8_t
**
out
)
{
uint8_t
string
[
7
];
/* FC */
string
[
0
]
=
NR_FC_ALG_KEY_DER
;
/* P0 = algorithm type distinguisher */
string
[
1
]
=
(
uint8_t
)(
alg_type
&
0xFF
);
/* L0 = length(P0) = 1 */
string
[
2
]
=
0x00
;
string
[
3
]
=
0x01
;
/* P1 */
string
[
4
]
=
alg_id
;
/* L1 = length(P1) = 1 */
string
[
5
]
=
0x00
;
string
[
6
]
=
0x01
;
kdf
(
string
,
7
,
key
,
32
,
out
,
32
);
return
0
;
}
/*
int derive_keNB(const uint8_t key[32], const uint32_t nas_count, uint8_t **keNB)
{
...
...
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