Skip to content

Commit

Permalink
Do not output trailing space after password bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
kimci86 committed Oct 17, 2024
1 parent 73f3f79 commit 834278a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ try

for (const auto& password : passwords)
{
std::cout << "as bytes: ";
std::cout << "as bytes:";
for (const auto c : password)
std::cout << std::setw(2) << int{static_cast<std::uint8_t>(c)} << ' ';
std::cout << ' ' << std::setw(2) << int{static_cast<std::uint8_t>(c)};
std::cout << std::endl;
std::cout << "as text: " << password << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ add_test(NAME cli.bruteforce.small COMMAND bkcrack -k 9bcb20c6 10a97ca5 103c061
add_test(NAME cli.bruteforce.medium COMMAND bkcrack -k edb43a00 9ce6e179 8cf2cbba -r 10 ?a)
add_test(NAME cli.bruteforce.long COMMAND bkcrack -k dcce7593 b8a2e617 b2bd4365 -r 12 ?l)
set_tests_properties(cli.bruteforce.empty PROPERTIES PASS_REGULAR_EXPRESSION "Password: \n")
set_tests_properties(cli.bruteforce.tiny PROPERTIES PASS_REGULAR_EXPRESSION "Password: 🔐\n.*Password\nas bytes: f0 9f 94 90 \nas text: 🔐\n")
set_tests_properties(cli.bruteforce.tiny PROPERTIES PASS_REGULAR_EXPRESSION "Password: 🔐\n.*Password\nas bytes: f0 9f 94 90\nas text: 🔐\n")
set_tests_properties(cli.bruteforce.small PROPERTIES PASS_REGULAR_EXPRESSION "Password: _S#cr3t!\n")
set_tests_properties(cli.bruteforce.medium PROPERTIES PASS_REGULAR_EXPRESSION "Password: q1w2e3r4t5\n")
set_tests_properties(cli.bruteforce.long PROPERTIES PASS_REGULAR_EXPRESSION "Password: abcdefghijkl\n")
Expand Down

0 comments on commit 834278a

Please sign in to comment.