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
常顺宇
OpenXG-RAN
Commits
693364dd
Commit
693364dd
authored
Aug 29, 2020
by
Laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge develop
parent
a3367e58
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+4
-3
openair3/NAS/NR_UE/ue_process_nas.c
openair3/NAS/NR_UE/ue_process_nas.c
+41
-1
No files found.
executables/nr-uesoftmodem.c
View file @
693364dd
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "SCHED/sched_common_vars.h"
#include "SCHED/sched_common_vars.h"
#include "PHY/MODULATION/modulation_vars.h"
#include "PHY/MODULATION/modulation_vars.h"
//#include "../../SIMU/USER/init_lte.h"
//#include "../../SIMU/USER/init_lte.h"
#include "PHY/NR_REFSIG/nr_mod_table.h"
#include "LAYER2/MAC/mac_vars.h"
#include "LAYER2/MAC/mac_vars.h"
#include "RRC/LTE/rrc_vars.h"
#include "RRC/LTE/rrc_vars.h"
...
@@ -764,11 +765,11 @@ int main( int argc, char **argv ) {
...
@@ -764,11 +765,11 @@ int main( int argc, char **argv ) {
nr_user_nas_t
UErrc
=
{
0
};
nr_user_nas_t
UErrc
=
{
0
};
NRUEcontext_t
UEnas
=
{
0
};
NRUEcontext_t
UEnas
=
{
0
};
int
size
=
identityRequest
((
void
**
)
&
resp
,
&
UEnas
);
int
size
=
identityRequest
((
void
**
)
&
resp
,
&
UEnas
);
log_dump
(
NAS
,
resp
,
size
,
LOG_DUMP_CHAR
,
" identity Request:
\n
"
);
;
log_dump
(
NAS
,
resp
,
size
,
LOG_DUMP_CHAR
,
" identity Request:
\n
"
);
size
=
identityResponse
((
void
**
)
&
resp
,
&
UErrc
);
size
=
identityResponse
((
void
**
)
&
resp
,
&
UErrc
);
log_dump
(
NAS
,
resp
,
size
,
LOG_DUMP_CHAR
,
" identity Response:
\n
"
);
;
log_dump
(
NAS
,
resp
,
size
,
LOG_DUMP_CHAR
,
" identity Response:
\n
"
);
size
=
authenticationRequest
((
void
**
)
&
resp
,
&
UEnas
);
size
=
authenticationRequest
((
void
**
)
&
resp
,
&
UEnas
);
log_dump
(
NAS
,
resp
,
size
,
LOG_DUMP_CHAR
,
" authentication request:
\n
"
);
;
log_dump
(
NAS
,
resp
,
size
,
LOG_DUMP_CHAR
,
" authentication request:
\n
"
);
if
(
IS_SOFTMODEM_DOFORMS
)
{
if
(
IS_SOFTMODEM_DOFORMS
)
{
load_softscope
(
"nr"
,
PHY_vars_UE_g
[
0
][
0
]);
load_softscope
(
"nr"
,
PHY_vars_UE_g
[
0
][
0
]);
...
...
openair3/NAS/NR_UE/ue_process_nas.c
View file @
693364dd
...
@@ -2,6 +2,41 @@
...
@@ -2,6 +2,41 @@
#include <openair3/NAS/NR_UE/nr_user_def.h>
#include <openair3/NAS/NR_UE/nr_user_def.h>
#include <openair3/NAS/COMMON/milenage.h>
#include <openair3/NAS/COMMON/milenage.h>
void
servingNetworkName
(
uint8_t
*
msg
,
nr_user_nas_t
*
UE
)
{
//SNN-network-identifier in TS 24.501
// TS 24.501: If the MNC of the serving PLMN has two digits, then a zero is added at the beginning.
const
char
*
format
=
"5G:mnc000.mcc000.3gppnetwork.org"
;
memcpy
(
msg
,
format
,
strlen
(
format
));
if
(
UE
->
uicc
->
nmc_size
==
2
)
memcpy
(
msg
+
7
,
UE
->
uicc
->
imsiStr
+
3
,
2
);
else
memcpy
(
msg
+
6
,
UE
->
uicc
->
imsiStr
+
3
,
3
);
memcpy
(
msg
+
13
,
UE
->
uicc
->
imsiStr
,
3
);
}
xresToxresStar
(
uint8_t
*
msg
),
nr_user_nas_t
*
UE
{
// TS 33.220 annex B.2 => FC=0x6B in TS 33.501 annex A.4
//input S to KDF
uint8_t
S
[
64
]
=
{
0
};
S
[
0
]
=
0x6B
;
servingNetworkName
(
S
+
1
,
UE
);
*
(
uint16_t
*
)(
msg
+
strlen
(
msg
))
=
htons
(
strlen
(
msg
));
msg
+=
strlen
(
msg
)
+
sizeof
(
uint16_t
);
// add rand
memcpy
(
msg
,
UE
->
uicc
->
rand
,
sizeof
(
UE
->
uicc
->
rand
)
)
;
*
(
uint16_t
*
)(
msg
+
sizeof
(
UE
->
uicc
->
rand
))
=
htons
(
sizeof
(
UE
->
uicc
->
rand
));
msg
+=
sizeof
(
UE
->
uicc
->
rand
)
+
sizeof
(
uint16_t
);
msg
+=
strlen
(
msg
)
+
sizeof
(
uint16_t
);
// add xres
memcpy
(
msg
,
UE
->
uicc
->
xres
,
sizeof
(
UE
->
uicc
->
xres
)
)
;
*
(
uint16_t
*
)(
msg
+
sizeof
(
UE
->
uicc
->
xres
))
=
htons
(
sizeof
(
UE
->
uicc
->
xres
));
msg
+=
sizeof
(
UE
->
uicc
->
xres
)
+
sizeof
(
uint16_t
);
// S is done
}
void
SGSabortNet
(
void
*
msg
,
nr_user_nas_t
*
UE
)
{
void
SGSabortNet
(
void
*
msg
,
nr_user_nas_t
*
UE
)
{
}
}
...
@@ -16,6 +51,9 @@ void SGSauthenticationReq(void *msg, nr_user_nas_t *UE) {
...
@@ -16,6 +51,9 @@ void SGSauthenticationReq(void *msg, nr_user_nas_t *UE) {
authenticationrequestHeader_t
*
amsg
=
(
authenticationrequestHeader_t
*
)
msg
;
authenticationrequestHeader_t
*
amsg
=
(
authenticationrequestHeader_t
*
)
msg
;
arrayCpy
(
UE
->
uicc
->
rand
,
amsg
->
RAND
);
arrayCpy
(
UE
->
uicc
->
rand
,
amsg
->
RAND
);
arrayCpy
(
UE
->
uicc
->
autn
,
amsg
->
AUTN
);
arrayCpy
(
UE
->
uicc
->
autn
,
amsg
->
AUTN
);
// AUTHENTICATION REQUEST message that contains a valid ngKSI, SQN and MAC is received
// TBD verify ngKSI (we set it as '2', see gNB code)
// SQN and MAC are tested in auth resp processing
nas_schedule
();
nas_schedule
();
}
}
...
@@ -122,14 +160,16 @@ int authenticationResponse(void **msg,nr_user_nas_t *UE) {
...
@@ -122,14 +160,16 @@ int authenticationResponse(void **msg,nr_user_nas_t *UE) {
resp
->
sh
=
0
;
resp
->
sh
=
0
;
resp
->
mt
=
Authenticationresponse
;
resp
->
mt
=
Authenticationresponse
;
resp
->
iei
=
IEI_AuthenticationResponse
;
resp
->
iei
=
IEI_AuthenticationResponse
;
resp
->
RESlen
=
sizeof
(
resp
->
RES
);
resp
->
RESlen
=
sizeof
(
resp
->
RES
);
// always 16 see TS 24.501 Table 8.2.2.1.1
// Verify the AUTN
// Verify the AUTN
uint8_t
ik
[
16
],
ck
[
16
],
res
[
8
],
AUTN
[
16
];
uint8_t
ik
[
16
],
ck
[
16
],
res
[
8
],
AUTN
[
16
];
milenage_generate
(
UE
->
uicc
->
opc
,
UE
->
uicc
->
amf
,
UE
->
uicc
->
key
,
milenage_generate
(
UE
->
uicc
->
opc
,
UE
->
uicc
->
amf
,
UE
->
uicc
->
key
,
UE
->
uicc
->
sqn
,
UE
->
uicc
->
rand
,
AUTN
,
ik
,
ck
,
res
);
UE
->
uicc
->
sqn
,
UE
->
uicc
->
rand
,
AUTN
,
ik
,
ck
,
res
);
if
(
memcmp
(
UE
->
uicc
->
autn
,
AUTN
,
sizeof
(
AUTN
))
)
{
if
(
memcmp
(
UE
->
uicc
->
autn
,
AUTN
,
sizeof
(
AUTN
))
)
{
// prepare and send good answer
// prepare and send good answer
}
else
{
}
else
{
// prepare and send autn is not compatible with us
// prepare and send autn is not compatible with us
}
}
...
...
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