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
f8f1723b
Commit
f8f1723b
authored
Dec 15, 2022
by
luis_pereira87
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Derive K_NG-RAN* key for RRCReestablishment
parent
c3d01306
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
27 deletions
+28
-27
openair2/UTIL/OSA/osa_defs.h
openair2/UTIL/OSA/osa_defs.h
+2
-0
openair2/UTIL/OSA/osa_internal.h
openair2/UTIL/OSA/osa_internal.h
+1
-0
openair2/UTIL/OSA/osa_key_deriver.c
openair2/UTIL/OSA/osa_key_deriver.c
+25
-27
No files found.
openair2/UTIL/OSA/osa_defs.h
View file @
f8f1723b
...
...
@@ -61,6 +61,8 @@ int derive_key(algorithm_type_dist_t nas_alg_type, uint8_t nas_enc_alg_id,
int
nr_derive_key
(
algorithm_type_dist_t
alg_type
,
uint8_t
alg_id
,
const
uint8_t
key
[
32
],
uint8_t
**
out
);
int
nr_derive_key_ng_ran_star
(
uint16_t
pci
,
uint64_t
nr_arfcn_dl
,
const
uint8_t
key
[
32
],
uint8_t
*
key_ng_ran_star
);
//#define derive_key_nas_enc(aLGiD, kEY, kNAS) derive_key(NAS_ENC_ALG, aLGiD, kEY, kNAS)
//#define derive_key_nas_int(aLGiD, kEY, kNAS) derive_key(NAS_INT_ALG, aLGiD, kEY, kNAS)
...
...
openair2/UTIL/OSA/osa_internal.h
View file @
f8f1723b
...
...
@@ -37,6 +37,7 @@
#define FC_KASME_TO_CK (0x16)
#define NR_FC_ALG_KEY_DER (0x69)
#define NR_FC_ALG_KEY_NG_RAN_STAR_DER (0x70)
#ifndef hton_int32
# define hton_int32(x) \
...
...
openair2/UTIL/OSA/osa_key_deriver.c
View file @
f8f1723b
...
...
@@ -127,40 +127,38 @@ int nr_derive_key(algorithm_type_dist_t alg_type, uint8_t alg_id,
return
0
;
}
/*
int derive_keNB(const uint8_t key[32], const uint32_t nas_count, uint8_t **keNB)
int
nr_derive_key_ng_ran_star
(
uint16_t
pci
,
uint64_t
nr_arfcn_dl
,
const
uint8_t
key
[
32
],
uint8_t
*
key_ng_ran_star
)
{
uint8_t string[7];
uint8_t
*
out
;
uint8_t
s
[
10
];
// FC
string[0] = FC_KENB;
// P0 = Uplink NAS count
string[1] = (nas_count & 0xff000000) >> 24;
string[2] = (nas_count & 0x00ff0000) >> 16;
string[3] = (nas_count & 0x0000ff00) >> 8;
string[4] = (nas_count & 0x000000ff);
/* FC */
s
[
0
]
=
NR_FC_ALG_KEY_NG_RAN_STAR_DER
;
// Length of NAS count
string[5] = 0x00
;
string[6] = 0x04
;
/* P0 = PCI */
s
[
1
]
=
(
pci
&
0x0000ff00
)
>>
8
;
s
[
2
]
=
(
pci
&
0x000000ff
)
;
#if defined(SECU_DEBUG)
{
int i;
char payload[6 * sizeof(string) + 1];
int index = 0;
for (i = 0; i < sizeof(string); i++)
index += sprintf(&payload[index], "0x%02x ", string[i]);
LOG_D(OSA, "KeNB deriver input string: %s\n", payload);
}
#endif
/* L0 = length(P0) = 2 */
s
[
3
]
=
0x00
;
s
[
4
]
=
0x02
;
/* P1 = NR ARFCN */
s
[
5
]
=
(
nr_arfcn_dl
&
0x00ff0000
)
>>
16
;
s
[
6
]
=
(
nr_arfcn_dl
&
0x0000ff00
)
>>
8
;
s
[
7
]
=
(
nr_arfcn_dl
&
0x000000ff
);
/* L1 = length(P1) = 3 */
s
[
8
]
=
0x00
;
s
[
9
]
=
0x03
;
kdf(string, 7, key, 32, keNB
, 32);
kdf
(
s
,
10
,
key
,
32
,
&
out
,
32
);
return 0;
memcpy
(
key_ng_ran_star
,
out
,
32
);
free
(
out
);
return
0
;
}
*/
int
derive_skgNB
(
const
uint8_t
*
keNB
,
const
uint16_t
sk_counter
,
uint8_t
*
skgNB
)
{
...
...
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