diff --git a/src/utils/mp_configs_verifyer/configs_dump_verifyer.h b/src/utils/mp_configs_verifyer/configs_dump_verifyer.h index 59b36d8955f..c8631be490e 100644 --- a/src/utils/mp_configs_verifyer/configs_dump_verifyer.h +++ b/src/utils/mp_configs_verifyer/configs_dump_verifyer.h @@ -2,7 +2,7 @@ #define CONFIGS_DUMP_VERIFYER #include "mp_config_sections.h" -#include "xr_dsa_verifyer.h" +#include "xrCore/crypto/xr_dsa_verifyer.h" namespace mp_anticheat { diff --git a/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj b/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj index f8c56e490ab..0e029ef7f06 100644 --- a/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj +++ b/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj @@ -100,14 +100,12 @@ Create - - diff --git a/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj.filters b/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj.filters index c343a964fb7..07bfe5955ba 100644 --- a/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj.filters +++ b/src/utils/mp_configs_verifyer/mp_configs_verifyer.vcxproj.filters @@ -13,7 +13,6 @@ - @@ -22,6 +21,5 @@ - \ No newline at end of file diff --git a/src/utils/mp_configs_verifyer/xr_dsa_verifyer.cpp b/src/utils/mp_configs_verifyer/xr_dsa_verifyer.cpp deleted file mode 100644 index e30bad4c48e..00000000000 --- a/src/utils/mp_configs_verifyer/xr_dsa_verifyer.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "pch.h" -#include "xr_dsa_verifyer.h" - -xr_dsa_verifyer::xr_dsa_verifyer(u8 const p_number[crypto::xr_dsa::public_key_length], - u8 const q_number[crypto::xr_dsa::private_key_length], - u8 const g_number[crypto::xr_dsa::public_key_length], - u8 const public_key[crypto::xr_dsa::public_key_length]) : - m_dsa(p_number, q_number, g_number) -{ - STATIC_CHECK( - sizeof(m_public_key.m_value) == crypto::xr_dsa::public_key_length, - public_key_sizes_not_equal); - CopyMemory(m_public_key.m_value, public_key, sizeof(m_public_key.m_value)); -} - -xr_dsa_verifyer::~xr_dsa_verifyer() -{ -} - -bool xr_dsa_verifyer::verify(u8 const * data, - u32 data_size, - shared_str const & dsign) -{ - m_sha.start_calculate (data, data_size); - while (!m_sha.continue_calculate()); -/*#ifdef DEBUG - IWriter* verify_data = FS.w_open("$logs$", "verify"); - verify_data->w(data, data_size); - verify_data->w_string("sha_checksum"); - verify_data->w(m_sha.pointer(), m_sha.digest_length); - FS.w_close (verify_data); -#endif*/ - return m_dsa.verify (m_public_key, m_sha.pointer(), m_sha.digest_length, dsign); -} - - diff --git a/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h b/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h deleted file mode 100644 index a60fc3d23d4..00000000000 --- a/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef XR_DSA_VERIFYER_INCLUDED -#define XR_DSA_VERIFYER_INCLUDED - -#include "xrCore/Crypto/crypto.h" - -class xr_dsa_verifyer -{ -public: - xr_dsa_verifyer (u8 const p_number[crypto::xr_dsa::public_key_length], - u8 const q_number[crypto::xr_dsa::private_key_length], - u8 const g_number[crypto::xr_dsa::public_key_length], - u8 const public_key[crypto::xr_dsa::public_key_length]); - - ~xr_dsa_verifyer (); - - bool verify (u8 const * data, - u32 data_size, - shared_str const & dsign); - u8 const* get_sha_checksum () const { return m_sha.pointer(); }; -protected: - crypto::xr_dsa::public_key_t m_public_key; -private: - crypto::xr_dsa m_dsa; - crypto::xr_sha256 m_sha; -};//class xr_dsa_verifyer - - -#endif //#ifndef XR_DSA_VERIFYER_INCLUDED \ No newline at end of file diff --git a/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj b/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj index 14d6a95a08c..05c3eb1bc1c 100644 --- a/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj +++ b/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj @@ -109,10 +109,6 @@ true - - true - - @@ -121,10 +117,6 @@ true - - true - - diff --git a/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj.filters b/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj.filters index 4650461ac76..f6f3c48331e 100644 --- a/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj.filters +++ b/src/utils/mp_screenshots_info/mp_screenshots_info.vcxproj.filters @@ -13,8 +13,6 @@ - - @@ -22,10 +20,8 @@ - - \ No newline at end of file diff --git a/src/utils/mp_screenshots_info/screenshots_reader.h b/src/utils/mp_screenshots_info/screenshots_reader.h index cb571b89f1d..08ba707d2a9 100644 --- a/src/utils/mp_screenshots_info/screenshots_reader.h +++ b/src/utils/mp_screenshots_info/screenshots_reader.h @@ -1,7 +1,7 @@ #ifndef SCREENSHOT_READER_INCLUDED #define SCREENSHOT_READER_INCLUDED -#include "xr_dsa_verifyer.h" +#include "xrCore/crypto/xr_dsa_verifyer.h" namespace screenshots { diff --git a/src/utils/mp_screenshots_info/screenshots_writer.h b/src/utils/mp_screenshots_info/screenshots_writer.h index d5e7ff13dcb..acb40da6ab6 100644 --- a/src/utils/mp_screenshots_info/screenshots_writer.h +++ b/src/utils/mp_screenshots_info/screenshots_writer.h @@ -1,7 +1,7 @@ #ifndef SCREENSHOT_WRITER_INCLUDED #define SCREENSHOT_WRITER_INCLUDED -#include "xr_dsa_signer.h" +#include "xrCore/crypto/xr_dsa_signer.h" namespace screenshots { diff --git a/src/utils/mp_screenshots_info/xr_dsa_signer.cpp b/src/utils/mp_screenshots_info/xr_dsa_signer.cpp deleted file mode 100644 index c41d3256889..00000000000 --- a/src/utils/mp_screenshots_info/xr_dsa_signer.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "pch.h" -#include "xr_dsa_signer.h" - -xr_dsa_signer::xr_dsa_signer(u8 const p_number[crypto::xr_dsa::public_key_length], - u8 const q_number[crypto::xr_dsa::private_key_length], - u8 const g_number[crypto::xr_dsa::public_key_length]) : - m_dsa(p_number, q_number, g_number) -{ - STATIC_CHECK(crypto::xr_dsa::private_key_length == crypto::xr_sha256::digest_length, private_key_size_must_be_equal_to_digest_value_size); -} - -xr_dsa_signer::~xr_dsa_signer() -{ -} - -shared_str const xr_dsa_signer::sign(u8 const * data, - u32 data_size) -{ - m_sha.start_calculate (data, data_size); - while (!m_sha.continue_calculate()) {}; - return m_dsa.sign (m_private_key, m_sha.pointer(), m_sha.digest_length); -} - -shared_str const xr_dsa_signer::sign_mt(u8 const * data, - u32 data_size, - sha_process_yielder yielder) -{ - m_sha.start_calculate (data, data_size); - long sha_process_counter = 0; - while (!m_sha.continue_calculate()) - { - yielder(sha_process_counter); - ++sha_process_counter; - } - return m_dsa.sign (m_private_key, m_sha.pointer(), m_sha.digest_length); -} - - - - diff --git a/src/utils/mp_screenshots_info/xr_dsa_signer.h b/src/utils/mp_screenshots_info/xr_dsa_signer.h deleted file mode 100644 index 620d1f36c77..00000000000 --- a/src/utils/mp_screenshots_info/xr_dsa_signer.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef XR_DSA_SIGNER_INCLUDED -#define XR_DSA_SIGNER_INCLUDED - -#include "xrCore/Crypto/crypto.h" - -typedef fastdelegate::FastDelegate1< long > sha_process_yielder; - -class xr_dsa_signer -{ -public: - xr_dsa_signer (u8 const p_number[crypto::xr_dsa::public_key_length], - u8 const q_number[crypto::xr_dsa::private_key_length], - u8 const g_number[crypto::xr_dsa::public_key_length]); - ~xr_dsa_signer (); - - shared_str const sign (u8 const * data, - u32 data_size); - shared_str const sign_mt (u8 const * data, - u32 data_size, - sha_process_yielder yielder); -protected: - crypto::xr_dsa::private_key_t m_private_key; -private: - xr_dsa_signer() : m_dsa(NULL, NULL, NULL) {}; - - crypto::xr_dsa m_dsa; - crypto::xr_sha256 m_sha; - -}; //xr_dsa_signer - -#endif //#ifndef XR_DSA_SIGNER_INCLUDED \ No newline at end of file diff --git a/src/utils/mp_screenshots_info/xr_dsa_verifyer.cpp b/src/utils/mp_screenshots_info/xr_dsa_verifyer.cpp deleted file mode 100644 index 91b0ce82c18..00000000000 --- a/src/utils/mp_screenshots_info/xr_dsa_verifyer.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "pch.h" -#include "xr_dsa_verifyer.h" - -xr_dsa_verifyer::xr_dsa_verifyer(u8 const p_number[crypto::xr_dsa::public_key_length], - u8 const q_number[crypto::xr_dsa::private_key_length], - u8 const g_number[crypto::xr_dsa::public_key_length], - u8 const public_key[crypto::xr_dsa::public_key_length]) : - m_dsa(p_number, q_number, g_number) -{ - STATIC_CHECK( - sizeof(m_public_key.m_value) == crypto::xr_dsa::public_key_length, - public_key_sizes_not_equal); - CopyMemory(m_public_key.m_value, public_key, sizeof(m_public_key.m_value)); -} - -xr_dsa_verifyer::~xr_dsa_verifyer() -{ -} - -bool xr_dsa_verifyer::verify(u8 const * data, - u32 data_size, - shared_str const & dsign) -{ - m_sha.start_calculate (data, data_size); - while (!m_sha.continue_calculate()); - return m_dsa.verify (m_public_key, m_sha.pointer(), m_sha.digest_length, dsign); -} - - diff --git a/src/utils/mp_screenshots_info/xr_dsa_verifyer.h b/src/utils/mp_screenshots_info/xr_dsa_verifyer.h deleted file mode 100644 index 775e520f907..00000000000 --- a/src/utils/mp_screenshots_info/xr_dsa_verifyer.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef XR_DSA_VERIFYER_INCLUDED -#define XR_DSA_VERIFYER_INCLUDED - -class xr_dsa_verifyer -{ -public: - xr_dsa_verifyer (u8 const p_number[crypto::xr_dsa::public_key_length], - u8 const q_number[crypto::xr_dsa::private_key_length], - u8 const g_number[crypto::xr_dsa::public_key_length], - u8 const public_key[crypto::xr_dsa::public_key_length]); - - ~xr_dsa_verifyer (); - - bool verify (u8 const * data, - u32 data_size, - shared_str const & dsign); -protected: - crypto::xr_dsa::public_key_t m_public_key; -private: - crypto::xr_dsa m_dsa; - crypto::xr_sha256 m_sha; -};//class xr_dsa_verifyer - - -#endif //#ifndef XR_DSA_VERIFYER_INCLUDED \ No newline at end of file diff --git a/src/xrGame/xr_dsa_signer.cpp b/src/xrCore/crypto/xr_dsa_signer.cpp similarity index 100% rename from src/xrGame/xr_dsa_signer.cpp rename to src/xrCore/crypto/xr_dsa_signer.cpp diff --git a/src/xrGame/xr_dsa_signer.h b/src/xrCore/crypto/xr_dsa_signer.h similarity index 87% rename from src/xrGame/xr_dsa_signer.h rename to src/xrCore/crypto/xr_dsa_signer.h index 3d0c793b16a..77302fb0fa6 100644 --- a/src/xrGame/xr_dsa_signer.h +++ b/src/xrCore/crypto/xr_dsa_signer.h @@ -1,11 +1,11 @@ #ifndef XR_DSA_SIGNER_INCLUDED #define XR_DSA_SIGNER_INCLUDED -#include "xrCore/Crypto/crypto.h" +#include "crypto.h" typedef fastdelegate::FastDelegate1< long > sha_process_yielder; -class xr_dsa_signer +class CRYPTO_API xr_dsa_signer { public: xr_dsa_signer (u8 const p_number[crypto::xr_dsa::public_key_length], @@ -28,6 +28,6 @@ class xr_dsa_signer }; //xr_dsa_signer -char const * current_time(string64 & dest_time); +CRYPTO_API char const * current_time(string64 & dest_time); #endif //#ifndef XR_DSA_SIGNER_INCLUDED \ No newline at end of file diff --git a/src/xrGame/xr_dsa_verifyer.cpp b/src/xrCore/crypto/xr_dsa_verifyer.cpp similarity index 100% rename from src/xrGame/xr_dsa_verifyer.cpp rename to src/xrCore/crypto/xr_dsa_verifyer.cpp diff --git a/src/xrGame/xr_dsa_verifyer.h b/src/xrCore/crypto/xr_dsa_verifyer.h similarity index 92% rename from src/xrGame/xr_dsa_verifyer.h rename to src/xrCore/crypto/xr_dsa_verifyer.h index a60fc3d23d4..546a003bd2b 100644 --- a/src/xrGame/xr_dsa_verifyer.h +++ b/src/xrCore/crypto/xr_dsa_verifyer.h @@ -1,9 +1,9 @@ #ifndef XR_DSA_VERIFYER_INCLUDED #define XR_DSA_VERIFYER_INCLUDED -#include "xrCore/Crypto/crypto.h" +#include "crypto.h" -class xr_dsa_verifyer +class CRYPTO_API xr_dsa_verifyer { public: xr_dsa_verifyer (u8 const p_number[crypto::xr_dsa::public_key_length], diff --git a/src/xrCore/xrCore.vcxproj b/src/xrCore/xrCore.vcxproj index cedbcb2ccf2..85c93109458 100644 --- a/src/xrCore/xrCore.vcxproj +++ b/src/xrCore/xrCore.vcxproj @@ -294,6 +294,8 @@ + + @@ -442,6 +444,8 @@ + + diff --git a/src/xrCore/xrCore.vcxproj.filters b/src/xrCore/xrCore.vcxproj.filters index c85ecbbb242..cd5a64bbaca 100644 --- a/src/xrCore/xrCore.vcxproj.filters +++ b/src/xrCore/xrCore.vcxproj.filters @@ -381,6 +381,12 @@ Crypto + + Crypto + + + Crypto + @@ -803,6 +809,12 @@ crypto + + Crypto + + + Crypto + diff --git a/src/xrGame/configs_dump_verifyer.h b/src/xrGame/configs_dump_verifyer.h index 59b36d8955f..c8631be490e 100644 --- a/src/xrGame/configs_dump_verifyer.h +++ b/src/xrGame/configs_dump_verifyer.h @@ -2,7 +2,7 @@ #define CONFIGS_DUMP_VERIFYER #include "mp_config_sections.h" -#include "xr_dsa_verifyer.h" +#include "xrCore/crypto/xr_dsa_verifyer.h" namespace mp_anticheat { diff --git a/src/xrGame/configs_dumper.h b/src/xrGame/configs_dumper.h index 9851b4e93d3..0e0e53b604d 100644 --- a/src/xrGame/configs_dumper.h +++ b/src/xrGame/configs_dumper.h @@ -1,7 +1,7 @@ #ifndef CONFIGS_DUMPER_INCLUDED #define CONFIGS_DUMPER_INCLUDED -#include "xr_dsa_signer.h" +#include "xrCore/crypto/xr_dsa_signer.h" #include "mp_config_sections.h" namespace mp_anticheat diff --git a/src/xrGame/gsc_dsigned_ltx.h b/src/xrGame/gsc_dsigned_ltx.h index 89986a71c98..48c1bc46e3e 100644 --- a/src/xrGame/gsc_dsigned_ltx.h +++ b/src/xrGame/gsc_dsigned_ltx.h @@ -2,8 +2,8 @@ #define GSC_DSINGNED_LTX_INCLUDED #include "xrCore/fastdelegate.h" -#include "xr_dsa_signer.h" -#include "xr_dsa_verifyer.h" +#include "xrCore/crypto/xr_dsa_signer.h" +#include "xrCore/crypto/xr_dsa_verifyer.h" class gsc_dsigned_ltx_writer : private xr_dsa_signer { diff --git a/src/xrGame/screenshots_writer.h b/src/xrGame/screenshots_writer.h index d5e7ff13dcb..acb40da6ab6 100644 --- a/src/xrGame/screenshots_writer.h +++ b/src/xrGame/screenshots_writer.h @@ -1,7 +1,7 @@ #ifndef SCREENSHOT_WRITER_INCLUDED #define SCREENSHOT_WRITER_INCLUDED -#include "xr_dsa_signer.h" +#include "xrCore/crypto/xr_dsa_signer.h" namespace screenshots { diff --git a/src/xrGame/xrGame.vcxproj b/src/xrGame/xrGame.vcxproj index 89f40856765..69ab6bbfb7d 100644 --- a/src/xrGame/xrGame.vcxproj +++ b/src/xrGame/xrGame.vcxproj @@ -1811,8 +1811,6 @@ - - @@ -4014,8 +4012,6 @@ - - diff --git a/src/xrGame/xrGame.vcxproj.filters b/src/xrGame/xrGame.vcxproj.filters index b56cd3cb956..5b2e0f28db8 100644 --- a/src/xrGame/xrGame.vcxproj.filters +++ b/src/xrGame/xrGame.vcxproj.filters @@ -4710,9 +4710,6 @@ AI\ANavigation\GameGraph - - AI\ANavigation\GameGraph - AI\ANavigation\GameLevelCrossTable @@ -5943,12 +5940,6 @@ Core\Common\NET Shared\SecureMessages - - Core\Common\NET Shared\SecureMessages - - - Core\Common\NET Shared\SecureMessages - Core\Common\ObjectBroker @@ -7188,6 +7179,7 @@ Core\Client\Objects\items & weapons\Weapons + @@ -9509,12 +9501,6 @@ Core\Common\NET Shared\SecureMessages - - Core\Common\NET Shared\SecureMessages - - - Core\Common\NET Shared\SecureMessages - Core\Common\ObjectFactory