Package: kopete
Followup-For: Bug #1014320

Dear Maintainer,

libjungle is orphaned Google project that is not supported any more.
However, it is in the source tree of Kopete project.
To build libjungle two issues must be fixed:
 1. explicite convert from 'const ASN1_ITEM* (* const)()'
    {aka 'const ASN1_ITEM_st* (* const)()'} to 'const ASN1_ITEM*'
    {aka 'const ASN1_ITEM_st*'};
 2. build against srtp2 with build-conflict with older srtp.


Solution 1: apply attached fix-libjingle-build.patch

Solution 2: replace kopete-srtp2.patch by attached one + add in d/control
Build-Conflicts: libsrtp0-dev

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.0.0-6-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages kopete depends on:
ii  kio                              5.101.0-2
pn  kopete-data                      <none>
ii  libbctoolbox1                    5.1.64-2
ii  libc6                            2.36-7
ii  libexpat1                        2.5.0-1
ii  libgadu3                         1:1.12.2-6
pn  libidn11                         <none>
ii  libidn12                         1.41-1
ii  libkf5archive5                   5.101.0-1
ii  libkf5bookmarks5                 5.101.0-1
ii  libkf5completion5                5.101.0-1
ii  libkf5configcore5                5.101.0-1
ii  libkf5configgui5                 5.101.0-1
ii  libkf5configwidgets5             5.101.0-1
ii  libkf5contacts5                  5:5.101.0-1
ii  libkf5coreaddons5                5.101.0-1
ii  libkf5crash5                     5.101.0-1
ii  libkf5dbusaddons5                5.101.0-1
ii  libkf5dnssd5                     5.101.0-1
ii  libkf5emoticons-bin              5.101.0-1
ii  libkf5emoticons5                 5.101.0-1
ii  libkf5i18n5                      5.101.0-1+b1
ii  libkf5iconthemes5                5.101.0-1+b1
ii  libkf5identitymanagement5        22.08.3-1
pn  libkf5identitymanagement5-20.08  <none>
pn  libkf5identitymanagement5-21.12  <none>
ii  libkf5itemviews5                 5.101.0-1
ii  libkf5kcmutils5                  5.101.0-1
ii  libkf5kdelibs4support5           5.101.0-2
ii  libkf5khtml5                     5.101.0-1
ii  libkf5kiocore5                   5.101.0-2
ii  libkf5kiofilewidgets5            5.101.0-2
ii  libkf5kiowidgets5                5.101.0-2
ii  libkf5notifications5             5.101.0-1
ii  libkf5notifyconfig5              5.101.0-1
ii  libkf5parts5                     5.101.0-1
ii  libkf5service-bin                5.101.0-1
ii  libkf5service5                   5.101.0-1
ii  libkf5solid5                     5.101.0-1
ii  libkf5textwidgets5               5.101.0-1
ii  libkf5widgetsaddons5             5.101.0-1
ii  libkf5windowsystem5              5.101.0-2
ii  libkf5xmlgui5                    5.101.0-1+b1
pn  libkopete1                       <none>
pn  libmediastreamer-base10          <none>
pn  libmediastreamer-voip10          <none>
pn  libmediastreamer11               <none>
pn  libortp13                        <none>
pn  libortp15                        <none>
ii  libotr5                          4.1.1-5
ii  libphonon4qt5-4                  4:4.11.1-4
ii  libqca-qt5-2                     2.3.5-1
ii  libqt5core5a                     5.15.7+dfsg-2
ii  libqt5dbus5                      5.15.7+dfsg-2
ii  libqt5gui5                       5.15.7+dfsg-2
ii  libqt5network5                   5.15.7+dfsg-2
ii  libqt5sql5                       5.15.7+dfsg-2
ii  libqt5widgets5                   5.15.7+dfsg-2
ii  libqt5xml5                       5.15.7+dfsg-2
ii  libsrtp2-1                       2.4.2-3
pn  libssl1.1                        <none>
ii  libstdc++6                       12.2.0-13
ii  libv4l-0                         1.22.1-5+b1
ii  libxml2                          2.9.14+dfsg-1.1+b2
ii  libxslt1.1                       1.1.35-1
ii  phonon4qt5                       4:4.11.1-4
ii  zlib1g                           1:1.2.13.dfsg-1

Versions of packages kopete recommends:
ii  libqca-qt5-2-plugins  2.3.5-1
ii  libqt5sql5-sqlite     5.15.7+dfsg-2

