Skip to content

Commit

Permalink
Add automated tests for change-password and change-keys commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kimci86 committed May 1, 2024
1 parent f30e15b commit 248da94
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ add_test(NAME cli.decipher COMMAND ${CMAKE_COMMAND}
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/decipher.cmake)

add_test(NAME cli.change-password COMMAND ${CMAKE_COMMAND}
-DBKCRACK_COMMAND=$<TARGET_FILE:bkcrack>
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/change-password.cmake)

add_test(NAME cli.change-keys COMMAND ${CMAKE_COMMAND}
-DBKCRACK_COMMAND=$<TARGET_FILE:bkcrack>
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/change-keys.cmake)

add_test(NAME cli.bruteforce.empty COMMAND bkcrack -k 12345678 23456789 34567890 -r 0 ?b)
add_test(NAME cli.bruteforce.tiny COMMAND bkcrack -k 1b226dfe c089e0a3 6af00ee6 -r 4 ?b)
add_test(NAME cli.bruteforce.small COMMAND bkcrack -k 9bcb20c6 10a97ca5 103c0614 -r 8 ?p)
Expand Down
10 changes: 10 additions & 0 deletions tests/change-keys.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include(${PROJECT_SOURCE_DIR}/tests/verify_hash.cmake)

execute_process(
COMMAND ${BKCRACK_COMMAND}
-C ${PROJECT_SOURCE_DIR}/example/secrets.zip
-k c4490e28 b414a23d 91404b31
--change-keys change-keys.zip 86484f1d 3fb4c16f ba11de5e
COMMAND_ERROR_IS_FATAL ANY)
verify_hash(change-keys.zip 1aac8f747b205074ca662b533fa421f160b81d4f1afa99b750997d4038a49ebc)
file(REMOVE change-keys.zip)
10 changes: 10 additions & 0 deletions tests/change-password.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include(${PROJECT_SOURCE_DIR}/tests/verify_hash.cmake)

execute_process(
COMMAND ${BKCRACK_COMMAND}
-C ${PROJECT_SOURCE_DIR}/example/secrets.zip
-k c4490e28 b414a23d 91404b31
-U change-password.zip new-password
COMMAND_ERROR_IS_FATAL ANY)
verify_hash(change-password.zip 1aac8f747b205074ca662b533fa421f160b81d4f1afa99b750997d4038a49ebc)
file(REMOVE change-password.zip)

0 comments on commit 248da94

Please sign in to comment.