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
c59912d7
Commit
c59912d7
authored
Jul 26, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/nr-pdcp-nia1' into integration_2022_wk30
parents
a20a6ba4
667b8e5e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
7 deletions
+121
-7
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+8
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
+13
-7
openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
+66
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.h
openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.h
+34
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
c59912d7
...
...
@@ -1804,7 +1804,15 @@ set(NR_PDCP_SRC
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_security_nea2.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_integrity_nia2.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/asn1_utils.c
#hack: include these files to compile the nr phy simulators
#these files should not be here, will be removed at some point when the
#computation is done directly inside nr_pdcp_integrity_nia1.c instead
#of reusing code of osa_stream_eia.c
${
OPENAIR2_DIR
}
/UTIL/OSA/osa_stream_eia.c
${
OPENAIR2_DIR
}
/UTIL/OSA/osa_snow3g.c
${
OPENAIR2_DIR
}
/UTIL/OSA/osa_rijndael.c
)
set
(
NR_SDAP_SRC
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
View file @
c59912d7
...
...
@@ -27,6 +27,7 @@
#include "nr_pdcp_security_nea2.h"
#include "nr_pdcp_integrity_nia2.h"
#include "nr_pdcp_integrity_nia1.h"
#include "nr_pdcp_sdu.h"
#include "LOG/log.h"
...
...
@@ -240,16 +241,21 @@ static void nr_pdcp_entity_set_security(nr_pdcp_entity_t *entity,
}
if
(
integrity_algorithm
!=
0
&&
integrity_algorithm
!=
-
1
)
{
if
(
integrity_algorithm
!=
2
)
{
LOG_E
(
PDCP
,
"FATAL: only nia2 supported for the moment
\n
"
);
exit
(
1
);
}
entity
->
has_integrity
=
1
;
if
(
entity
->
free_integrity
!=
NULL
)
entity
->
free_integrity
(
entity
->
integrity_context
);
entity
->
integrity_context
=
nr_pdcp_integrity_nia2_init
(
entity
->
integrity_key
);
entity
->
integrity
=
nr_pdcp_integrity_nia2_integrity
;
entity
->
free_integrity
=
nr_pdcp_integrity_nia2_free_integrity
;
if
(
integrity_algorithm
==
2
)
{
entity
->
integrity_context
=
nr_pdcp_integrity_nia2_init
(
entity
->
integrity_key
);
entity
->
integrity
=
nr_pdcp_integrity_nia2_integrity
;
entity
->
free_integrity
=
nr_pdcp_integrity_nia2_free_integrity
;
}
else
if
(
integrity_algorithm
==
1
)
{
entity
->
integrity_context
=
nr_pdcp_integrity_nia1_init
(
entity
->
integrity_key
);
entity
->
integrity
=
nr_pdcp_integrity_nia1_integrity
;
entity
->
free_integrity
=
nr_pdcp_integrity_nia1_free_integrity
;
}
else
{
LOG_E
(
PDCP
,
"FATAL: only nia1 and nia2 supported for the moment
\n
"
);
exit
(
1
);
}
}
if
(
ciphering_algorithm
==
0
)
{
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
0 → 100644
View file @
c59912d7
/*
* 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 "nr_pdcp_integrity_nia1.h"
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <openssl/cmac.h>
#include "UTIL/OSA/osa_defs.h"
int
stream_compute_integrity_eia1
(
stream_cipher_t
*
stream_cipher
,
uint8_t
out
[
4
]);
void
*
nr_pdcp_integrity_nia1_init
(
unsigned
char
*
integrity_key
)
{
stream_cipher_t
*
ret
;
ret
=
calloc
(
1
,
sizeof
(
*
ret
));
if
(
ret
==
NULL
)
abort
();
ret
->
key
=
malloc
(
16
);
if
(
ret
->
key
==
NULL
)
abort
();
memcpy
(
ret
->
key
,
integrity_key
,
16
);
ret
->
key_length
=
16
;
/* unused */
return
ret
;
}
void
nr_pdcp_integrity_nia1_integrity
(
void
*
integrity_context
,
unsigned
char
*
out
,
unsigned
char
*
buffer
,
int
length
,
int
bearer
,
int
count
,
int
direction
)
{
stream_cipher_t
*
ctx
=
integrity_context
;
ctx
->
message
=
buffer
;
ctx
->
count
=
count
;
ctx
->
bearer
=
bearer
-
1
;
ctx
->
direction
=
direction
;
ctx
->
blength
=
length
*
8
;
stream_compute_integrity_eia1
(
ctx
,
out
);
}
void
nr_pdcp_integrity_nia1_free_integrity
(
void
*
integrity_context
)
{
stream_cipher_t
*
ctx
=
integrity_context
;
free
(
ctx
->
key
);
free
(
ctx
);
}
openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.h
0 → 100644
View file @
c59912d7
/*
* 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
*/
#ifndef _NR_PDCP_INTEGRITY_NIA1_H_
#define _NR_PDCP_INTEGRITY_NIA1_H_
void
*
nr_pdcp_integrity_nia1_init
(
unsigned
char
*
integrity_key
);
void
nr_pdcp_integrity_nia1_integrity
(
void
*
integrity_context
,
unsigned
char
*
out
,
unsigned
char
*
buffer
,
int
length
,
int
bearer
,
int
count
,
int
direction
);
void
nr_pdcp_integrity_nia1_free_integrity
(
void
*
integrity_context
);
#endif
/* _NR_PDCP_INTEGRITY_NIA1_H_ */
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