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
wangjie
OpenXG-RAN
Commits
27bb59d3
Commit
27bb59d3
authored
Oct 03, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better handling of NETTLE version in CMake
parent
7c6e48d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+7
-10
openair3/TEST/test_aes128_ctr_decrypt.c
openair3/TEST/test_aes128_ctr_decrypt.c
+1
-1
openair3/TEST/test_aes128_ctr_encrypt.c
openair3/TEST/test_aes128_ctr_encrypt.c
+1
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
27bb59d3
...
...
@@ -1538,20 +1538,17 @@ endif()
message
(
"NETTLE VERSION_INSTALLED =
${
NETTLE_VERSION
}
"
)
string
(
REGEX MATCH
"[+-]?[0-9]+([.][0-9]+)?"
nv
${
NETTLE_VERSION
}
)
string
(
REGEX REPLACE
"([0-9]+).*"
"
\\
1"
NETTLE_VERSION_MAJOR
${
NETTLE_VERSION
}
)
string
(
REGEX REPLACE
"[0-9]+
\\
.([0-9]+).*"
"
\\
1"
NETTLE_VERSION_MINOR
${
NETTLE_VERSION
}
)
message
(
"NETTLE_VERSION_MAJOR =
${
NETTLE_VERSION_MAJOR
}
"
)
message
(
"NETTLE_VERSION_MINOR =
${
NETTLE_VERSION_MINOR
}
"
)
# WE only pass the major and first minor in the define and ignore the rest
#message("NETTLE_VERSION USED = ${nv}")
# we need to remove decimal as floating point arithematic does not work properly with C preprocessor
STRING
(
REGEX REPLACE
"[.]"
""
nv
${
nv
}
)
if
(
"
${
nv
}
"
STREQUAL
""
)
if
(
"
${
NETTLE_VERSION_MAJOR
}
"
STREQUAL
""
OR
"
${
NETTLE_VERSION_MINOR
}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"The nettle version not detected properly. Try to run build_oai -I again"
)
endif
()
set
(
NETTLE_VERSION
"
${
nv
}
"
)
add_definitions
(
"-DNETTLE_VERSION
=
${
NETTLE_VERSION
}
"
)
add_definitions
(
"-DNETTLE_VERSION_MAJOR=
${
NETTLE_VERSION_MAJOR
}
"
)
add_definitions
(
"-DNETTLE_VERSION
_MINOR=
${
NETTLE_VERSION_MINOR
}
"
)
pkg_search_module
(
XPM xpm
)
if
(
NOT
${
XPM_FOUND
}
)
...
...
openair3/TEST/test_aes128_ctr_decrypt.c
View file @
27bb59d3
...
...
@@ -48,7 +48,7 @@ void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
#if NETTLE_VERSION
<= 27
#if NETTLE_VERSION
_MAJOR < 3
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
#else
cipher
->
set_encrypt_key
(
ctx
,
key
);
...
...
openair3/TEST/test_aes128_ctr_encrypt.c
View file @
27bb59d3
...
...
@@ -47,7 +47,7 @@ static void test_cipher_ctr(const struct nettle_cipher *cipher, const uint8_t *k
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
#if NETTLE_VERSION
<= 27
#if NETTLE_VERSION
_MAJOR < 3
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
#else
cipher
->
set_encrypt_key
(
ctx
,
key
);
...
...
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