$ git show --format=fuller --patch-with-stat --summary 7e3247f57224dd6615d49b96470f35a5fdc2bf32
commit 7e3247f57224dd6615d49b96470f35a5fdc2bf32
Author: mandian <mandian@users.noreply.github.com>
AuthorDate: Tue Nov 2 03:48:37 2021 +0100
Commit: mandian <mandian@users.noreply.github.com>
CommitDate: Tue Nov 2 03:48:37 2021 +0100
fix openssl patch
---
tdesktop-2.1.7-openssl3.patch | 47 +++++++++++++++++++++++++++++++++++++++++++
telegram-desktop.spec | 2 +-
2 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/tdesktop-2.1.7-openssl3.patch b/tdesktop-2.1.7-openssl3.patch
index 5edb47d..e0cbbe0 100644
--- a/tdesktop-2.1.7-openssl3.patch
+++ b/tdesktop-2.1.7-openssl3.patch
@@ -11,3 +11,50 @@ index 3a924059..53b21c63 100644
FIPS_mode_set(0);
#endif
ENGINE_cleanup();
+diff -up tdesktop-2.7.9-full/Telegram/lib_base/base/openssl_help.h.omv~ tdesktop-2.7.9-full/Telegram/lib_base/base/openssl_help.h
+--- tdesktop-2.7.9-full/Telegram/lib_base/base/openssl_help.h.omv~ 2021-06-21 17:55:46.854877200 +0200
++++ tdesktop-2.7.9-full/Telegram/lib_base/base/openssl_help.h 2021-06-21 18:12:03.420101458 +0200
+@@ -28,6 +28,12 @@ extern "C" {
+ #undef small
+ #endif // small
+
++#if OPENSSL_VERSION_MAJOR >= 3
++#define SHA1 "SHA1"
++#define SHA256 "SHA256"
++#define SHA512 "SHA512"
++#endif
++
+ namespace openssl {
+
+ class Context {
+@@ -414,6 +420,7 @@ inline void ShaUpdate(Context context, M
+ ShaUpdate(context, method, args...);
+ }
+
++#if OPENSSL_VERSION_MAJOR < 3
+ template <size_type Size, typename Method>
+ inline void Sha(
+ bytes::span dst,
+@@ -426,6 +433,21 @@ inline void Sha(
+ data.size(),
+ reinterpret_cast<unsigned char*>(dst.data()));
+ }
++#else
++template <size_type Size>
++inline void Sha(
++ bytes::span dst,
++ char const * const method,
++ bytes::const_span data) {
++ Expects(dst.size() >= Size);
++
++ EVP_Q_digest(NULL, method, NULL,
++ reinterpret_cast<const unsigned char*>(data.data()),
++ data.size(),
++ reinterpret_cast<unsigned char*>(dst.data()),
++ NULL);
++}
++#endif
+
+ template <size_type Size, typename Method>
+ [[nodiscard]] inline bytes::vector Sha(
+
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index c4980cf..f5a20d9 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -33,7 +33,7 @@ Name: telegram-desktop
# before every upgrade
# try to up tg_owt project first
Version: 2.5.8
-Release: 1
+Release: 2
# Application and 3rd-party modules licensing:
# * Telegram Desktop - GPLv3+ with OpenSSL exception -- main tarball;