From 3658ba8066b0e31009b7b4be606cb9d34a12122d Mon Sep 17 00:00:00 2001 From: Gatsik <74517072+Gatsik@users.noreply.github.com> Date: Sat, 18 May 2024 22:32:55 +0300 Subject: [PATCH] Use different cryptopp bytes for windows and linux --- CMakeLists.txt | 4 ++++ uid.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 059729b..5e82e47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/uid.cpp b/uid.cpp index 35ea644..11e3a9c 100644 --- a/uid.cpp +++ b/uid.cpp @@ -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(iv_b64.c_str()), iv_b64.size()); b.Put(reinterpret_cast(json_string_encrypted_b64.c_str()), json_string_encrypted_b64.size()); b.Put(reinterpret_cast(aes_key_encrypted_base64.c_str()), aes_key_encrypted_base64.size()); +#else + b.Put(reinterpret_cast(iv_b64.c_str()), iv_b64.size()); + b.Put(reinterpret_cast(json_string_encrypted_b64.c_str()), json_string_encrypted_b64.size()); + b.Put(reinterpret_cast(aes_key_encrypted_base64.c_str()), aes_key_encrypted_base64.size()); +#endif b.MessageEnd(); } }