From a578df37ca8c4c130f28ccfd12948bc2fe429526 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 14 Jan 2008 22:55:37 +0000 Subject: Removing the need for the libssl. --- MPQCryptography.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'MPQCryptography.c') diff --git a/MPQCryptography.c b/MPQCryptography.c index 464a410..9791c0a 100644 --- a/MPQCryptography.c +++ b/MPQCryptography.c @@ -16,11 +16,13 @@ #include #include +#ifdef USE_SSL #include #include #include #include #include +#endif #include "MPQCryptography.h" #include "inttypes.h" @@ -31,6 +33,7 @@ static uint32_t crypt_table[0x500]; /****TODO****/ /* Re-implement various endianess fixes. */ +#ifdef USE_SSL static void memrev(unsigned char *buf, size_t count) { unsigned char *r; @@ -41,6 +44,7 @@ static void memrev(unsigned char *buf, size_t count) *buf ^= *r; } } +#endif const uint32_t *__mpqlib_get_cryptography_table() { @@ -74,10 +78,12 @@ void __mpqlib_init_cryptography() } } // Load up OpenSSL +#ifdef USE_SSL OpenSSL_add_all_digests(); OpenSSL_add_all_algorithms(); OpenSSL_add_all_ciphers(); ERR_load_crypto_strings(); +#endif } void __mpqlib_encrypt(void *_data, uint32_t length, uint32_t key, bool disable_input_swapping) @@ -225,6 +231,7 @@ void __mpqlib_crc32(const unsigned char *buffer, uint32_t length, uint32_t * crc *crc = local_crc; } +#ifdef USE_SSL int __mpqlib_verify_weak_signature(RSA * public_key, const unsigned char *signature, const unsigned char *digest) { unsigned char reversed_signature[__MPQLIB_WEAK_SIGNATURE_SIZE]; @@ -257,3 +264,4 @@ int __mpqlib_verify_strong_signature(RSA * public_key, const unsigned char *sign return (!error && memcmp(reversed_signature, real_digest, __MPQLIB_STRONG_SIGNATURE_SIZE) == 0); } +#endif -- cgit v1.2.3