[telegram-desktop/f26] Rebuild against libtgvoip 1.0.1.
by Vitaly Zaitsev
commit ef3a5a3b16052a2dd62fe3997b6d97cbe05cc70f
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Sat Nov 18 19:52:39 2017 +0500
Rebuild against libtgvoip 1.0.1.
telegram-desktop.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index 4e7db53..df08ec6 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -12,7 +12,7 @@
Summary: Telegram is a new era of messaging
Name: telegram-desktop
Version: 1.1.23
-Release: 3%{?dist}
+Release: 4%{?dist}
# Application and 3rd-party modules licensing:
# * S0 (Telegram Desktop) - GPLv3+ with OpenSSL exception -- main source;
@@ -174,6 +174,9 @@ fi
%{_datadir}/appdata/%{name}.appdata.xml
%changelog
+* Sat Nov 18 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.1.23-4
+- Rebuild against libtgvoip 1.0.1.
+
* Fri Nov 17 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.1.23-3
- Rebuild for Qt 5.9 major update. Backported upstream patches.
7 years
[libtgvoip/f26] Provide compactibility with 1.0.
by Vitaly Zaitsev
commit 42714b84ac07c02ab2b8708edfc03fe726968689
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Sat Nov 18 18:55:41 2017 +0500
Provide compactibility with 1.0.
libtgvoip.spec | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/libtgvoip.spec b/libtgvoip.spec
index 04a45cb..b6c4c24 100644
--- a/libtgvoip.spec
+++ b/libtgvoip.spec
@@ -5,7 +5,7 @@
Summary: VoIP library for Telegram clients
Name: libtgvoip
Version: 1.0.1
-Release: 1.%{date}git%{shortcommit0}%{?dist}
+Release: 2.%{date}git%{shortcommit0}%{?dist}
# Libtgvoip shared library - Public Domain.
# Bundled webrtc library - BSD with patented echo cancellation algorithms.
@@ -51,6 +51,7 @@ popd
# Installing shared library...
mkdir -p "%{buildroot}%{_libdir}"
install -m 0755 -p out/Release/lib.target/%{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so.%{version}"
+ln -s %{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so.1.0"
ln -s %{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so.1"
ln -s %{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so"
@@ -71,6 +72,9 @@ find audio -maxdepth 1 -type f -name "*.h" -exec install -m 0644 -p '{}' %{build
%{_libdir}/%{name}.so
%changelog
+* Sat Nov 18 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.1-2.20171111git6a0b3b2
+- Provide compactibility with 1.0.
+
* Sat Nov 18 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.1-1.20171111git6a0b3b2
- Updated to 1.0.1-git.
7 years
[libtgvoip] Updated to 1.0.1-git.
by Vitaly Zaitsev
Summary of changes:
111a2af... Updated to 1.0.1-git. (*)
(*) This commit already existed in another branch; no separate mail sent
7 years
[libtgvoip/f27] Updated to 1.0.1-git.
by Vitaly Zaitsev
Summary of changes:
111a2af... Updated to 1.0.1-git. (*)
(*) This commit already existed in another branch; no separate mail sent
7 years
[libtgvoip/f26] Updated to 1.0.1-git.
by Vitaly Zaitsev
commit 111a2af1dae41a81b9d67bdaec4bba3dfffded25
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Sat Nov 18 18:45:05 2017 +0500
Updated to 1.0.1-git.
.gitignore | 1 +
libtgvoip.spec | 11 +++++++----
sources | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 540f46b..e5d7b66 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/libtgvoip-bfd5cfe.tar.gz
+/libtgvoip-6a0b3b2.tar.gz
diff --git a/libtgvoip.spec b/libtgvoip.spec
index f4e225f..04a45cb 100644
--- a/libtgvoip.spec
+++ b/libtgvoip.spec
@@ -1,11 +1,11 @@
-%global commit0 bfd5cfecb3970de2d077ec25e6fbb01797e5afe1
+%global commit0 6a0b3b23b79949828d36be2a45007602c6f493d4
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
-%global date 20170801
+%global date 20171111
Summary: VoIP library for Telegram clients
Name: libtgvoip
-Version: 1.0
-Release: 3.%{date}git%{shortcommit0}%{?dist}
+Version: 1.0.1
+Release: 1.%{date}git%{shortcommit0}%{?dist}
# Libtgvoip shared library - Public Domain.
# Bundled webrtc library - BSD with patented echo cancellation algorithms.
@@ -71,6 +71,9 @@ find audio -maxdepth 1 -type f -name "*.h" -exec install -m 0644 -p '{}' %{build
%{_libdir}/%{name}.so
%changelog
+* Sat Nov 18 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.1-1.20171111git6a0b3b2
+- Updated to 1.0.1-git.
+
* Fri Aug 04 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0-3.20170801gitbfd5cfe
- Fixed build on other architectures. Build against regular OpenSSL.
diff --git a/sources b/sources
index b12815d..aeb4c59 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-2480e46da1089a24e17f923d26a5ca69 libtgvoip-bfd5cfe.tar.gz
+463774e3d51c56c1c740feed966305d8 libtgvoip-6a0b3b2.tar.gz
7 years
[telegram-desktop/f26: 2/2] Rebuild for Qt 5.9 major update to fix issue with empty lines. Backported some upstream patches.
by Vitaly Zaitsev
commit fd903cea476142f3ce2ea6f844a5213e113d6dfd
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Sat Nov 18 18:20:07 2017 +0500
Rebuild for Qt 5.9 major update to fix issue with empty lines. Backported some upstream patches.
telegram-desktop-cve-2016-10351.patch | 30 ++++++
telegram-desktop-ffmpeg-build-fixes.patch | 35 ++++++
telegram-desktop-gccw.patch | 96 +++++++++++++++++
telegram-desktop-gccw2.patch | 47 ++++++++
telegram-desktop-ime-fix.patch | 31 ++++++
telegram-desktop-openssl11-fix.patch | 171 ++++++++++++++++++++++++++++++
telegram-desktop.spec | 20 ++--
7 files changed, 422 insertions(+), 8 deletions(-)
---
diff --git a/telegram-desktop-cve-2016-10351.patch b/telegram-desktop-cve-2016-10351.patch
new file mode 100644
index 0000000..55b2ba1
--- /dev/null
+++ b/telegram-desktop-cve-2016-10351.patch
@@ -0,0 +1,30 @@
+From 07106897a606ab290f5cf2fbaf52bbfa448a9d6b Mon Sep 17 00:00:00 2001
+From: Alexander GQ Gerasiov <gq(a)cs.msu.su>
+Date: Mon, 28 Aug 2017 01:03:06 +0300
+Subject: [PATCH] Fix CVE-2016-10351: Insecure cWorkingDir permissions.
+
+Set 700 permisson on dir on every start.
+
+Signed-off-by: Alexander GQ Gerasiov <gq(a)cs.msu.su>
+---
+ Telegram/SourceFiles/settings.h | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h
+index 8463bcbdd..e2de77ff3 100644
+--- a/Telegram/SourceFiles/settings.h
++++ b/Telegram/SourceFiles/settings.h
+@@ -79,7 +79,12 @@ DeclareReadSetting(LaunchMode, LaunchMode);
+ DeclareSetting(QString, WorkingDir);
+ inline void cForceWorkingDir(const QString &newDir) {
+ cSetWorkingDir(newDir);
+- if (!gWorkingDir.isEmpty()) QDir().mkpath(gWorkingDir);
++ if (!gWorkingDir.isEmpty()) {
++ QDir().mkpath(gWorkingDir);
++ QFile::setPermissions(gWorkingDir,
++ QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser);
++ }
++
+ }
+ DeclareReadSetting(QString, ExeName);
+ DeclareReadSetting(QString, ExeDir);
diff --git a/telegram-desktop-ffmpeg-build-fixes.patch b/telegram-desktop-ffmpeg-build-fixes.patch
new file mode 100644
index 0000000..c4780b4
--- /dev/null
+++ b/telegram-desktop-ffmpeg-build-fixes.patch
@@ -0,0 +1,35 @@
+diff --git a/Telegram/SourceFiles/media/media_audio_capture.cpp b/Telegram/SourceFiles/media/media_audio_capture.cpp
+index 5ac456e58..abc170c58 100644
+--- a/Telegram/SourceFiles/media/media_audio_capture.cpp
++++ b/Telegram/SourceFiles/media/media_audio_capture.cpp
+@@ -263,7 +263,7 @@ void Instance::Inner::onStart() {
+ d->codecContext->channels = 1;
+
+ if (d->fmtContext->oformat->flags & AVFMT_GLOBALHEADER) {
+- d->codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ d->codecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+ }
+
+ // Open audio stream
+@@ -276,7 +276,7 @@ void Instance::Inner::onStart() {
+
+ // Alloc source samples
+
+- d->srcSamples = (d->codecContext->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) ? 10000 : d->codecContext->frame_size;
++ d->srcSamples = (d->codecContext->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) ? 10000 : d->codecContext->frame_size;
+ //if ((res = av_samples_alloc_array_and_samples(&d->srcSamplesData, 0, d->codecContext->channels, d->srcSamples, d->codecContext->sample_fmt, 0)) < 0) {
+ // LOG(("Audio Error: Unable to av_samples_alloc_array_and_samples for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ // onStop(false);
+diff --git a/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp b/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp
+index 512564ead..ebd47d3db 100644
+--- a/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp
++++ b/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp
+@@ -149,7 +149,7 @@ ReaderImplementation::ReadResult FFMpegReaderImplementation::readNextFrame() {
+ }
+
+ void FFMpegReaderImplementation::processReadFrame() {
+- int64 duration = av_frame_get_pkt_duration(_frame);
++ int64 duration = _frame->pkt_duration;
+ int64 framePts = _frame->pts;
+ TimeMs frameMs = (framePts * 1000LL * _fmtContext->streams[_streamId]->time_base.num) / _fmtContext->streams[_streamId]->time_base.den;
+ _currentFrameDelay = _nextFrameDelay;
diff --git a/telegram-desktop-gccw.patch b/telegram-desktop-gccw.patch
new file mode 100644
index 0000000..7e930eb
--- /dev/null
+++ b/telegram-desktop-gccw.patch
@@ -0,0 +1,96 @@
+From 8c92f42de3aef4db889da69d8296fd29a053784d Mon Sep 17 00:00:00 2001
+From: visuve <veli-matti.visuri(a)cerescon.fi>
+Date: Sun, 17 Sep 2017 14:53:38 +0300
+Subject: [PATCH] Fix uninitialized values
+
+- Use C++11 default member initializers
+
+Signed-off-by: Veli-Matti Visuri <veli-matti.visuri(a)cerescon.fi> (github: visuve)
+---
+ Telegram/SourceFiles/platform/win/main_window_win.cpp | 12 ++++++------
+ Telegram/SourceFiles/storage/localimageloader.h | 2 +-
+ Telegram/SourceFiles/ui/text/text.cpp | 10 +++++-----
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/Telegram/SourceFiles/platform/win/main_window_win.cpp b/Telegram/SourceFiles/platform/win/main_window_win.cpp
+index 45d58237a..33f6b5ae6 100644
+--- a/Telegram/SourceFiles/platform/win/main_window_win.cpp
++++ b/Telegram/SourceFiles/platform/win/main_window_win.cpp
+@@ -113,7 +113,7 @@ class _PsShadowWindows {
+ using Change = MainWindow::ShadowsChange;
+ using Changes = MainWindow::ShadowsChanges;
+
+- _PsShadowWindows() : screenDC(0), max_w(0), max_h(0), _x(0), _y(0), _w(0), _h(0), hidden(true), r(0), g(0), b(0), noKeyColor(RGB(255, 255, 255)) {
++ _PsShadowWindows() : screenDC(0), noKeyColor(RGB(255, 255, 255)) {
+ for (int i = 0; i < 4; ++i) {
+ dcs[i] = 0;
+ bitmaps[i] = 0;
+@@ -511,19 +511,19 @@ class _PsShadowWindows {
+
+ private:
+
+- int _x, _y, _w, _h;
+- int _metaSize, _fullsize, _size, _shift;
++ int _x = 0, _y = 0, _w = 0, _h = 0;
++ int _metaSize = 0, _fullsize = 0, _size = 0, _shift = 0;
+ QVector<BYTE> _alphas, _colors;
+
+- bool hidden;
++ bool hidden = true;
+
+ HWND hwnds[4];
+ HDC dcs[4], screenDC;
+ HBITMAP bitmaps[4];
+- int max_w, max_h;
++ int max_w = 0, max_h = 0;
+ BLENDFUNCTION blend;
+
+- BYTE r, g, b;
++ BYTE r = 0, g = 0, b = 0;
+ COLORREF noKeyColor;
+
+ static LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+diff --git a/Telegram/SourceFiles/storage/localimageloader.h b/Telegram/SourceFiles/storage/localimageloader.h
+index 3c98ff54e..281b5603b 100644
+--- a/Telegram/SourceFiles/storage/localimageloader.h
++++ b/Telegram/SourceFiles/storage/localimageloader.h
+@@ -189,7 +189,7 @@ struct FileLoadResult {
+
+ uint64 id;
+ FileLoadTo to;
+- SendMediaType type;
++ SendMediaType type = SendMediaType::File;
+ QString filepath;
+ QByteArray content;
+
+diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp
+index d18a8ea55..9c9378c84 100644
+--- a/Telegram/SourceFiles/ui/text/text.cpp
++++ b/Telegram/SourceFiles/ui/text/text.cpp
+@@ -717,7 +717,7 @@ enum { _MaxItemLength = 4096 };
+
+ struct BidiControl {
+ inline BidiControl(bool rtl)
+- : cCtx(0), base(rtl ? 1 : 0), level(rtl ? 1 : 0), override(false) {}
++ : base(rtl ? 1 : 0), level(rtl ? 1 : 0) {}
+
+ inline void embed(bool rtl, bool o = false) {
+ unsigned int toAdd = 1;
+@@ -751,13 +751,13 @@ struct BidiControl {
+ }
+
+ struct {
+- unsigned int level;
+- bool override;
++ unsigned int level = 0;
++ bool override = false;
+ } ctx[_MaxBidiLevel];
+- unsigned int cCtx;
++ unsigned int cCtx = 0;
+ const unsigned int base;
+ unsigned int level;
+- bool override;
++ bool override = false;
+ };
+
+ static void eAppendItems(QScriptAnalysis *analysis, int &start, int &stop, const BidiControl &control, QChar::Direction dir) {
diff --git a/telegram-desktop-gccw2.patch b/telegram-desktop-gccw2.patch
new file mode 100644
index 0000000..65269a3
--- /dev/null
+++ b/telegram-desktop-gccw2.patch
@@ -0,0 +1,47 @@
+From 08e3a54a580c6b2f726b702c40908e7b2219dee6 Mon Sep 17 00:00:00 2001
+From: visuve <veli-matti.visuri(a)cerescon.fi>
+Date: Sun, 17 Sep 2017 14:28:20 +0300
+Subject: [PATCH] Mark missing ctors deleted
+
+- Satisfy the rule of five
+
+Signed-off-by: Veli-Matti Visuri <veli-matti.visuri(a)cerescon.fi> (github: visuve)
+---
+ Telegram/SourceFiles/base/qthelp_regex.h | 4 ++++
+ Telegram/SourceFiles/history/history_item.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/Telegram/SourceFiles/base/qthelp_regex.h b/Telegram/SourceFiles/base/qthelp_regex.h
+index 657094cd9..39c7739d0 100644
+--- a/Telegram/SourceFiles/base/qthelp_regex.h
++++ b/Telegram/SourceFiles/base/qthelp_regex.h
+@@ -26,10 +26,14 @@ namespace qthelp {
+
+ class RegularExpressionMatch {
+ public:
++ RegularExpressionMatch(const QRegularExpressionMatch &other) = delete;
++ RegularExpressionMatch(const RegularExpressionMatch &other) = delete;
+ RegularExpressionMatch(QRegularExpressionMatch &&match) : data_(std::move(match)) {
+ }
+ RegularExpressionMatch(RegularExpressionMatch &&other) : data_(std::move(other.data_)) {
+ }
++ RegularExpressionMatch &operator=(const QRegularExpressionMatch &match) = delete;
++ RegularExpressionMatch &operator=(const RegularExpressionMatch &other) = delete;
+ RegularExpressionMatch &operator=(QRegularExpressionMatch &&match) {
+ data_ = std::move(match);
+ return *this;
+diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h
+index 0b757fbd5..5e3d6ef22 100644
+--- a/Telegram/SourceFiles/history/history_item.h
++++ b/Telegram/SourceFiles/history/history_item.h
+@@ -146,6 +146,10 @@ struct HistoryMessageForwarded : public RuntimeComponent<HistoryMessageForwarded
+ };
+
+ struct HistoryMessageReply : public RuntimeComponent<HistoryMessageReply> {
++ HistoryMessageReply() = default;
++ HistoryMessageReply(const HistoryMessageReply &other) = delete;
++ HistoryMessageReply(HistoryMessageReply &&other) = delete;
++ HistoryMessageReply &operator=(const HistoryMessageReply &other) = delete;
+ HistoryMessageReply &operator=(HistoryMessageReply &&other) {
+ replyToMsgId = other.replyToMsgId;
+ std::swap(replyToMsg, other.replyToMsg);
diff --git a/telegram-desktop-ime-fix.patch b/telegram-desktop-ime-fix.patch
new file mode 100644
index 0000000..535ff01
--- /dev/null
+++ b/telegram-desktop-ime-fix.patch
@@ -0,0 +1,31 @@
+From 11a46a1072114a20258cf4da849e66787c8d046d Mon Sep 17 00:00:00 2001
+From: Yonsh Lin <yonsh(a)live.com>
+Date: Thu, 7 Sep 2017 21:39:12 +0800
+Subject: [PATCH] Fix IME being interrupted after reconnection Signed-off-by:
+ Yonsh Lin <yonsh(a)live.com> (github: yonsh)
+
+---
+ Telegram/SourceFiles/mainwindow.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp
+index 0798d184d..00682cbea 100644
+--- a/Telegram/SourceFiles/mainwindow.cpp
++++ b/Telegram/SourceFiles/mainwindow.cpp
+@@ -460,6 +460,7 @@ void MainWindow::ui_hideMediaPreview() {
+ void MainWindow::showConnecting(const QString &text, const QString &reconnect) {
+ if (_connecting) {
+ _connecting->set(text, reconnect);
++ _connecting->show();
+ } else {
+ _connecting.create(bodyWidget(), text, reconnect);
+ _connecting->show();
+@@ -470,7 +471,7 @@ void MainWindow::showConnecting(const QString &text, const QString &reconnect) {
+
+ void MainWindow::hideConnecting() {
+ if (_connecting) {
+- _connecting.destroyDelayed();
++ _connecting->hide();
+ }
+ }
+
diff --git a/telegram-desktop-openssl11-fix.patch b/telegram-desktop-openssl11-fix.patch
new file mode 100644
index 0000000..8365376
--- /dev/null
+++ b/telegram-desktop-openssl11-fix.patch
@@ -0,0 +1,171 @@
+From a5868882092aaf2c6d254897b9ddf8132af98ff9 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <guriev-ns(a)ya.ru>
+Date: Sat, 11 Nov 2017 22:22:23 +0300
+Subject: [PATCH] Fix build against OpenSSL 1.1
+
+Closes: #3196
+---
+ Telegram/SourceFiles/base/openssl_help.h | 9 ++--
+ Telegram/SourceFiles/mtproto/auth_key.cpp | 3 +-
+ Telegram/SourceFiles/mtproto/rsa_public_key.cpp | 62 +++++++++++++++++++++----
+ 3 files changed, 60 insertions(+), 14 deletions(-)
+
+diff --git a/Telegram/SourceFiles/base/openssl_help.h b/Telegram/SourceFiles/base/openssl_help.h
+index 357462b86..b5678d5c7 100644
+--- a/Telegram/SourceFiles/base/openssl_help.h
++++ b/Telegram/SourceFiles/base/openssl_help.h
+@@ -55,8 +55,7 @@ class Context {
+
+ class BigNum {
+ public:
+- BigNum() {
+- BN_init(raw());
++ BigNum() : _data(BN_new()) {
+ }
+ BigNum(const BigNum &other) : BigNum() {
+ *this = other;
+@@ -176,10 +175,10 @@ class BigNum {
+ }
+
+ BIGNUM *raw() {
+- return &_data;
++ return _data;
+ }
+ const BIGNUM *raw() const {
+- return &_data;
++ return _data;
+ }
+
+ bool failed() const {
+@@ -193,7 +192,7 @@ class BigNum {
+ }
+
+ private:
+- BIGNUM _data;
++ BIGNUM *_data = nullptr;
+ mutable bool _failed = false;
+
+ };
+diff --git a/Telegram/SourceFiles/mtproto/auth_key.cpp b/Telegram/SourceFiles/mtproto/auth_key.cpp
+index 24d7f13a2..f1b393f4c 100644
+--- a/Telegram/SourceFiles/mtproto/auth_key.cpp
++++ b/Telegram/SourceFiles/mtproto/auth_key.cpp
+@@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
+ #include "mtproto/auth_key.h"
+
+ #include <openssl/aes.h>
++#include <openssl/modes.h>
+
+ namespace MTP {
+
+@@ -109,7 +110,7 @@ void aesCtrEncrypt(void *data, uint32 len, const void *key, CTRState *state) {
+ static_assert(CTRState::IvecSize == AES_BLOCK_SIZE, "Wrong size of ctr ivec!");
+ static_assert(CTRState::EcountSize == AES_BLOCK_SIZE, "Wrong size of ctr ecount!");
+
+- AES_ctr128_encrypt(static_cast<const uchar*>(data), static_cast<uchar*>(data), len, &aes, state->ivec, state->ecount, &state->num);
++ CRYPTO_ctr128_encrypt(static_cast<const uchar*>(data), static_cast<uchar*>(data), len, &aes, state->ivec, state->ecount, &state->num, (block128_f) AES_encrypt);
+ }
+
+ } // namespace MTP
+diff --git a/Telegram/SourceFiles/mtproto/rsa_public_key.cpp b/Telegram/SourceFiles/mtproto/rsa_public_key.cpp
+index 4a088cf7a..fdc86ff5c 100644
+--- a/Telegram/SourceFiles/mtproto/rsa_public_key.cpp
++++ b/Telegram/SourceFiles/mtproto/rsa_public_key.cpp
+@@ -29,6 +29,45 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
+ using std::string;
+
+ namespace MTP {
++namespace {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++
++// This is a key setter for compatibility with OpenSSL 1.0
++int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) {
++ if ((r->n == nullptr && n == nullptr) || (r->e == nullptr && e == nullptr)) {
++ return false;
++ }
++ if (n != nullptr) {
++ BN_free(r->n);
++ r->n = n;
++ }
++ if (e != nullptr) {
++ BN_free(r->e);
++ r->e = e;
++ }
++ if (d != nullptr) {
++ BN_free(r->d);
++ r->d = d;
++ }
++ return true;
++}
++
++// This is a key getter for compatibility with OpenSSL 1.0
++void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) {
++ if (n != nullptr) {
++ *n = r->n;
++ }
++ if (e != nullptr) {
++ *e = r->e;
++ }
++ if (d != nullptr) {
++ *d = r->d;
++ }
++}
++
++#endif
++}
++
+ namespace internal {
+
+ class RSAPublicKey::Private {
+@@ -40,9 +79,10 @@ class RSAPublicKey::Private {
+ }
+ Private(base::const_byte_span nBytes, base::const_byte_span eBytes) : _rsa(RSA_new()) {
+ if (_rsa) {
+- _rsa->n = BN_dup(openssl::BigNum(nBytes).raw());
+- _rsa->e = BN_dup(openssl::BigNum(eBytes).raw());
+- if (!_rsa->n || !_rsa->e) {
++ BIGNUM *n = BN_dup(openssl::BigNum(nBytes).raw());
++ BIGNUM *e = BN_dup(openssl::BigNum(eBytes).raw());
++ RSA_set0_key(_rsa, n, e, nullptr);
++ if (!n || !e) {
+ RSA_free(base::take(_rsa));
+ } else {
+ computeFingerprint();
+@@ -51,11 +91,15 @@ class RSAPublicKey::Private {
+ }
+ base::byte_vector getN() const {
+ Expects(isValid());
+- return toBytes(_rsa->n);
++ const BIGNUM *n;
++ RSA_get0_key(_rsa, &n, nullptr, nullptr);
++ return toBytes(n);
+ }
+ base::byte_vector getE() const {
+ Expects(isValid());
+- return toBytes(_rsa->e);
++ const BIGNUM *e;
++ RSA_get0_key(_rsa, nullptr, &e, nullptr);
++ return toBytes(e);
+ }
+ uint64 getFingerPrint() const {
+ return _fingerprint;
+@@ -105,14 +149,16 @@ class RSAPublicKey::Private {
+ void computeFingerprint() {
+ Expects(isValid());
+
++ const BIGNUM *n, *e;
+ mtpBuffer string;
+- MTP_bytes(toBytes(_rsa->n)).write(string);
+- MTP_bytes(toBytes(_rsa->e)).write(string);
++ RSA_get0_key(_rsa, &n, &e, nullptr);
++ MTP_bytes(toBytes(n)).write(string);
++ MTP_bytes(toBytes(e)).write(string);
+
+ uchar sha1Buffer[20];
+ _fingerprint = *(uint64*)(hashSha1(&string[0], string.size() * sizeof(mtpPrime), sha1Buffer) + 3);
+ }
+- static base::byte_vector toBytes(BIGNUM *number) {
++ static base::byte_vector toBytes(const BIGNUM *number) {
+ auto size = BN_num_bytes(number);
+ auto result = base::byte_vector(size, gsl::byte {});
+ BN_bn2bin(number, reinterpret_cast<unsigned char*>(result.data()));
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index 8356be5..4e7db53 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -12,7 +12,7 @@
Summary: Telegram is a new era of messaging
Name: telegram-desktop
Version: 1.1.23
-Release: 2%{?dist}
+Release: 3%{?dist}
# Application and 3rd-party modules licensing:
# * S0 (Telegram Desktop) - GPLv3+ with OpenSSL exception -- main source;
@@ -30,6 +30,13 @@ Source2: https://github.com/Microsoft/GSL/archive/%{commit2}.tar.gz#/GSL-%{short
Patch0: %{name}-build-fixes.patch
+Patch101: %{name}-ffmpeg-build-fixes.patch
+Patch102: %{name}-cve-2016-10351.patch
+Patch103: %{name}-openssl11-fix.patch
+Patch104: %{name}-ime-fix.patch
+Patch105: %{name}-gccw.patch
+Patch106: %{name}-gccw2.patch
+
Requires: qt5-qtimageformats%{?_isa}
Requires: hicolor-icon-theme
Requires: gtk3%{?_isa}
@@ -53,19 +60,13 @@ BuildRequires: openal-soft-devel
BuildRequires: qt5-qtbase-devel
BuildRequires: libtgvoip-devel
BuildRequires: libstdc++-devel
+BuildRequires: openssl-devel
BuildRequires: minizip-devel
BuildRequires: opus-devel
BuildRequires: gtk3-devel
BuildRequires: dee-devel
BuildRequires: xz-devel
-# Additional development packages...
-%if 0%{?fedora} && 0%{?fedora} >= 26
-BuildRequires: compat-openssl10-devel
-%else
-BuildRequires: openssl-devel
-%endif
-
%description
Telegram is a messaging app with a focus on speed and security, it’s super
fast, simple and free. You can use Telegram on all your devices at the same
@@ -173,6 +174,9 @@ fi
%{_datadir}/appdata/%{name}.appdata.xml
%changelog
+* Fri Nov 17 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.1.23-3
+- Rebuild for Qt 5.9 major update. Backported upstream patches.
+
* Tue Oct 17 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1.1.23-2
- Rebuild for ffmpeg update
7 years