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(); } }