Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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 UE
Commits
a265e2e8
Commit
a265e2e8
authored
Jul 13, 2016
by
Frédéric Leroy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE/EMM: move _security_data to nas_user_t
parent
8230f94f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
16 deletions
+31
-16
openair3/NAS/UE/EMM/SecurityModeControl.c
openair3/NAS/UE/EMM/SecurityModeControl.c
+11
-16
openair3/NAS/UE/EMM/SecurityModeControl.h
openair3/NAS/UE/EMM/SecurityModeControl.h
+11
-0
openair3/NAS/UE/nas_proc.c
openair3/NAS/UE/nas_proc.c
+7
-0
openair3/NAS/UE/user_defs.h
openair3/NAS/UE/user_defs.h
+2
-0
No files found.
openair3/NAS/UE/EMM/SecurityModeControl.c
View file @
a265e2e8
...
...
@@ -64,6 +64,7 @@ Description Defines the security mode control EMM procedure executed by the
# include "assertions.h"
#include "secu_defs.h"
#include "msc.h"
#include "SecurityModeControl.h"
#if defined(NAS_BUILT_IN_UE)
#include "nas_itti_messaging.h"
...
...
@@ -92,13 +93,6 @@ static int _security_knas_int(const OctetString *kasme, OctetString *knas_int,
static
int
_security_kenb
(
const
OctetString
*
kasme
,
OctetString
*
kenb
,
uint32_t
count
);
/*
* Internal data used for security mode control procedure
*/
static
struct
{
OctetString
kenb
;
/* eNodeB security key */
}
_security_data
;
static
void
_security_release
(
emm_security_context_t
*
ctx
);
/*
...
...
@@ -153,6 +147,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
int
rc
=
RETURNerror
;
int
emm_cause
=
EMM_CAUSE_SUCCESS
;
int
security_context_is_new
=
FALSE
;
security_data_t
*
security_data
=
user
->
security_data
;
LOG_TRACE
(
INFO
,
"EMM-PROC - Security mode control requested (ksi=%d)"
,
ksi
);
...
...
@@ -226,17 +221,17 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
}
/* Derive the eNodeB key */
if
(
_security_data
.
kenb
.
value
==
NULL
)
{
_security_data
.
kenb
.
value
=
(
uint8_t
*
)
calloc
(
1
,
AUTH_KENB_SIZE
);
_security_data
.
kenb
.
length
=
AUTH_KENB_SIZE
;
if
(
security_data
->
kenb
.
value
==
NULL
)
{
security_data
->
kenb
.
value
=
(
uint8_t
*
)
calloc
(
1
,
AUTH_KENB_SIZE
);
security_data
->
kenb
.
length
=
AUTH_KENB_SIZE
;
}
if
(
_security_data
.
kenb
.
value
!=
NULL
)
{
if
(
security_data
->
kenb
.
value
!=
NULL
)
{
if
(
rc
!=
RETURNerror
)
{
LOG_TRACE
(
INFO
,
"EMM-PROC - Update the non-current EPS security context kenb"
);
// LG COMMENT rc = _security_kenb(&user->emm_data->security->kasme,
rc
=
_security_kenb
(
&
user
->
emm_data
->
non_current
->
kasme
,
&
_security_data
.
kenb
,
&
security_data
->
kenb
,
*
(
uint32_t
*
)(
&
user
->
emm_data
->
non_current
->
ul_count
));
}
}
...
...
@@ -303,10 +298,10 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
emm_cause
=
EMM_CAUSE_SECURITY_MODE_REJECTED
;
/* Release security mode control internal data */
if
(
_security_data
.
kenb
.
value
)
{
free
(
_security_data
.
kenb
.
value
);
_security_data
.
kenb
.
value
=
NULL
;
_security_data
.
kenb
.
length
=
0
;
if
(
security_data
->
kenb
.
value
)
{
free
(
security_data
->
kenb
.
value
);
security_data
->
kenb
.
value
=
NULL
;
security_data
->
kenb
.
length
=
0
;
}
}
}
...
...
openair3/NAS/UE/EMM/SecurityModeControl.h
0 → 100644
View file @
a265e2e8
#ifndef _SECURITYMODECONTROL_H
#define _SECURITYMODECONTROL_H
/*
* Internal data used for security mode control procedure
*/
typedef
struct
{
OctetString
kenb
;
/* eNodeB security key */
}
security_data_t
;
#endif
openair3/NAS/UE/nas_proc.c
View file @
a265e2e8
...
...
@@ -102,6 +102,13 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
LOG_TRACE
(
ERROR
,
"NAS-PROC - Failed to alloc authentication_data"
);
// FIXME stop here
}
user
->
security_data
=
calloc
(
1
,
sizeof
(
security_data_t
));
if
(
user
->
security_data
==
NULL
)
{
LOG_TRACE
(
ERROR
,
"NAS-PROC - Failed to alloc security_data"
);
// FIXME stop here
}
/* Initialize the EMM procedure manager */
emm_main_initialize
(
user
,
emm_cb
,
imei
);
...
...
openair3/NAS/UE/user_defs.h
View file @
a265e2e8
...
...
@@ -53,6 +53,7 @@ Description NAS type definition to manage a user equipment
#include "EMM/Authentication.h"
#include "EMM/IdleMode_defs.h"
#include "API/USIM/usim_api.h"
#include "SecurityModeControl.h"
typedef
struct
{
int
fd
;
...
...
@@ -66,6 +67,7 @@ typedef struct {
emm_data_t
*
emm_data
;
// EPS mobility management data
emm_plmn_list_t
*
emm_plmn_list
;
// list of PLMN identities
authentication_data_t
*
authentication_data
;
security_data_t
*
security_data
;
//Internal data used for security mode control procedure
// Hardware persistent storage
usim_data_t
usim_data
;
// USIM application data
}
nas_user_t
;
...
...
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