From 03eb0169b34eb194c849a79d8066225504a60672 Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Thu, 21 Dec 2017 16:26:47 +0100 Subject: [PATCH] Fixed build against OpenSSL 1.1. Patch backported from https://github.com/grishka/libtgvoip/pull/31 pull request. Original patch by: Nicholas Guriev Closes #43. --- Telegram/ThirdParty/libtgvoip/VoIPController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/ThirdParty/libtgvoip/VoIPController.cpp b/Telegram/ThirdParty/libtgvoip/VoIPController.cpp index fd1a16d82..9db374c9f 100644 --- a/Telegram/ThirdParty/libtgvoip/VoIPController.cpp +++ b/Telegram/ThirdParty/libtgvoip/VoIPController.cpp @@ -103,9 +103,12 @@ bool VoIPController::didInitWin32TimeScale = false; #define SHA256_LENGTH 32 #ifndef TGVOIP_USE_CUSTOM_CRYPTO +extern "C" { #include #include +#include #include +} void tgvoip_openssl_aes_ige_encrypt(uint8_t* in, uint8_t* out, size_t length, uint8_t* key, uint8_t* iv){ AES_KEY akey; @@ -134,7 +137,7 @@ void tgvoip_openssl_sha256(uint8_t* msg, size_t len, uint8_t* output){ void tgvoip_openssl_aes_ctr_encrypt(uint8_t* inout, size_t length, uint8_t* key, uint8_t* iv, uint8_t* ecount, uint32_t* num){ AES_KEY akey; AES_set_encrypt_key(key, 32*8, &akey); - AES_ctr128_encrypt(inout, inout, length, &akey, iv, ecount, num); + CRYPTO_ctr128_encrypt(inout, inout, length, &akey, iv, ecount, num, (block128_f) AES_encrypt); } voip_crypto_functions_t VoIPController::crypto={