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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG-RAN
Commits
c59912d7
Commit
c59912d7
authored
3 years ago
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
Branches unavailable
2025.w14
2025.w13
2025.w12
2025.w11
2025.w10
2025.w09
2025.w08
2025.w07
2025.w06
2025.w05
2025.w04
2025.w03
2025.w02
2024.w51
2024.w50
2024.w49
2024.w48
2024.w47
2024.w46
2024.w45
2024.w44
2024.w43
2024.w42
2024.w41
2024.w40
2024.w39
2024.w38
2024.w36
2024.w35
2024.w34
2024.w33
2024.w32
2024.w31
2024.w30
2024.w29
2024.w28
2024.w27
2024.w26
2024.w25
2024.w24
2024.w23
2024.w22
2024.w21
2024.w18
2024.w17
2024.w16
2024.w15
2024.w14
2024.w13
2024.w12
2024.w11
2024.w10
2024.w09
2024.w08
2024.w06
2024.w05
2024.w04
2024.w03
2024.w02
2024.w01
2023.w51
2023.w50
2023.w49
2023.w48
2023.w47
2023.w45
2023.w43
2023.w42
2023.w41
2023.w40
2023.w39
2023.w38
2023.w37
2023.w36
2023.w34
2023.w33
2023.w32
2023.w31
2023.w30
2023.w29
2023.w28
2023.w27
2023.w26
2023.w25
2023.w24
2023.w23
2023.w22
2023.w21
2023.w20
2023.w19
2023.w18
2023.w18b
2023.w16
2023.w15
2023.w14
2023.w13
2023.w12
2023.w11
2023.w11b
2023.w10
2023.w10b
2023.w09
2023.w08
2023.w08b
2023.w07
2023.w06
2023.w05
2023.w03
2023.w02
2022.42
2022.41
2022.w51
2022.w50
2022.w49
2022.w48
2022.w47
2022.w46
2022.w45
2022.w43
2022.w42
2022.w42b
2022.w41
2022.w40
2022.w39
2022.w38
2022.w37
2022.w37b
2022.w36
2022.w35
2022.w33
2022.w32
2022.w31
2022.w31b
2022.w30
v2.2.0
v2.1.0
v2.0.0
flexran-eol
ARC_1.3
No related merge requests found
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
...
@@ -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_timer_thread.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_security_nea2.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_nia2.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/asn1_utils.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
set
(
NR_SDAP_SRC
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
View file @
c59912d7
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "nr_pdcp_security_nea2.h"
#include "nr_pdcp_security_nea2.h"
#include "nr_pdcp_integrity_nia2.h"
#include "nr_pdcp_integrity_nia2.h"
#include "nr_pdcp_integrity_nia1.h"
#include "nr_pdcp_sdu.h"
#include "nr_pdcp_sdu.h"
#include "LOG/log.h"
#include "LOG/log.h"
...
@@ -240,16 +241,21 @@ static void nr_pdcp_entity_set_security(nr_pdcp_entity_t *entity,
...
@@ -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
!=
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
;
entity
->
has_integrity
=
1
;
if
(
entity
->
free_integrity
!=
NULL
)
if
(
entity
->
free_integrity
!=
NULL
)
entity
->
free_integrity
(
entity
->
integrity_context
);
entity
->
free_integrity
(
entity
->
integrity_context
);
entity
->
integrity_context
=
nr_pdcp_integrity_nia2_init
(
entity
->
integrity_key
);
if
(
integrity_algorithm
==
2
)
{
entity
->
integrity
=
nr_pdcp_integrity_nia2_integrity
;
entity
->
integrity_context
=
nr_pdcp_integrity_nia2_init
(
entity
->
integrity_key
);
entity
->
free_integrity
=
nr_pdcp_integrity_nia2_free_integrity
;
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
)
{
if
(
ciphering_algorithm
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
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
);
}
This diff is collapsed.
Click to expand it.
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_ */
This diff is collapsed.
Click to expand it.
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