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
566dc011
Commit
566dc011
authored
Oct 15, 2015
by
gauthier
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into feature-34-test_framework
parents
d0680b00
b6f88142
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
27 deletions
+35
-27
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-1
cmake_targets/build_oai
cmake_targets/build_oai
+8
-4
openair3/TEST/test_kdf.c
openair3/TEST/test_kdf.c
+2
-2
openair3/TEST/test_secu_kenb.c
openair3/TEST/test_secu_kenb.c
+3
-3
openair3/TEST/test_secu_knas.c
openair3/TEST/test_secu_knas.c
+9
-7
openair3/TEST/test_secu_knas_encrypt_eea1.c
openair3/TEST/test_secu_knas_encrypt_eea1.c
+6
-5
openair3/TEST/test_secu_knas_encrypt_eea2.c
openair3/TEST/test_secu_knas_encrypt_eea2.c
+6
-5
No files found.
cmake_targets/CMakeLists.txt
View file @
566dc011
...
@@ -1649,7 +1649,7 @@ foreach(myExe s1ap
...
@@ -1649,7 +1649,7 @@ foreach(myExe s1ap
${
OPENAIR3_DIR
}
/TEST/test_
${
myExe
}
.c
${
OPENAIR3_DIR
}
/TEST/test_
${
myExe
}
.c
)
)
target_link_libraries
(
test_
${
myExe
}
target_link_libraries
(
test_
${
myExe
}
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
${
CONFIG_LIBRARIES
}
fdproto fdcore
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
${
CONFIG_LIBRARIES
}
)
)
endforeach
(
myExe
)
endforeach
(
myExe
)
...
...
cmake_targets/build_oai
View file @
566dc011
...
@@ -262,10 +262,14 @@ function main() {
...
@@ -262,10 +262,14 @@ function main() {
if
[
"
$INSTALL_EXTERNAL
"
=
"1"
]
;
then
if
[
"
$INSTALL_EXTERNAL
"
=
"1"
]
;
then
echo_info
"Installing packages"
echo_info
"Installing packages"
check_install_oai_software
check_install_oai_software
echo_info
"installing packages for USRP support"
if
[
"
$HW
"
==
"OAI_USRP"
]
;
then
check_install_usrp_uhd_driver
echo_info
"installing packages for USRP support"
echo_info
"installing packages for BALDERF support"
check_install_usrp_uhd_driver
check_install_bladerf_driver
fi
if
[
"
$HW
"
==
"OAI_BLADERF"
]
;
then
echo_info
"installing packages for BALDERF support"
check_install_bladerf_driver
fi
fi
fi
if
[
"
$INSTALL_OPTIONAL
"
=
"1"
]
;
then
if
[
"
$INSTALL_OPTIONAL
"
=
"1"
]
;
then
...
...
openair3/TEST/test_kdf.c
View file @
566dc011
...
@@ -42,9 +42,9 @@ static
...
@@ -42,9 +42,9 @@ static
void
do_kdf
(
uint8_t
*
key
,
unsigned
key_length
,
uint8_t
*
data
,
unsigned
data_length
,
void
do_kdf
(
uint8_t
*
key
,
unsigned
key_length
,
uint8_t
*
data
,
unsigned
data_length
,
uint8_t
*
exp
,
unsigned
exp_length
)
uint8_t
*
exp
,
unsigned
exp_length
)
{
{
uint8_t
*
result
;
uint8_t
result
[
32
]
;
kdf
(
key
,
key_length
,
data
,
data_length
,
&
result
,
32
);
kdf
(
key
,
key_length
,
data
,
data_length
,
result
,
32
);
if
(
compare_buffer
(
result
,
exp_length
,
exp
,
exp_length
)
!=
0
)
{
if
(
compare_buffer
(
result
,
exp_length
,
exp
,
exp_length
)
!=
0
)
{
fail
(
"Fail: kdf
\n
"
);
fail
(
"Fail: kdf
\n
"
);
...
...
openair3/TEST/test_secu_kenb.c
View file @
566dc011
...
@@ -39,15 +39,15 @@ static
...
@@ -39,15 +39,15 @@ static
void
do_derive_kenb
(
uint32_t
nas_count
,
const
uint8_t
*
kasme
,
const
unsigned
length
,
void
do_derive_kenb
(
uint32_t
nas_count
,
const
uint8_t
*
kasme
,
const
unsigned
length
,
const
uint8_t
*
kenb_exp
)
const
uint8_t
*
kenb_exp
)
{
{
uint8_t
*
kenb
;
uint8_t
kenb
[
32
]
;
derive_keNB
(
kasme
,
nas_count
,
&
kenb
);
memset
(
kenb
,
0
,
sizeof
(
kenb
));
derive_keNB
(
kasme
,
nas_count
,
kenb
);
if
(
compare_buffer
(
kenb_exp
,
length
,
kenb
,
length
)
!=
0
)
{
if
(
compare_buffer
(
kenb_exp
,
length
,
kenb
,
length
)
!=
0
)
{
fail
(
"Fail: kenb derivation
\n
"
);
fail
(
"Fail: kenb derivation
\n
"
);
}
}
free
(
kenb
);
}
}
void
doit
(
void
)
void
doit
(
void
)
...
...
openair3/TEST/test_secu_knas.c
View file @
566dc011
...
@@ -39,21 +39,23 @@ static
...
@@ -39,21 +39,23 @@ static
void
derive_knas_keys
(
algorithm_type_dist_t
atd
,
uint8_t
*
kasme
,
unsigned
length
,
void
derive_knas_keys
(
algorithm_type_dist_t
atd
,
uint8_t
*
kasme
,
unsigned
length
,
uint8_t
*
knas_enc_exp
,
uint8_t
*
knas_int_exp
)
uint8_t
*
knas_enc_exp
,
uint8_t
*
knas_int_exp
)
{
{
uint8_t
*
knas_enc
;
uint8_t
*
knas_enc
=
NULL
;
uint8_t
*
knas_int
;
uint8_t
*
knas_int
=
NULL
;
derive_key_nas_enc
(
atd
,
kasme
,
&
knas_enc
);
knas_enc
=
calloc
(
1
,
32
);
derive_key_nas_int
(
atd
,
kasme
,
&
knas_int
);
knas_int
=
calloc
(
1
,
32
);
derive_key_nas_enc
(
atd
,
kasme
,
knas_enc
);
derive_key_nas_int
(
atd
,
kasme
,
knas_int
);
/* Compare both keys with expected */
/* Compare both keys with expected */
if
(
compare_buffer
(
knas_enc
,
32
,
knas_enc_exp
,
32
)
!=
0
)
{
if
(
compare_buffer
(
knas_enc
,
16
,
&
knas_enc_exp
[
16
],
16
)
!=
0
)
{
fail
(
"Fail: knas_enc derivation
\n
"
);
fail
(
"Fail: knas_enc derivation
\n
"
);
}
}
if
(
compare_buffer
(
knas_int
,
32
,
knas_int_exp
,
32
)
!=
0
)
{
if
(
compare_buffer
(
knas_int
,
16
,
&
knas_int_exp
[
16
],
16
)
!=
0
)
{
fail
(
"Fail: knas_int derivation
\n
"
);
fail
(
"Fail: knas_int derivation
\n
"
);
}
}
free
(
knas_enc
);
free
(
knas_enc
);
free
(
knas_int
);
free
(
knas_int
);
}
}
...
...
openair3/TEST/test_secu_knas_encrypt_eea1.c
View file @
566dc011
...
@@ -40,14 +40,15 @@ void eea1_encrypt(uint8_t direction, uint32_t count,
...
@@ -40,14 +40,15 @@ void eea1_encrypt(uint8_t direction, uint32_t count,
uint8_t
bearer
,
uint8_t
*
key
,
uint32_t
key_length
,
uint8_t
*
message
,
uint8_t
bearer
,
uint8_t
*
key
,
uint32_t
key_length
,
uint8_t
*
message
,
uint32_t
length
,
uint8_t
*
expected
)
uint32_t
length
,
uint8_t
*
expected
)
{
{
nas_stream_cipher_t
*
nas_cipher
;
nas_stream_cipher_t
*
nas_cipher
=
NULL
;
uint8_t
*
result
;
uint8_t
*
result
=
NULL
;
uint32_t
zero_bits
=
length
&
7
;
uint32_t
zero_bits
=
length
&
7
;
uint32_t
byte_length
=
length
>>
3
;
uint32_t
byte_length
=
length
>>
3
;
if
(
zero_bits
>
0
)
if
(
zero_bits
>
0
)
byte_length
+=
1
;
byte_length
+=
1
;
result
=
calloc
(
1
,
byte_length
);
nas_cipher
=
calloc
(
1
,
sizeof
(
nas_stream_cipher_t
));
nas_cipher
=
calloc
(
1
,
sizeof
(
nas_stream_cipher_t
));
nas_cipher
->
direction
=
direction
;
nas_cipher
->
direction
=
direction
;
...
@@ -58,7 +59,7 @@ void eea1_encrypt(uint8_t direction, uint32_t count,
...
@@ -58,7 +59,7 @@ void eea1_encrypt(uint8_t direction, uint32_t count,
nas_cipher
->
blength
=
length
;
nas_cipher
->
blength
=
length
;
nas_cipher
->
message
=
message
;
nas_cipher
->
message
=
message
;
if
(
nas_stream_encrypt_eea1
(
nas_cipher
,
&
result
)
!=
0
)
if
(
nas_stream_encrypt_eea1
(
nas_cipher
,
result
)
!=
0
)
fail
(
"Fail: nas_stream_encrypt_eea1
\n
"
);
fail
(
"Fail: nas_stream_encrypt_eea1
\n
"
);
if
(
compare_buffer
(
result
,
byte_length
,
expected
,
byte_length
)
!=
0
)
{
if
(
compare_buffer
(
result
,
byte_length
,
expected
,
byte_length
)
!=
0
)
{
...
...
openair3/TEST/test_secu_knas_encrypt_eea2.c
View file @
566dc011
...
@@ -40,14 +40,15 @@ void eea2_encrypt(uint8_t direction, uint32_t count,
...
@@ -40,14 +40,15 @@ void eea2_encrypt(uint8_t direction, uint32_t count,
uint8_t
bearer
,
uint8_t
*
key
,
uint32_t
key_length
,
uint8_t
*
message
,
uint8_t
bearer
,
uint8_t
*
key
,
uint32_t
key_length
,
uint8_t
*
message
,
uint32_t
length
,
uint8_t
*
expected
)
uint32_t
length
,
uint8_t
*
expected
)
{
{
nas_stream_cipher_t
*
nas_cipher
;
nas_stream_cipher_t
*
nas_cipher
=
NULL
;
uint8_t
*
result
;
uint8_t
*
result
=
NULL
;
uint32_t
zero_bits
=
length
&
7
;
uint32_t
zero_bits
=
length
&
7
;
uint32_t
byte_length
=
length
>>
3
;
uint32_t
byte_length
=
length
>>
3
;
if
(
zero_bits
>
0
)
if
(
zero_bits
>
0
)
byte_length
+=
1
;
byte_length
+=
1
;
result
=
calloc
(
1
,
byte_length
);
nas_cipher
=
calloc
(
1
,
sizeof
(
nas_stream_cipher_t
));
nas_cipher
=
calloc
(
1
,
sizeof
(
nas_stream_cipher_t
));
nas_cipher
->
direction
=
direction
;
nas_cipher
->
direction
=
direction
;
...
@@ -58,7 +59,7 @@ void eea2_encrypt(uint8_t direction, uint32_t count,
...
@@ -58,7 +59,7 @@ void eea2_encrypt(uint8_t direction, uint32_t count,
nas_cipher
->
blength
=
length
;
nas_cipher
->
blength
=
length
;
nas_cipher
->
message
=
message
;
nas_cipher
->
message
=
message
;
if
(
nas_stream_encrypt_eea2
(
nas_cipher
,
&
result
)
!=
0
)
if
(
nas_stream_encrypt_eea2
(
nas_cipher
,
result
)
!=
0
)
fail
(
"Fail: nas_stream_encrypt_eea2
\n
"
);
fail
(
"Fail: nas_stream_encrypt_eea2
\n
"
);
if
(
compare_buffer
(
result
,
byte_length
,
expected
,
byte_length
)
!=
0
)
{
if
(
compare_buffer
(
result
,
byte_length
,
expected
,
byte_length
)
!=
0
)
{
...
...
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