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
lizhongxiao
OpenXG-RAN
Commits
f557e8a6
Commit
f557e8a6
authored
Jun 22, 2023
by
Anton Kozhemiachenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nrUE: add EAP-AKA' support
parent
affb4dc8
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
409 additions
and
23 deletions
+409
-23
CMakeLists.txt
CMakeLists.txt
+1
-0
doc/Doxyfile
doc/Doxyfile
+2
-0
openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.c
openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.c
+19
-6
openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.h
openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.h
+11
-1
openair3/NAS/COMMON/IES/EapMessage.c
openair3/NAS/COMMON/IES/EapMessage.c
+94
-0
openair3/NAS/COMMON/IES/EapMessage.h
openair3/NAS/COMMON/IES/EapMessage.h
+44
-0
openair3/NAS/NR_UE/nr_nas_msg_sim.c
openair3/NAS/NR_UE/nr_nas_msg_sim.c
+235
-16
openair3/NAS/NR_UE/nr_nas_msg_sim.h
openair3/NAS/NR_UE/nr_nas_msg_sim.h
+3
-0
No files found.
CMakeLists.txt
View file @
f557e8a6
...
...
@@ -1794,6 +1794,7 @@ set(libnas_ies_OBJS
${
NAS_SRC
}
COMMON/IES/AuthenticationParameterAutn.c
${
NAS_SRC
}
COMMON/IES/AuthenticationParameterRand.c
${
NAS_SRC
}
COMMON/IES/AuthenticationResponseParameter.c
${
NAS_SRC
}
COMMON/IES/EapMessage.c
${
NAS_SRC
}
COMMON/IES/CipheringKeySequenceNumber.c
${
NAS_SRC
}
COMMON/IES/Cli.c
${
NAS_SRC
}
COMMON/IES/CsfbResponse.c
...
...
doc/Doxyfile
View file @
f557e8a6
...
...
@@ -1758,6 +1758,7 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TimeZoneAndTime.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/Cli.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EapMessage.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SORTransparentContainer.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSRegistrationType.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasRequestType.h \
...
...
@@ -1857,6 +1858,7 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ProtocolConfigurationOptions.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsQualityOfService.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EapMessage.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PdnType.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsMobileIdentity.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SupportedCodecList.c \
...
...
openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.c
View file @
f557e8a6
...
...
@@ -44,12 +44,25 @@ int encode_fgs_authentication_response(fgs_authentication_response_msg *authenti
int
encode_result
=
0
;
if
((
encode_result
=
encode_authentication_response_parameter
(
&
authentication_response
->
authenticationresponseparameter
,
AUTHENTICATION_RESPONSE_PARAMETER_IEI
,
buffer
+
encoded
,
len
-
encoded
))
<
0
)
//Return in case of error
return
encode_result
;
else
encoded
+=
encode_result
;
if
((
authentication_response
->
presencemask
&
FGS_AUTHENTICATION_RESPONSE_AUTH_RESPONSE_PARAM_PRESENT
)
==
FGS_AUTHENTICATION_RESPONSE_AUTH_RESPONSE_PARAM_PRESENT
)
{
if
((
encode_result
=
encode_authentication_response_parameter
(
&
authentication_response
->
authenticationresponseparameter
,
FGS_AUTHENTICATION_RESPONSE_AUTH_RESPONSE_PARAM_IEI
,
buffer
+
encoded
,
len
-
encoded
))
<
0
)
//Return in case of error
return
encode_result
;
else
encoded
+=
encode_result
;
}
if
((
authentication_response
->
presencemask
&
FGS_AUTHENTICATION_RESPONSE_EAP_MESSAGE_PRESENT
)
==
FGS_AUTHENTICATION_RESPONSE_EAP_MESSAGE_PRESENT
)
{
if
((
encode_result
=
encode_eap_message
(
&
authentication_response
->
eapmessage
,
FGS_AUTHENTICATION_RESPONSE_EAP_MESSAGE_IEI
,
buffer
+
encoded
,
len
-
encoded
))
<
0
)
//Return in case of error
return
encode_result
;
else
encoded
+=
encode_result
;
}
return
encoded
;
}
...
...
openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.h
View file @
f557e8a6
...
...
@@ -37,11 +37,18 @@
#include "SpareHalfOctet.h"
#include "MessageType.h"
#include "AuthenticationResponseParameter.h"
#include "EapMessage.h"
#ifndef FGS_AUTHENTICATION_RESPONSE_H_
#define FGS_AUTHENTICATION_RESPONSE_H_
#define AUTHENTICATION_RESPONSE_PARAMETER_IEI 0x2d
# define FGS_AUTHENTICATION_RESPONSE_AUTH_RESPONSE_PARAM_PRESENT (1<<0)
# define FGS_AUTHENTICATION_RESPONSE_EAP_MESSAGE_PRESENT (1<<1)
typedef
enum
fgs_authentication_response_iei_tag
{
FGS_AUTHENTICATION_RESPONSE_AUTH_RESPONSE_PARAM_IEI
=
0x2D
,
/* 0x2D = 45 */
FGS_AUTHENTICATION_RESPONSE_EAP_MESSAGE_IEI
=
0x78
,
/* 0x78 = 120 */
}
fgs_authentication_response_iei
;
/*
* Message name: Identity response
...
...
@@ -56,7 +63,10 @@ typedef struct fgs_authentication_response_msg_tag {
SecurityHeaderType
securityheadertype
:
4
;
SpareHalfOctet
sparehalfoctet
:
4
;
MessageType
messagetype
;
/* Optional fields */
uint32_t
presencemask
;
AuthenticationResponseParameter
authenticationresponseparameter
;
EapMessage
eapmessage
;
}
fgs_authentication_response_msg
;
int
encode_fgs_authentication_response
(
fgs_authentication_response_msg
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
);
...
...
openair3/NAS/COMMON/IES/EapMessage.c
0 → 100644
View file @
f557e8a6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "EapMessage.h"
int
decode_eap_message
(
EapMessage
*
eapmessage
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
decoded
=
0
;
uint16_t
ielen
=
0
;
int
decode_result
;
if
(
iei
>
0
)
{
CHECK_IEI_DECODER
(
iei
,
*
buffer
);
decoded
++
;
}
ielen
=
(
uint16_t
)(
*
(
buffer
+
decoded
)
<<
8
);
ielen
|=
(
uint16_t
)(
*
(
buffer
+
decoded
+
1
));
decoded
+=
2
;
CHECK_LENGTH_DECODER
(
len
-
decoded
,
ielen
);
if
((
decode_result
=
decode_octet_string
(
&
eapmessage
->
eapMsg
,
ielen
,
buffer
+
decoded
,
len
-
decoded
))
<
0
)
return
decode_result
;
else
decoded
+=
decode_result
;
#if defined (NAS_DEBUG)
dump_eap_message_xml
(
eapmessage
,
iei
);
#endif
return
decoded
;
}
int
encode_eap_message
(
EapMessage
*
eapmessage
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
uint16_t
ielen
=
0
;
uint8_t
*
lenPtr
;
uint32_t
encoded
=
0
;
int
encode_result
;
/* Checking IEI and pointer */
CHECK_PDU_POINTER_AND_LENGTH_ENCODER
(
buffer
,
EAP_MESSAGE_MINIMUM_LENGTH
,
len
);
#if defined (NAS_DEBUG)
dump_eap_message_xml
(
eapmessage
,
iei
);
#endif
if
(
iei
>
0
)
{
*
buffer
=
iei
;
encoded
++
;
}
lenPtr
=
(
buffer
+
encoded
);
encoded
+=
2
;
if
((
encode_result
=
encode_octet_string
(
&
eapmessage
->
eapMsg
,
buffer
+
encoded
,
len
-
encoded
))
<
0
)
return
encode_result
;
else
encoded
+=
encode_result
;
ielen
=
encoded
-
2
-
((
iei
>
0
)
?
1
:
0
);
*
lenPtr
=
(
uint8_t
)((
ielen
>>
8
)
&
0xFF
);
*
(
lenPtr
+
1
)
=
(
uint8_t
)(
ielen
&
0xFF
);
return
encoded
;
}
void
dump_eap_message_xml
(
EapMessage
*
eapmessage
,
uint8_t
iei
)
{
printf
(
"<EAP Message>
\n
"
);
dump_octet_string_xml
(
&
eapmessage
->
eapMsg
);
printf
(
"</EAP Message>
\n
"
);
}
openair3/NAS/COMMON/IES/EapMessage.h
0 → 100644
View file @
f557e8a6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "OctetString.h"
#ifndef EAP_MESSAGE_H_
#define EAP_MESSAGE_H_
#define EAP_MESSAGE_MINIMUM_LENGTH 7
#define EAP_MESSAGE_MAXIMUM_LENGTH 1503
typedef
struct
EapMessage_tag
{
OctetString
eapMsg
;
}
EapMessage
;
int
encode_eap_message
(
EapMessage
*
eapmessage
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_eap_message
(
EapMessage
*
eapmessage
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
void
dump_eap_message_xml
(
EapMessage
*
eapmessage
,
uint8_t
iei
);
#endif
/* EAP_MESSAGE_H_ */
openair3/NAS/NR_UE/nr_nas_msg_sim.c
View file @
f557e8a6
This diff is collapsed.
Click to expand it.
openair3/NAS/NR_UE/nr_nas_msg_sim.h
View file @
f557e8a6
...
...
@@ -103,6 +103,9 @@
/* Security Key for SA UE */
typedef
struct
{
uint8_t
mk
[
256
];
// EAP-AKA' master-key.
// PRF' produces as many bits of output as is needed,
// lets define 256 bytes MK.
uint8_t
kausf
[
32
];
uint8_t
kseaf
[
32
];
uint8_t
kamf
[
32
];
...
...
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