-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7dfd68
commit ee691ba
Showing
17 changed files
with
666 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
add_compile_options(${CMOCKA_FLAGS} -DHAVE_SIGNAL_H) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
add_compile_options(${CMOCKA_FLAGS} -DHAVE_VSNPRINTF -DHAVE_SNPRINTF) | ||
if((TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022")) | ||
add_compile_options(/wd4819) | ||
endif() | ||
endif() | ||
add_library(cmockalib STATIC "") | ||
|
||
include_directories(${LIBSPDM_DIR}/unit_test/cmockalib | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/unit_test/cmockalib/cmocka/include | ||
${LIBSPDM_DIR}/unit_test/cmockalib/cmocka/include/cmockery | ||
target_include_directories(cmockalib | ||
PRIVATE | ||
${LIBSPDM_DIR}/unit_test/cmockalib | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/unit_test/cmockalib/cmocka/include | ||
${LIBSPDM_DIR}/unit_test/cmockalib/cmocka/include/cmockery | ||
) | ||
|
||
target_sources(cmockalib | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/cmocka/src/cmocka.c | ||
) | ||
|
||
if(TOOLCHAIN STREQUAL "ARM_DS2022") | ||
set(src_CmockaLib | ||
cmocka/src/cmocka.c | ||
strdup.c | ||
) | ||
else() | ||
set(src_CmockaLib | ||
cmocka/src/cmocka.c | ||
) | ||
target_sources(cmockalib PRIVATE ${CMAKE_CURRENT_LIST_DIR}/strdup.c) | ||
endif() | ||
|
||
add_library(cmockalib STATIC ${src_CmockaLib}) | ||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
target_compile_options(cmockalib PRIVATE ${CMOCKA_FLAGS} -DHAVE_SIGNAL_H) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
target_compile_options(cmockalib PRIVATE ${CMOCKA_FLAGS} -DHAVE_VSNPRINTF -DHAVE_SNPRINTF) | ||
if((TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022")) | ||
target_compile_options(cmockalib PRIVATE /wd4819) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include_directories(${LIBSPDM_DIR}/unit_test/spdm_transport_test_lib | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/unit_test/include | ||
) | ||
add_library(spdm_transport_test_lib STATIC "") | ||
|
||
set(src_spdm_transport_test_lib | ||
common.c | ||
test.c | ||
target_include_directories(spdm_transport_test_lib | ||
PRIVATE | ||
${LIBSPDM_DIR}/unit_test/spdm_transport_test_lib | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/unit_test/include | ||
) | ||
|
||
add_library(spdm_transport_test_lib STATIC ${src_spdm_transport_test_lib}) | ||
target_sources(spdm_transport_test_lib | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/common.c | ||
${CMAKE_CURRENT_LIST_DIR}/test.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,68 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include_directories(${LIBSPDM_DIR}/unit_test/test_crypt | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/os_stub/include | ||
${LIBSPDM_DIR}/os_stub | ||
) | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
add_executable(test_crypt) | ||
|
||
set(src_test_crypt | ||
test_crypt.c | ||
hash_verify.c | ||
hmac_verify.c | ||
hkdf_verify.c | ||
aead_verify.c | ||
rsa_verify.c | ||
rsa_verify2.c | ||
dh_verify.c | ||
ec_verify.c | ||
ec_verify2.c | ||
ecd_verify.c | ||
ecd_verify2.c | ||
sm2_verify.c | ||
sm2_verify2.c | ||
rand_verify.c | ||
x509_verify.c | ||
os_support.c | ||
target_include_directories(test_crypt | ||
PRIVATE | ||
${LIBSPDM_DIR}/unit_test/test_crypt | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/os_stub/include | ||
${LIBSPDM_DIR}/os_stub | ||
) | ||
|
||
set(test_crypt_LIBRARY | ||
memlib | ||
debuglib | ||
${CRYPTO_LIB_PATHS} | ||
rnglib | ||
cryptlib_${CRYPTO} | ||
malloclib | ||
spdm_crypt_lib | ||
spdm_crypt_ext_lib | ||
target_sources(test_crypt | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/test_crypt.c | ||
${CMAKE_CURRENT_LIST_DIR}/hash_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/hmac_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/hkdf_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/aead_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/rsa_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/rsa_verify2.c | ||
${CMAKE_CURRENT_LIST_DIR}/dh_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/ec_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/ec_verify2.c | ||
${CMAKE_CURRENT_LIST_DIR}/ecd_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/ecd_verify2.c | ||
${CMAKE_CURRENT_LIST_DIR}/sm2_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/sm2_verify2.c | ||
${CMAKE_CURRENT_LIST_DIR}/rand_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/x509_verify.c | ||
${CMAKE_CURRENT_LIST_DIR}/os_support.c | ||
) | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
if((TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022")) | ||
target_compile_options(test_crypt PRIVATE /wd4819) | ||
endif() | ||
endif() | ||
|
||
if(TOOLCHAIN STREQUAL "ARM_DS2022") | ||
set(test_crypt_LIBRARY ${test_crypt_LIBRARY} armbuild_lib) | ||
target_link_libraries(test_crypt PRIVATE armbuild_lib) | ||
endif() | ||
|
||
if((TOOLCHAIN STREQUAL "KLEE") OR (TOOLCHAIN STREQUAL "CBMC")) | ||
add_executable(test_crypt | ||
${src_test_crypt} | ||
$<TARGET_OBJECTS:memlib> | ||
$<TARGET_OBJECTS:debuglib> | ||
$<TARGET_OBJECTS:${CRYPTO_LIB_PATHS}> | ||
$<TARGET_OBJECTS:rnglib> | ||
$<TARGET_OBJECTS:cryptlib_${CRYPTO}> | ||
$<TARGET_OBJECTS:malloclib> | ||
target_link_libraries(test_crypt | ||
PRIVATE | ||
$<TARGET_OBJECTS:memlib> | ||
$<TARGET_OBJECTS:debuglib> | ||
$<TARGET_OBJECTS:${CRYPTO_LIB_PATHS}> | ||
$<TARGET_OBJECTS:rnglib> | ||
$<TARGET_OBJECTS:cryptlib_${CRYPTO}> | ||
$<TARGET_OBJECTS:malloclib> | ||
) | ||
else() | ||
add_executable(test_crypt ${src_test_crypt}) | ||
target_link_libraries(test_crypt ${test_crypt_LIBRARY}) | ||
target_link_libraries(test_crypt | ||
PRIVATE | ||
memlib | ||
debuglib | ||
${CRYPTO_LIB_PATHS} | ||
rnglib | ||
cryptlib_${CRYPTO} | ||
malloclib | ||
spdm_crypt_lib | ||
spdm_crypt_ext_lib | ||
) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
add_compile_options(-Wno-incompatible-pointer-types -Wno-pointer-sign) | ||
endif() | ||
|
||
include_directories(${LIBSPDM_DIR}/include | ||
add_library(cryptstublib_dummy STATIC "") | ||
|
||
${LIBSPDM_DIR}/os_stub/include | ||
target_include_directories(cryptstublib_dummy | ||
PRIVATE | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/os_stub/include | ||
) | ||
|
||
set(src_cryptstublib_dummy | ||
rand_dummy.c | ||
timeclock_dummy.c | ||
target_sources(cryptstublib_dummy | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/rand_dummy.c | ||
${CMAKE_CURRENT_LIST_DIR}/timeclock_dummy.c | ||
) | ||
|
||
add_library(cryptstublib_dummy STATIC ${src_cryptstublib_dummy}) | ||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
target_compile_options(cryptstublib_dummy PRIVATE -Wno-incompatible-pointer-types -Wno-pointer-sign) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include_directories(${LIBSPDM_DIR}/include) | ||
add_library(malloclib_null STATIC "") | ||
|
||
set(src_malloclib_null | ||
malloclib.c | ||
target_include_directories(malloclib_null | ||
PRIVATE | ||
${LIBSPDM_DIR}/include | ||
) | ||
|
||
add_library(malloclib_null STATIC ${src_malloclib_null}) | ||
target_sources(malloclib_null | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/malloclib.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include_directories(${LIBSPDM_DIR}/include) | ||
add_library(malloclib_simple STATIC "") | ||
|
||
set(src_malloclib_simple | ||
malloclib.c | ||
target_include_directories(malloclib_simple | ||
PRIVATE | ||
${LIBSPDM_DIR}/include | ||
) | ||
|
||
add_library(malloclib_simple STATIC ${src_malloclib_simple}) | ||
target_sources(malloclib_simple | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/malloclib.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include_directories(${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/include/hal) | ||
add_library(rnglib_null STATIC "") | ||
|
||
set(src_rnglib_null | ||
rnglib.c | ||
target_include_directories(rnglib_null | ||
PRIVATE | ||
${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/include/hal | ||
) | ||
|
||
add_library(rnglib_null STATIC ${src_rnglib_null}) | ||
target_sources(rnglib_null | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/rnglib.c | ||
) |
Oops, something went wrong.