Versions of packages kopete suggests:
ii  imagemagick-7 [imagemagick]  8:7.1.0.57-dmo1
ii  khelpcenter                  4:22.12.0-2
Description: FTBFS error when libjungle is build
 libjungle is orphaned Google project that is not supported any more.
 However, it is in the source tree of Kopete project.
 To build libjungle two issues must be fixed:
  1. explicite convert from 'const ASN1_ITEM* (* const)()'
     {aka 'const ASN1_ITEM_st* (* const)()'} to 'const ASN1_ITEM*'
     {aka 'const ASN1_ITEM_st*'};
  2. build against srtp2 with conflict with older srtp.
Author: Damir R. Islamov <da...@trefle.ru>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/1014320
Forwarded: (no|not-needed|<patch-forwarded-url>)
#Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
#Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2023-01-07

--- a/protocols/jabber/libjingle/talk/base/openssladapter.cc
+++ b/protocols/jabber/libjingle/talk/base/openssladapter.cc
@@ -754,7 +754,7 @@ bool OpenSSLAdapter::VerifyServerName(SS
       value = NULL;
 
       if (meth->it) {
-        ASN1_item_free(reinterpret_cast<ASN1_VALUE*>(ext_str), meth->it);
+        ASN1_item_free(reinterpret_cast<ASN1_VALUE*>(ext_str), (const 
ASN1_ITEM_st*)(meth->it));
       } else {
         meth->ext_free(ext_str);
       }
Author: Antonio Rojas <aro...@archlinux.org>
Origin: archlinux, 
https://git.archlinux.org/svntogit/packages.git/tree/trunk/kopete-srtp2.patch?h=packages/kopete
Bug: https://bugs.kde.org/show_bug.cgi?id=399678
Bug-Debian: https://bugs.kde.org/show_bug.cgi?id=399678

diff --git a/cmake/modules/FindSRTP.cmake b/cmake/modules/FindSRTP.cmake
index 4e8baa827..ce9033497 100644
--- a/cmake/modules/FindSRTP.cmake
+++ b/cmake/modules/FindSRTP.cmake
@@ -11,8 +11,8 @@ include ( FindPackageHandleStandardArgs )
 if ( SRTP_INCLUDE_DIR AND SRTP_LIBRARY )
        set ( SRTP_FOUND true )
 else ( SRTP_INCLUDE_DIR AND SRTP_LIBRARY )
-       find_path ( SRTP_INCLUDE_DIR srtp.h PATH_SUFFIXES srtp )
-       find_library ( SRTP_LIBRARY NAMES srtp )
+       find_path ( SRTP_INCLUDE_DIR srtp.h PATH_SUFFIXES srtp2 )
+       find_library ( SRTP_LIBRARY NAMES srtp2 )
 
        if ( SRTP_INCLUDE_DIR AND SRTP_LIBRARY )
                set ( SRTP_FOUND true )
diff --git a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc 
b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc
index 7a1cb7866..f5363a36a 100644
--- a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc
+++ b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc
@@ -43,7 +43,7 @@
 
 #ifdef HAVE_SRTP
 #ifdef SRTP_RELATIVE_PATH
-#include "srtp.h"  // NOLINT
+#include "srtp2/srtp.h"  // NOLINT
 #else
 #include "third_party/libsrtp/include/srtp.h"
 #endif  // SRTP_RELATIVE_PATH
@@ -416,7 +416,7 @@ bool SrtpSession::ProtectRtp(void* p, int in_len, int 
max_len, int* out_len) {
   }
   int seq_num;
   GetRtpSeqNum(p, in_len, &seq_num);
-  if (err != err_status_ok) {
+  if (err != srtp_err_status_ok) {
     LOG(LS_WARNING) << "Failed to protect SRTP packet, seqnum="
                     << seq_num << ", err=" << err << ", last seqnum="
                     << last_send_seq_num_;
@@ -442,7 +442,7 @@ bool SrtpSession::ProtectRtcp(void* p, int in_len, int 
max_len, int* out_len) {
   *out_len = in_len;
   int err = srtp_protect_rtcp(session_, p, out_len);
   srtp_stat_->AddProtectRtcpResult(err);
-  if (err != err_status_ok) {
+  if (err != srtp_err_status_ok) {
     LOG(LS_WARNING) << "Failed to protect SRTCP packet, err=" << err;
     return false;
   }
@@ -461,7 +461,7 @@ bool SrtpSession::UnprotectRtp(void* p, int in_len, int* 
out_len) {
   if (GetRtpSsrc(p, in_len, &ssrc)) {
     srtp_stat_->AddUnprotectRtpResult(ssrc, err);
   }
-  if (err != err_status_ok) {
+  if (err != srtp_err_status_ok) {
     LOG(LS_WARNING) << "Failed to unprotect SRTP packet, err=" << err;
     return false;
   }
@@ -477,7 +477,7 @@ bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* 
out_len) {
   *out_len = in_len;
   int err = srtp_unprotect_rtcp(session_, p, out_len);
   srtp_stat_->AddUnprotectRtcpResult(err);
-  if (err != err_status_ok) {
+  if (err != srtp_err_status_ok) {
     LOG(LS_WARNING) << "Failed to unprotect SRTCP packet, err=" << err;
     return false;
   }
@@ -504,11 +504,11 @@ bool SrtpSession::SetKey(int type, const std::string& cs,
   memset(&policy, 0, sizeof(policy));
 
   if (cs == CS_AES_CM_128_HMAC_SHA1_80) {
-    crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtp);
-    crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);
+    srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtp);
+    srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);
   } else if (cs == CS_AES_CM_128_HMAC_SHA1_32) {
-    crypto_policy_set_aes_cm_128_hmac_sha1_32(&policy.rtp);   // rtp is 32,
-    crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);  // rtcp still 80
+    srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(&policy.rtp);   // rtp is 
32,
+    srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);  // rtcp 
still 80
   } else {
     LOG(LS_WARNING) << "Failed to create SRTP session: unsupported"
                     << " cipher_suite " << cs.c_str();
@@ -520,7 +520,7 @@ bool SrtpSession::SetKey(int type, const std::string& cs,
     return false;
   }
 
-  policy.ssrc.type = static_cast<ssrc_type_t>(type);
+  policy.ssrc.type = static_cast<srtp_ssrc_type_t>(type);
   policy.ssrc.value = 0;
   policy.key = const_cast<uint8*>(key);
   // TODO parse window size from WSH session-param
@@ -529,7 +529,7 @@ bool SrtpSession::SetKey(int type, const std::string& cs,
   policy.next = NULL;
 
   int err = srtp_create(&session_, &policy);
-  if (err != err_status_ok) {
+  if (err != srtp_err_status_ok) {
     LOG(LS_ERROR) << "Failed to create SRTP session, err=" << err;
     return false;
   }
@@ -543,13 +543,13 @@ bool SrtpSession::Init() {
   if (!inited_) {
     int err;
     err = srtp_init();
-    if (err != err_status_ok) {
+    if (err != srtp_err_status_ok) {
       LOG(LS_ERROR) << "Failed to init SRTP, err=" << err;
       return false;
     }
 
     err = srtp_install_event_handler(&SrtpSession::HandleEventThunk);
-    if (err != err_status_ok) {
+    if (err != srtp_err_status_ok) {
       LOG(LS_ERROR) << "Failed to install SRTP event handler, err=" << err;
       return false;
     }
@@ -652,10 +652,10 @@ void SrtpStat::AddProtectRtpResult(uint32 ssrc, int 
result) {
   key.ssrc = ssrc;
   key.mode = SrtpFilter::PROTECT;
   switch (result) {
-    case err_status_ok:
+    case srtp_err_status_ok:
       key.error = SrtpFilter::ERROR_NONE;
       break;
-    case err_status_auth_fail:
+    case srtp_err_status_auth_fail:
       key.error = SrtpFilter::ERROR_AUTH;
       break;
     default:
@@ -669,14 +669,14 @@ void SrtpStat::AddUnprotectRtpResult(uint32 ssrc, int 
result) {
   key.ssrc = ssrc;
   key.mode = SrtpFilter::UNPROTECT;
   switch (result) {
-    case err_status_ok:
+    case srtp_err_status_ok:
       key.error = SrtpFilter::ERROR_NONE;
       break;
-    case err_status_auth_fail:
+    case srtp_err_status_auth_fail:
       key.error = SrtpFilter::ERROR_AUTH;
       break;
-    case err_status_replay_fail:
-    case err_status_replay_old:
+    case srtp_err_status_replay_fail:
+    case srtp_err_status_replay_old:
       key.error = SrtpFilter::ERROR_REPLAY;
       break;
     default:
diff --git a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h 
b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h
index 991d4bf42..ff4e5070f 100644
--- a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h
+++ b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h
@@ -39,11 +39,7 @@
 #include "talk/session/phone/cryptoparams.h"
 #include "talk/p2p/base/sessiondescription.h"
 
-// Forward declaration to avoid pulling in libsrtp headers here
-struct srtp_event_data_t;
-struct srtp_ctx_t;
-typedef srtp_ctx_t* srtp_t;
-struct srtp_policy_t;
+#include "srtp2/srtp.h"
 
 namespace cricket {
 

Reply via email to