z3ntu

Untitled

Mar 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.11 KB | None | 0 0
  1. diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
  2. index f598a01..6e61ff8 100644
  3. --- a/trunk/PKGBUILD
  4. +++ b/trunk/PKGBUILD
  5. @@ -11,7 +11,7 @@ pkgdesc='Official Telegram Desktop client'
  6.  arch=('x86_64')
  7.  url="https://desktop.telegram.org/"
  8.  license=('GPL3')
  9. -depends=('ffmpeg' 'hicolor-icon-theme' 'minizip' 'openal' 'qt5-base' 'qt5-imageformats' 'openssl-1.0')
  10. +depends=('ffmpeg' 'hicolor-icon-theme' 'minizip' 'openal' 'qt5-base' 'qt5-imageformats' 'openssl')
  11.  makedepends=('cmake' 'git' 'gyp' 'range-v3' 'python' 'libappindicator-gtk3')
  12.  optdepends=('libnotify: desktop notifications')
  13.  source=(
  14. @@ -25,6 +25,7 @@ source=(
  15.      "tdesktop.patch"
  16.      "no-gtk2.patch"
  17.      "libtgvoip.patch"
  18. +    "libtgvoip-2.patch"
  19.  )
  20.  sha256sums=('SKIP'
  21.              'SKIP'
  22. @@ -33,9 +34,10 @@ sha256sums=('SKIP'
  23.              'SKIP'
  24.              'd4cdad0d091c7e47811d8a26d55bbee492e7845e968c522e86f120815477e9eb'
  25.              '7a06af83609168a8eaec59a65252caa41dcd0ecc805225886435eb65073e9c82'
  26. -            '36b817ec9843b261af7a246f9ec51feb828203bd90e76aef7383457f23a0d4cb'
  27. +            '7879740fa0e3c5fbb5e35014c749dce5532acd16d61bd3ddfebb3079cea624df'
  28.              '8d707debe027c7cb658825501dc30fb3beb57ab21b1b6df2f01c5f76ca39a0e6'
  29. -            '0e55b150b91aeeddcb813fb242a62fe4d1977bcac457eb9d65997faef643f075')
  30. +            '4dd2b1674b1a5bcfc5b640612278fe3a53b454192fbcc06b7476ff54ed6d2f6d'
  31. +            '07ca232b91e9ad0fb9c1501b8b83275cc62b00477c7e5edde5e4cfd2852f1f26')
  32.  
  33.  prepare() {
  34.      cd "$srcdir/tdesktop"
  35. @@ -50,6 +52,7 @@ prepare() {
  36.  
  37.      cd "Telegram/ThirdParty/libtgvoip"
  38.      patch -Np1 -i "$srcdir/libtgvoip.patch"
  39. +    patch -Np1 -i "$srcdir/libtgvoip-2.patch"
  40.  }
  41.  
  42.  build() {
  43. diff --git a/trunk/libtgvoip-2.patch b/trunk/libtgvoip-2.patch
  44. new file mode 100644
  45. index 0000000..61fa35b
  46. --- /dev/null
  47. +++ b/trunk/libtgvoip-2.patch
  48. @@ -0,0 +1,81 @@
  49. +From f2e246c1bfd456646880f4df8062337a53407343 Mon Sep 17 00:00:00 2001
  50. +From: Nicholas Guriev <[email protected]>
  51. +Date: Thu, 6 Jul 2017 23:19:12 +0300
  52. +Subject: [PATCH 1/2] Remove deprecated call of AES_ctr128_encrypt
  53. +
  54. + * The AES_ctr128_encrypt function is not available in OpenSSL 1.1.0
  55. +   without a special compiler flag
  56. + * Fix a small misspelling
  57. +---
  58. + VoIPController.cpp | 7 ++++---
  59. + 1 file changed, 4 insertions(+), 3 deletions(-)
  60. +
  61. +diff --git a/VoIPController.cpp b/VoIPController.cpp
  62. +index 78e9e4b..c81673f 100644
  63. +--- a/VoIPController.cpp
  64. ++++ b/VoIPController.cpp
  65. +@@ -102,6 +102,7 @@ bool VoIPController::didInitWin32TimeScale = false;
  66. + #ifndef TGVOIP_USE_CUSTOM_CRYPTO
  67. + #include <openssl/sha.h>
  68. + #include <openssl/aes.h>
  69. ++#include <openssl/modes.h>
  70. + #include <openssl/rand.h>
  71. +
  72. + void tgvoip_openssl_aes_ige_encrypt(uint8_t* in, uint8_t* out, size_t length, uint8_t* key, uint8_t* iv){
  73. +@@ -131,7 +132,7 @@ void tgvoip_openssl_sha256(uint8_t* msg, size_t len, uint8_t* output){
  74. + void tgvoip_openssl_aes_ctr_encrypt(uint8_t* inout, size_t length, uint8_t* key, uint8_t* iv, uint8_t* ecount, uint32_t* num){
  75. +   AES_KEY akey;
  76. +   AES_set_encrypt_key(key, 32*8, &akey);
  77. +-  AES_ctr128_encrypt(inout, inout, length, &akey, iv, ecount, num);
  78. ++  CRYPTO_ctr128_encrypt(inout, inout, length, &akey, iv, ecount, num, (block128_f) AES_encrypt);
  79. + }
  80. +
  81. + voip_crypto_functions_t VoIPController::crypto={
  82. +@@ -1142,7 +1143,7 @@ simpleAudioBlock random_id:long random_bytes:string raw_data:string = DecryptedA
  83. +                   if(!micMuted){
  84. +                       audioInput->Start();
  85. +                       if(!audioInput->IsInitialized()){
  86. +-                          LOGE("Erorr initializing audio capture");
  87. ++                          LOGE("Error initializing audio capture");
  88. +                           lastError=TGVOIP_ERROR_AUDIO_IO;
  89. +
  90. +                           SetState(STATE_FAILED);
  91. +@@ -1150,7 +1151,7 @@ simpleAudioBlock random_id:long random_bytes:string raw_data:string = DecryptedA
  92. +                       }
  93. +                   }
  94. +                   if(!audioOutput->IsInitialized()){
  95. +-                      LOGE("Erorr initializing audio playback");
  96. ++                      LOGE("Error initializing audio playback");
  97. +                       lastError=TGVOIP_ERROR_AUDIO_IO;
  98. +
  99. +                       SetState(STATE_FAILED);
  100. +
  101. +From b0c6da9bdc68fd692d3a4e620a75e7f4ef10555b Mon Sep 17 00:00:00 2001
  102. +From: Nicholas Guriev <[email protected]>
  103. +Date: Fri, 8 Dec 2017 23:16:12 +0300
  104. +Subject: [PATCH 2/2] Add extern "C" wrapper
  105. +
  106. +It perhaps fixes build failure against ancient OpenSSL.
  107. +
  108. +See also: https://github.com/openssl/openssl/commit/17e80c6
  109. +---
  110. + VoIPController.cpp | 2 ++
  111. + 1 file changed, 2 insertions(+)
  112. +
  113. +diff --git a/VoIPController.cpp b/VoIPController.cpp
  114. +index c81673f..1003e50 100644
  115. +--- a/VoIPController.cpp
  116. ++++ b/VoIPController.cpp
  117. +@@ -100,10 +100,12 @@ bool VoIPController::didInitWin32TimeScale = false;
  118. + #define SHA256_LENGTH 32
  119. +
  120. + #ifndef TGVOIP_USE_CUSTOM_CRYPTO
  121. ++extern "C" {
  122. + #include <openssl/sha.h>
  123. + #include <openssl/aes.h>
  124. + #include <openssl/modes.h>
  125. + #include <openssl/rand.h>
  126. ++}
  127. +
  128. + void tgvoip_openssl_aes_ige_encrypt(uint8_t* in, uint8_t* out, size_t length, uint8_t* key, uint8_t* iv){
  129. +   AES_KEY akey;
  130. diff --git a/trunk/libtgvoip.patch b/trunk/libtgvoip.patch
  131. index 6bd2aeb..8e838df 100644
  132. --- a/trunk/libtgvoip.patch
  133. +++ b/trunk/libtgvoip.patch
  134. @@ -12,7 +12,7 @@ index 52fbea1..9a4dfb7 100644
  135.           'include_dirs': [
  136.             '<(tgvoip_src_loc)/webrtc_dsp',
  137.             '<(linux_path_opus_include)',
  138. -+          '/usr/include/openssl-1.0'
  139. ++          '/usr/include/openssl'
  140.           ],
  141.           'direct_dependent_settings': {
  142.             'include_dirs': [
  143. diff --git a/trunk/tdesktop.patch b/trunk/tdesktop.patch
  144. index 2d3662c..a0a9e30 100644
  145. --- a/trunk/tdesktop.patch
  146. +++ b/trunk/tdesktop.patch
  147. @@ -487,7 +487,7 @@ index f6918c22..50f0d8c7 100644
  148.         'linux_path_range%': '/usr/local',
  149.       },
  150.       'include_dirs': [
  151. -+      '/usr/include/openssl-1.0',
  152. ++      '/usr/include/openssl',
  153.         '/usr/local/include',
  154.         '<(linux_path_ffmpeg)/include',
  155.         '<(linux_path_openal)/include',
  156. @@ -495,7 +495,7 @@ index f6918c22..50f0d8c7 100644
  157.         '<(linux_path_range)/include',
  158.       ],
  159.       'library_dirs': [
  160. -+      '/usr/lib/openssl-1.0',
  161. ++      '/usr/lib/openssl',
  162.         '/usr/local/lib',
  163.         '<(linux_path_ffmpeg)/lib',
  164.         '<(linux_path_openal)/lib',
Advertisement
Add Comment
Please, Sign In to add comment