From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id eMSZH7u27GSUVwAAauVa8A:P1 (envelope-from ) for ; Mon, 28 Aug 2023 17:01:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eMSZH7u27GSUVwAAauVa8A (envelope-from ) for ; Mon, 28 Aug 2023 17:01:15 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7D0D540987 for ; Mon, 28 Aug 2023 17:01:12 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=Y8677ugU; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693234872; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=u16GYGz9krVwMACNAvq3Uqf+OcodL/GJnrQFDrqDDDw=; b=nOUsk8G1u04aqbs9C3MDpD5FJEdDMWp1t16mgREGWEjlQBQCKoa7OSq+VSyL7ZfpTJ6vbJ s4FeKaNr0Me0g+d5QbbO6g35dLLqrU8VBMAZ8fVP0DKxrFFnI40K9ytx53RNX3d1jro6H0 2GXYzlbQ0lnJPGElzGpQKtfxfZDvqT2l8nQvVlrMM2c2enNE+bi3XU1q1K59CD1n2AGe/8 j2RKmvXAhPwLYYH8+yFfO4l8RaqEc/zMmoGSUWiAJjf186IdULT6jQC3w05lHFgPA5dzGJ AIsoLCv9vortSA3aDsB1Bo0K6he4eNqeYm9oheJN7gV/lTNeqR/tkenJB1lLjQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693234872; a=rsa-sha256; cv=none; b=BI55b4f2Jenk+68dFMEbM2PU3Ea6/aN0xzw96SrZSC5RdVjDXyKA7IveZcnTinCHd8Bi9L iXMQM5sEEP+O+9Y3ffA0fsahB+aCtoSV1AlJoz4DrD3dQng20vD0cwZNVPFGlOMoz1+HtO FYKElB4gkTvu3qTHZhSYZFaO1tlkbHg0KSSSK90ZcTewMh/o3GHSyG0K/fjxPKj9npIMAG 8Ug88/NU7gqXbeT36Xq4YqXRn2WONuPsoZP2O9mftUNyh4T+5dkKyewaj5yygqg1gOTM/s f9ppWxaL843zKu9JlCD+Eng8cYRFdlCrsVkSxMUbKK0OPQ47ddxS2ourE7Po7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=Y8677ugU; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qadjk-0004Mo-5y; Mon, 28 Aug 2023 11:01:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qadjd-0004G4-0U for guix-patches@gnu.org; Mon, 28 Aug 2023 11:00:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qadjc-00023o-5t for guix-patches@gnu.org; Mon, 28 Aug 2023 11:00:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qadji-0008AW-II for guix-patches@gnu.org; Mon, 28 Aug 2023 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64748] [PATCH v7 2/2] gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Aug 2023 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64748 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64748@debbugs.gnu.org Cc: Hilton Chain , Distopico Received: via spool by 64748-submit@debbugs.gnu.org id=B64748.169323486131378 (code B ref 64748); Mon, 28 Aug 2023 15:01:02 +0000 Received: (at 64748) by debbugs.gnu.org; 28 Aug 2023 15:01:01 +0000 Received: from localhost ([127.0.0.1]:48753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qadjg-0008A2-Lv for submit@debbugs.gnu.org; Mon, 28 Aug 2023 11:01:01 -0400 Received: from mail.boiledscript.com ([144.168.59.46]:35110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qadjd-00089t-8G for 64748@debbugs.gnu.org; Mon, 28 Aug 2023 11:00:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1693234808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u16GYGz9krVwMACNAvq3Uqf+OcodL/GJnrQFDrqDDDw=; b=Y8677ugUaJ01CqghqYCLgpC6uGkxkudhDgzfGoGm/VJdd0wtZqkDAZR6No/tyBDYRsFWO/ KOA7gk3CbGXQVrpfCqmwRKl7AyLRyYn9Kbw8iCg1su1stExAgMoBlgUxaNJbMo2LLrddzq 2PuSkceZPT5kI8e/5D7fo3iXnVO1sWAPzedL+70GqQYqci4dxGpZc7v3T7blR3Ei1KQCBg WNEkAk4sa/S++Bz7shmpWo3B73WH2L6utQzV8QmJJtoBNB1r20xZWOSBkRQtdrS6Vpw78y qjuTIEe2lg7jDUnqLccHL8C8V8dx2c4pOOcvk/S1I3Hja4sz5fuozwLgC7MgVw== Date: Mon, 28 Aug 2023 23:00:04 +0800 Message-ID: <243d068053e6678cd4c89f2b2d9314b28473dbea.1693234399.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spamd-Bar: --- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.72 X-Spam-Score: -3.72 X-Migadu-Queue-Id: 7D0D540987 X-Migadu-Scanner: mx1.migadu.com X-TUID: qlF6cNh2be4T From: Distopico * gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to 0-389.0532942, which fixes `telegram-desktop` calls that are not working with OpenSSL 3. [source]: Add the patch. : Unbundle libsrtp. [inputs]: Add libsrtp. Signed-off-by: Hilton Chain --- gnu/local.mk | 1 + ...or-telegram-desktop-unbundle-libsrtp.patch | 137 ++++++++++++++++++ gnu/packages/telegram.scm | 16 +- 3 files changed, 149 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch diff --git a/gnu/local.mk b/gnu/local.mk index 48187d7e64..5ab021eaed 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2093,6 +2093,7 @@ dist_patch_DATA = \ %D%/packages/patches/wdl-link-libs-and-fix-jnetlib.patch \ %D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch \ %D%/packages/patches/webrtc-audio-processing-big-endian.patch \ + %D%/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch \ %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \ %D%/packages/patches/wmctrl-64-fix.patch \ %D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \ diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch new file mode 100644 index 0000000000..486f0b1aa5 --- /dev/null +++ b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch @@ -0,0 +1,137 @@ +From 62672f3756ecf218252098211d78c13369ab6d28 Mon Sep 17 00:00:00 2001 +From: Nicholas Guriev +Date: Thu, 4 May 2023 16:21:09 +0300 +Subject: [PATCH] Unbundle libSRTP + +Avoid private symbols and link against system-wide libSRTP. The excluded code +in SrtpSession looks unreachable from the call integration in Telegram Desktop. +--- + CMakeLists.txt | 3 +++ + cmake/libsrtp.cmake | 13 +++++++++++++ + src/pc/external_hmac.cc | 1 - + src/pc/external_hmac.h | 9 ++++++--- + src/pc/srtp_session.cc | 16 ++++++++++++++-- + 5 files changed, 36 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index af7d24c21..66bec8fdf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2647,6 +2647,9 @@ if (TG_OWT_USE_PROTOBUF) + list(APPEND export_targets proto) + endif() + ++if (LIBSRTP_FOUND) ++ target_compile_definitions(tg_owt PRIVATE HAVE_LIBSRTP) ++endif() + if (NOT absl_FOUND) + list(APPEND export_targets libabsl) + endif() +diff --git a/cmake/libsrtp.cmake b/cmake/libsrtp.cmake +index 5124312d2..01f051606 100644 +--- a/cmake/libsrtp.cmake ++++ b/cmake/libsrtp.cmake +@@ -1,3 +1,16 @@ ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(LIBSRTP libsrtp2) ++ ++if (LIBSRTP_FOUND) ++ add_library(libsrtp INTERFACE EXCLUDE_FROM_ALL) ++ add_library(tg_owt::libsrtp ALIAS libsrtp) ++ ++ target_include_directories(libsrtp INTERFACE ${LIBSRTP_INCLUDE_DIRS} ${LIBSRTP_CFLAGS_OTHER}) ++ target_link_libraries(libsrtp INTERFACE ${LIBSRTP_LINK_LIBRARIES} ${LIBSRTP_LDFLAGS_OTHER}) ++ ++ return() ++endif() ++ + add_library(libsrtp OBJECT EXCLUDE_FROM_ALL) + init_target(libsrtp) + add_library(tg_owt::libsrtp ALIAS libsrtp) +diff --git a/src/pc/external_hmac.cc b/src/pc/external_hmac.cc +index 27b5d0e5a..222f5d9ae 100644 +--- a/src/pc/external_hmac.cc ++++ b/src/pc/external_hmac.cc +@@ -15,7 +15,6 @@ + + #include "rtc_base/logging.h" + #include "rtc_base/zero_memory.h" +-#include "third_party/libsrtp/include/srtp.h" + + // Begin test case 0 */ + static const uint8_t kExternalHmacTestCase0Key[20] = { +diff --git a/src/pc/external_hmac.h b/src/pc/external_hmac.h +index c5071fc19..8fdc2f1a7 100644 +--- a/src/pc/external_hmac.h ++++ b/src/pc/external_hmac.h +@@ -30,9 +30,12 @@ + + #include + +-#include "third_party/libsrtp/crypto/include/crypto_types.h" +-#include "third_party/libsrtp/include/srtp.h" +-#include "third_party/libsrtp/include/srtp_priv.h" ++#ifdef HAVE_LIBSRTP ++# include ++# include ++#else ++# include "srtp_priv.h" ++#endif + + #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1 + #define HMAC_KEY_LENGTH 20 +diff --git a/src/pc/srtp_session.cc b/src/pc/srtp_session.cc +index 7d1aaf2d6..7b5a789b0 100644 +--- a/src/pc/srtp_session.cc ++++ b/src/pc/srtp_session.cc +@@ -30,8 +30,12 @@ + #include "rtc_base/thread_annotations.h" + #include "rtc_base/time_utils.h" + #include "system_wrappers/include/metrics.h" +-#include "third_party/libsrtp/include/srtp.h" +-#include "third_party/libsrtp/include/srtp_priv.h" ++ ++#ifdef HAVE_LIBSRTP ++# include ++#else ++# include "srtp_priv.h" ++#endif + + namespace cricket { + +@@ -290,6 +294,9 @@ bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) { + bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) { + RTC_DCHECK(thread_checker_.IsCurrent()); + RTC_DCHECK(IsExternalAuthActive()); ++#ifdef HAVE_LIBSRTP ++ return false; ++#else + if (!IsExternalAuthActive()) { + return false; + } +@@ -313,6 +320,7 @@ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) { + *key_len = external_hmac->key_length; + *tag_len = rtp_auth_tag_len_; + return true; ++#endif + } + + int SrtpSession::GetSrtpOverhead() const { +@@ -336,6 +344,9 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p, + int in_len, + int64_t* index) { + RTC_DCHECK(thread_checker_.IsCurrent()); ++#ifdef HAVE_LIBSRTP ++ return false; ++#else + srtp_hdr_t* hdr = reinterpret_cast(p); + srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc); + if (!stream) { +@@ -346,6 +357,7 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p, + *index = static_cast(rtc::NetworkToHost64( + srtp_rdbx_get_packet_index(&stream->rtp_rdbx) << 16)); + return true; ++#endif + } + + bool SrtpSession::DoSetKey(int type, diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm index 88daea7d7d..4814c22b6c 100644 --- a/gnu/packages/telegram.scm +++ b/gnu/packages/telegram.scm @@ -1,8 +1,9 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Raghav Gururajan -;;; Copyright © 2022 Hilton Chain +;;; Copyright © 2022, 2023 Hilton Chain ;;; Copyright © 2023 Saku Laesvuori ;;; Copyright © 2023 Lu Hui +;;; Copyright © 2023 Camilo Q.S. (Distopico) ;;; ;;; This file is part of GNU Guix. ;;; @@ -266,8 +267,8 @@ (define tgcalls-for-telegram-desktop "193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z")))) (define-public webrtc-for-telegram-desktop - (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a") - (revision "328")) + (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b") + (revision "389")) (hidden-package (package (name "webrtc-for-telegram-desktop") @@ -283,14 +284,18 @@ (define-public webrtc-for-telegram-desktop (file-name (git-file-name name version)) (sha256 - (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy")) + (base32 "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k")) + (patches + (search-patches + ;; https://github.com/desktop-app/tg_owt/pull/123 + "webrtc-for-telegram-desktop-unbundle-libsrtp.patch")) (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1))) (snippet #~(begin (let ((keep - '("libsrtp" "rnnoise" + '("rnnoise" ;; Not available in Guix. "pffft"))) (with-directory-excursion "src/third_party" @@ -325,6 +330,7 @@ (define-public webrtc-for-telegram-desktop libdrm libglvnd libjpeg-turbo + libsrtp libvpx libxcomposite libxdamage -- 2.41.0