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
Michael Black
OpenXG-RAN
Commits
4f36249c
Commit
4f36249c
authored
Feb 16, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feat-5g-ue-imeisv-16-digits' into integration_2023_w07
parents
99bfac9c
eca08df8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
13 deletions
+92
-13
openair3/NAS/COMMON/IES/FGSMobileIdentity.c
openair3/NAS/COMMON/IES/FGSMobileIdentity.c
+16
-3
openair3/NAS/COMMON/IES/FGSMobileIdentity.h
openair3/NAS/COMMON/IES/FGSMobileIdentity.h
+21
-1
openair3/NAS/NR_UE/nr_nas_msg_sim.c
openair3/NAS/NR_UE/nr_nas_msg_sim.c
+28
-6
openair3/UICC/usim_interface.c
openair3/UICC/usim_interface.c
+25
-3
openair3/UICC/usim_interface.h
openair3/UICC/usim_interface.h
+2
-0
No files found.
openair3/NAS/COMMON/IES/FGSMobileIdentity.c
View file @
4f36249c
...
@@ -235,10 +235,23 @@ static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_
...
@@ -235,10 +235,23 @@ static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_
static
int
encode_imeisv_5gs_mobile_identity
(
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
)
static
int
encode_imeisv_5gs_mobile_identity
(
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
)
{
{
uint32_t
encoded
=
0
;
uint32_t
encoded
=
0
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digit1
<<
4
)
|
(
imeisv
->
oddeven
<<
3
)
|
(
imeisv
->
typeofidentity
);
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digit
tac0
1
<<
4
)
|
(
imeisv
->
oddeven
<<
3
)
|
(
imeisv
->
typeofidentity
);
encoded
++
;
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digittac03
<<
4
)
|
(
imeisv
->
digittac02
);
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digitp1
<<
4
)
|
(
imeisv
->
digitp
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digittac05
<<
4
)
|
(
imeisv
->
digittac04
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digittac07
<<
4
)
|
(
imeisv
->
digittac06
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digit09
<<
4
)
|
(
imeisv
->
digittac08
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digit11
<<
4
)
|
(
imeisv
->
digit10
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digit13
<<
4
)
|
(
imeisv
->
digit12
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digitsv1
<<
4
)
|
(
imeisv
->
digit14
);
encoded
++
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
spare
<<
4
)
|
(
imeisv
->
digitsv2
);
encoded
++
;
encoded
++
;
return
encoded
;
return
encoded
;
...
...
openair3/NAS/COMMON/IES/FGSMobileIdentity.h
View file @
4f36249c
...
@@ -92,7 +92,27 @@ typedef struct {
...
@@ -92,7 +92,27 @@ typedef struct {
uint8_t
digitp
:
4
;
uint8_t
digitp
:
4
;
}
Imei5GSMobileIdentity_t
;
}
Imei5GSMobileIdentity_t
;
typedef
Imei5GSMobileIdentity_t
Imeisv5GSMobileIdentity_t
;
typedef
struct
{
uint8_t
digittac01
:
4
;
uint8_t
oddeven
:
1
;
uint8_t
typeofidentity
:
3
;
uint8_t
digittac02
:
4
;
uint8_t
digittac03
:
4
;
uint8_t
digittac04
:
4
;
uint8_t
digittac05
:
4
;
uint8_t
digittac06
:
4
;
uint8_t
digittac07
:
4
;
uint8_t
digittac08
:
4
;
uint8_t
digit09
:
4
;
uint8_t
digit10
:
4
;
uint8_t
digit11
:
4
;
uint8_t
digit12
:
4
;
uint8_t
digit13
:
4
;
uint8_t
digit14
:
4
;
uint8_t
digitsv1
:
4
;
uint8_t
digitsv2
:
4
;
uint8_t
spare
:
4
;
}
Imeisv5GSMobileIdentity_t
;
typedef
struct
{
typedef
struct
{
...
...
openair3/NAS/NR_UE/nr_nas_msg_sim.c
View file @
4f36249c
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* \email yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
* \email yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
* \date 2020
* \date 2020
* \version 0.1
* \version 0.1
*
* 2023.01.27 Vladimir Dorovskikh 16 digits IMEISV
*/
*/
...
@@ -533,6 +535,31 @@ int nas_itti_kgnb_refresh_req(const uint8_t kgnb[32], int instance) {
...
@@ -533,6 +535,31 @@ int nas_itti_kgnb_refresh_req(const uint8_t kgnb[32], int instance) {
return
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
instance
,
message_p
);
return
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
instance
,
message_p
);
}
}
static
int
addImeisv
(
int
Mod_id
,
MM_msg
*
mm_msg
)
{
int
i
=
0
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
typeofidentity
=
FGS_MOBILE_IDENTITY_IMEISV
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac01
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac02
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac03
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac04
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac05
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac06
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac07
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digittac08
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit09
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit10
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit11
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit12
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit13
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit14
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digitsv1
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digitsv2
=
getImeisvDigit
(
Mod_id
,
i
++
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
spare
=
0x0f
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
oddeven
=
1
;
return
19
;
}
static
void
generateSecurityModeComplete
(
int
Mod_id
,
as_nas_info_t
*
initialNasMsg
)
static
void
generateSecurityModeComplete
(
int
Mod_id
,
as_nas_info_t
*
initialNasMsg
)
{
{
int
size
=
sizeof
(
mm_msg_header_t
);
int
size
=
sizeof
(
mm_msg_header_t
);
...
@@ -562,12 +589,7 @@ static void generateSecurityModeComplete(int Mod_id,as_nas_info_t *initialNasMsg
...
@@ -562,12 +589,7 @@ static void generateSecurityModeComplete(int Mod_id,as_nas_info_t *initialNasMsg
mm_msg
->
fgs_security_mode_complete
.
messagetype
=
FGS_SECURITY_MODE_COMPLETE
;
mm_msg
->
fgs_security_mode_complete
.
messagetype
=
FGS_SECURITY_MODE_COMPLETE
;
size
+=
1
;
size
+=
1
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
typeofidentity
=
FGS_MOBILE_IDENTITY_IMEISV
;
size
+=
addImeisv
(
Mod_id
,
mm_msg
);
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digit1
=
1
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digitp1
=
1
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
digitp
=
1
;
mm_msg
->
fgs_security_mode_complete
.
fgsmobileidentity
.
imeisv
.
oddeven
=
0
;
size
+=
5
;
mm_msg
->
fgs_security_mode_complete
.
fgsnasmessagecontainer
.
nasmessagecontainercontents
.
value
=
registration_request_buf
;
mm_msg
->
fgs_security_mode_complete
.
fgsnasmessagecontainer
.
nasmessagecontainercontents
.
value
=
registration_request_buf
;
mm_msg
->
fgs_security_mode_complete
.
fgsnasmessagecontainer
.
nasmessagecontainercontents
.
length
=
registration_request_len
;
mm_msg
->
fgs_security_mode_complete
.
fgsnasmessagecontainer
.
nasmessagecontainercontents
.
length
=
registration_request_len
;
...
...
openair3/UICC/usim_interface.c
View file @
4f36249c
...
@@ -27,10 +27,12 @@
...
@@ -27,10 +27,12 @@
extern
uint16_t
NB_UE_INST
;
extern
uint16_t
NB_UE_INST
;
#define UICC_SECTION "uicc"
#define UICC_SECTION "uicc"
#define IMEISV_STR_MAX_LENGTH 16
#define UICC_CONFIG_HELP_OPTIONS " list of comma separated options to interface a simulated (real UICC to be developped). Available options: \n"\
#define UICC_CONFIG_HELP_OPTIONS " list of comma separated options to interface a simulated (real UICC to be developped). Available options: \n"\
" imsi: user imsi\n"\
" imsi: user imsi\n"\
" key: cyphering key\n"\
" key: cyphering key\n"\
" opc: cyphering OPc\n"
" opc: cyphering OPc\n"\
" imiesv: string with IMEISV value\n"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* configuration parameters for the rfsimulator device */
/* configuration parameters for the rfsimulator device */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
...
@@ -45,6 +47,7 @@ extern uint16_t NB_UE_INST;
...
@@ -45,6 +47,7 @@ extern uint16_t NB_UE_INST;
{"dnn", "UE dnn (apn)\n", 0, strptr:&uicc->dnnStr, defstrval:"oai", TYPE_STRING, 0 }, \
{"dnn", "UE dnn (apn)\n", 0, strptr:&uicc->dnnStr, defstrval:"oai", TYPE_STRING, 0 }, \
{"nssai_sst", "UE nssai\n", 0, iptr:&uicc->nssai_sst, defintval:1, TYPE_INT, 0 }, \
{"nssai_sst", "UE nssai\n", 0, iptr:&uicc->nssai_sst, defintval:1, TYPE_INT, 0 }, \
{"nssai_sd", "UE nssai\n", 0, iptr:&uicc->nssai_sd, defintval:0xffffff, TYPE_INT, 0 }, \
{"nssai_sd", "UE nssai\n", 0, iptr:&uicc->nssai_sd, defintval:0xffffff, TYPE_INT, 0 }, \
{"imeisv", "IMEISV\n", 0, strptr:&uicc->imeisvStr, defstrval:"6754567890123413", TYPE_STRING, 0 }, \
};
};
static
uicc_t
**
uiccArray
=
NULL
;
static
uicc_t
**
uiccArray
=
NULL
;
...
@@ -74,8 +77,8 @@ uicc_t *init_uicc(char *sectionName) {
...
@@ -74,8 +77,8 @@ uicc_t *init_uicc(char *sectionName) {
int
ret
=
config_get
(
uicc_params
,
sizeof
(
uicc_params
)
/
sizeof
(
paramdef_t
),
sectionName
);
int
ret
=
config_get
(
uicc_params
,
sizeof
(
uicc_params
)
/
sizeof
(
paramdef_t
),
sectionName
);
AssertFatal
(
ret
>=
0
,
"configuration couldn't be performed for uicc name: %s"
,
sectionName
);
AssertFatal
(
ret
>=
0
,
"configuration couldn't be performed for uicc name: %s"
,
sectionName
);
LOG_I
(
SIM
,
LOG_I
(
SIM
,
"UICC simulation: IMSI=%s, Ki=%s, OPc=%s, DNN=%s, SST=0x%02x, SD=0x%06x
\n
"
,
"UICC simulation: IMSI=%s,
IMEISV=%s,
Ki=%s, OPc=%s, DNN=%s, SST=0x%02x, SD=0x%06x
\n
"
,
uicc
->
imsiStr
,
uicc
->
keyStr
,
uicc
->
opcStr
,
uicc
->
imsiStr
,
uicc
->
imeisvStr
,
uicc
->
keyStr
,
uicc
->
opcStr
,
uicc
->
dnnStr
,
uicc
->
nssai_sst
,
uicc
->
nssai_sd
);
uicc
->
dnnStr
,
uicc
->
nssai_sst
,
uicc
->
nssai_sd
);
to_hex
(
uicc
->
keyStr
,
uicc
->
key
,
sizeof
(
uicc
->
key
)
);
to_hex
(
uicc
->
keyStr
,
uicc
->
key
,
sizeof
(
uicc
->
key
)
);
to_hex
(
uicc
->
opcStr
,
uicc
->
opc
,
sizeof
(
uicc
->
opc
)
);
to_hex
(
uicc
->
opcStr
,
uicc
->
opc
,
sizeof
(
uicc
->
opc
)
);
...
@@ -112,3 +115,22 @@ uicc_t * checkUicc(int Mod_id) {
...
@@ -112,3 +115,22 @@ uicc_t * checkUicc(int Mod_id) {
}
}
return
(
uicc_t
*
)
uiccArray
[
Mod_id
];
return
(
uicc_t
*
)
uiccArray
[
Mod_id
];
}
}
uint8_t
getImeisvDigit
(
int
Mod_id
,
uint8_t
i
)
{
uicc_t
*
uicc
=
checkUicc
(
Mod_id
);
uint8_t
r
=
0
;
uint8_t
l
=
strlen
(
uicc
->
imeisvStr
);
if
(
l
>
IMEISV_STR_MAX_LENGTH
)
{
l
=
IMEISV_STR_MAX_LENGTH
;
}
if
((
uicc
->
imeisvStr
!=
NULL
)
&&
(
i
<
l
))
{
char
c
=
uicc
->
imeisvStr
[
i
];
if
(
isdigit
(
c
))
{
r
=
c
-
'0'
;
}
}
return
(
0x0f
&
r
);
}
\ No newline at end of file
openair3/UICC/usim_interface.h
View file @
4f36249c
...
@@ -45,6 +45,7 @@ So, RES can be either milenage res, or received response, so hash of milenage re
...
@@ -45,6 +45,7 @@ So, RES can be either milenage res, or received response, so hash of milenage re
typedef
struct
{
typedef
struct
{
char
*
imsiStr
;
char
*
imsiStr
;
char
*
imeisvStr
;
char
*
keyStr
;
char
*
keyStr
;
char
*
opcStr
;
char
*
opcStr
;
char
*
amfStr
;
char
*
amfStr
;
...
@@ -73,4 +74,5 @@ uicc_t *checkUicc(int Mod_id);
...
@@ -73,4 +74,5 @@ uicc_t *checkUicc(int Mod_id);
uicc_t
*
init_uicc
(
char
*
sectionName
);
uicc_t
*
init_uicc
(
char
*
sectionName
);
void
uicc_milenage_generate
(
uint8_t
*
autn
,
uicc_t
*
uicc
);
void
uicc_milenage_generate
(
uint8_t
*
autn
,
uicc_t
*
uicc
);
uicc_t
*
checkUicc
(
int
Mod_id
);
uicc_t
*
checkUicc
(
int
Mod_id
);
uint8_t
getImeisvDigit
(
int
Mod_id
,
uint8_t
i
);
#endif
#endif
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