Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ut tc apply enctests #21

Merged
merged 28 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a2c9b0c
Rebasing to collab_main, Bug Fixes, additional tests
rjbrown6 Nov 17, 2021
5b479d9
Added Dat files, and minor ut fixes - still faulting atm
rjbrown6 Nov 17, 2021
b58c258
UT/EVT refactoring
rjbrown6 Nov 18, 2021
a244f1d
Fixing CMake & Refactoring - broken validation
rjbrown6 Nov 18, 2021
e9e589e
Fixing another CMake
rjbrown6 Nov 18, 2021
50860c7
Bug Fixes, UT Fixed with new layout, TODO: Find FECF Issue
rjbrown6 Nov 22, 2021
c6b302c
WIP
rjbrown6 Nov 29, 2021
99e36b3
Updates to error codes and unit tests
dccutrig Nov 30, 2021
fdfcb12
WIP - AES-GCM test vector working
dccutrig Nov 30, 2021
ecf896b
WIP - improving NIST KAT
dccutrig Nov 30, 2021
e24dac9
WIP - Troubleshooting commit
dccutrig Nov 30, 2021
5eb7651
Revert "WIP - Troubleshooting commit"
dccutrig Nov 30, 2021
c8c2c8b
Initial UT/Validation tests working
dccutrig Nov 30, 2021
000db18
WIP UT modify ek_ring from hex string
dccutrig Nov 30, 2021
356d662
Key Functionality
rjbrown6 Dec 1, 2021
262bbbe
Test Cleanup
rjbrown6 Dec 1, 2021
d3f3f81
Adding more NIST AES-GCM 256 encryption test vectors
dccutrig Dec 1, 2021
a92fd8f
Added NIST authentication tag test
dccutrig Dec 1, 2021
5ed6389
WIP: FECF Issues
rjbrown6 Dec 1, 2021
556917d
Fixed IV_SIZE, FECF_CALC, Added DEC Tests, TODO: AUT Dec + Test, more…
rjbrown6 Dec 1, 2021
76cc822
Fixed Unit Tests, Cleaning up Tests, Renamed et_xxx to et_dt_xxx, TOD…
rjbrown6 Dec 2, 2021
ff1c098
renamed c/h files
rjbrown6 Dec 2, 2021
0dae776
WIP: AUTH Decryption
rjbrown6 Dec 3, 2021
0dc6c40
WIP: All Tests working but MAC Only AUTH Apply/Process
rjbrown6 Dec 3, 2021
934b8b8
Encryption and decryption tests completed
dccutrig Dec 6, 2021
50506d6
Cleanup for CR 12/6
rjbrown6 Dec 6, 2021
26aae06
Revert "Cleanup for CR 12/6"
dccutrig Dec 6, 2021
455faa9
Cleanup after CR for merge
dccutrig Dec 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build
venv
*.dat
.vscode
__pycache__

#CMake.gitignore
CMakeLists.txt.user
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")

OPTION(DEBUG "Debug" OFF) # Disabled by default, enable with: -DDEBUG=ON
OPTION(MYSQL "Mysql" OFF) # Disabled by default, enable with: -DMYSQL=ON
OPTION(ENCTEST "Encryption-Tests" OFF) # Disabled by default, enable with: -DENCTEST=ON

IF(DEBUG)
ADD_DEFINITIONS(-DDEBUG -DOCF_DEBUG -DFECF_DEBUG -DSA_DEBUG -DPDU_DEBUG -DCCSDS_DEBUG -DTC_DEBUG -DMAC_DEBUG -DTM_DEBUG)
add_compile_options(-ggdb)
ENDIF(DEBUG)

IF(ENCTEST)
ADD_DEFINITIONS(-DENCTEST)
ENDIF(ENCTEST)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
enable_testing()
Expand Down
14 changes: 10 additions & 4 deletions fsw/crypto_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
# [email protected]
set(PROJECT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})

add_test(NAME Process_Security
COMMAND ${PROJECT_BINARY_DIR}/bin/process_security tc ${PROJECT_TEST_DIR}/data/tc4.1.dat
WORKING_DIRECTORY ${PROJECT_TEST_DIR})
# add_test(NAME Process_Security
# COMMAND ${PROJECT_BINARY_DIR}/bin/process_security tc ${PROJECT_TEST_DIR}/data/tc4.1.dat
# WORKING_DIRECTORY ${PROJECT_TEST_DIR})

add_test(NAME UT_TC_APPLY
COMMAND ${PROJECT_BINARY_DIR}/bin/ut_tc_apply
WORKING_DIRECTORY ${PROJECT_TEST_DIR})
WORKING_DIRECTORY ${PROJECT_TEST_DIR})

if(${ENCTEST})
add_test(NAME ET_DT_VALIDATION
COMMAND ${PROJECT_BINARY_DIR}/bin/et_dt_validation
WORKING_DIRECTORY ${PROJECT_TEST_DIR})
endif()
1 change: 0 additions & 1 deletion fsw/crypto_tests/data/raw_tc_sdls_ping.txt

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion fsw/crypto_tests/data/raw_tc_sdls_ping_bad_scid.txt

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion fsw/crypto_tests/data/raw_tc_sdls_ping_bad_vcid.txt

This file was deleted.

30 changes: 21 additions & 9 deletions fsw/crypto_util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,40 @@
# NASA IV&V
# [email protected]



include_directories(include)
include_directories(../crypto/public_inc)
include_directories(../crypto/public_inc)

if(ENCTEST)
find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
endif(ENCTEST)

aux_source_directory(src UTIL_SRC_FILES)
aux_source_directory(app APP_SRC_FILES)
aux_source_directory(app APP_SRC_FILES)

file( GLOB SOURCE_FILES app/*.c )
foreach(SOURCE_PATH ${SOURCE_FILES})

get_filename_component(EXECUTABLE_NAME ${SOURCE_PATH} NAME_WE)

add_executable(${EXECUTABLE_NAME} ${SOURCE_PATH})
if((NOT ${ENCTEST}) AND ${EXECUTABLE_NAME} STREQUAL et_dt_validation)
continue()
else()
add_executable(${EXECUTABLE_NAME} ${SOURCE_PATH})
target_sources(${EXECUTABLE_NAME} PRIVATE src/shared_util.c)
target_link_libraries(${EXECUTABLE_NAME} LINK_PUBLIC Crypto)
endif()

target_sources(${EXECUTABLE_NAME} PRIVATE src/shared_util.c)
target_link_libraries(${EXECUTABLE_NAME} LINK_PUBLIC Crypto)
if(${ENCTEST} AND ${EXECUTABLE_NAME} STREQUAL et_dt_validation)
target_link_libraries(${EXECUTABLE_NAME} PUBLIC ${Python3_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PUBLIC ${Python3_INCLUDE_DIRS})
endif()

add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${EXECUTABLE_NAME}> ${PROJECT_BINARY_DIR}/bin/${EXECUTABLE_NAME}
COMMAND ${CMAKE_COMMAND} -E remove $<TARGET_FILE:${EXECUTABLE_NAME}>
COMMENT "Created ${PROJECT_BINARY_DIR}/bin/${EXECUTABLE_NAME}"
)
endforeach(SOURCE_PATH ${SOURCE_FILES})

target_include_directories (Crypto PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
endforeach(SOURCE_PATH ${SOURCE_FILES})

target_include_directories (Crypto PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Loading