Skip to content

Commit

Permalink
Use different cryptopp bytes for windows and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Gatsik committed May 18, 2024
1 parent b4ccb89 commit 3658ba8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ endif()

add_definitions(-DUID_PUBKEY_BYTES=${UID_PUBKEY_BYTES})

if (WIN32)
add_definitions(-DWIN32FAFUID)
endif()

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")

add_executable(faf-uid
Expand Down
6 changes: 6 additions & 0 deletions uid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,15 @@ int main(int argc, char *argv[])
new CryptoPP::FileSink(std::cout), false /*insertLineBreaks*/
);
b.Put(paddingSize);
#ifdef WIN32FAFUID
b.Put(reinterpret_cast<const byte*>(iv_b64.c_str()), iv_b64.size());
b.Put(reinterpret_cast<const byte*>(json_string_encrypted_b64.c_str()), json_string_encrypted_b64.size());
b.Put(reinterpret_cast<const byte*>(aes_key_encrypted_base64.c_str()), aes_key_encrypted_base64.size());
#else
b.Put(reinterpret_cast<const CryptoPP::byte*>(iv_b64.c_str()), iv_b64.size());
b.Put(reinterpret_cast<const CryptoPP::byte*>(json_string_encrypted_b64.c_str()), json_string_encrypted_b64.size());
b.Put(reinterpret_cast<const CryptoPP::byte*>(aes_key_encrypted_base64.c_str()), aes_key_encrypted_base64.size());
#endif
b.MessageEnd();
}
}
Expand Down

0 comments on commit 3658ba8

Please sign in to comment.