OCaml 4.14.0 rebuild
[arch-packages.git] / kopete / repos / kde-unstable-x86_64 / kopete-srtp2.patch
blob710bb7306bef4e5a5aa2cc520fef1be8e521a7f9
1 diff --git a/cmake/modules/FindSRTP.cmake b/cmake/modules/FindSRTP.cmake
2 index 4e8baa827..ce9033497 100644
3 --- a/cmake/modules/FindSRTP.cmake
4 +++ b/cmake/modules/FindSRTP.cmake
5 @@ -11,8 +11,8 @@ include ( FindPackageHandleStandardArgs )
6 if ( SRTP_INCLUDE_DIR AND SRTP_LIBRARY )
7 set ( SRTP_FOUND true )
8 else ( SRTP_INCLUDE_DIR AND SRTP_LIBRARY )
9 - find_path ( SRTP_INCLUDE_DIR srtp.h PATH_SUFFIXES srtp )
10 - find_library ( SRTP_LIBRARY NAMES srtp )
11 + find_path ( SRTP_INCLUDE_DIR srtp.h PATH_SUFFIXES srtp srtp2 )
12 + find_library ( SRTP_LIBRARY NAMES srtp srtp2 )
14 if ( SRTP_INCLUDE_DIR AND SRTP_LIBRARY )
15 set ( SRTP_FOUND true )
16 diff --git a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc
17 index 7a1cb7866..f5363a36a 100644
18 --- a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc
19 +++ b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.cc
20 @@ -416,7 +416,7 @@ bool SrtpSession::ProtectRtp(void* p, int in_len, int max_len, int* out_len) {
22 int seq_num;
23 GetRtpSeqNum(p, in_len, &seq_num);
24 - if (err != err_status_ok) {
25 + if (err != srtp_err_status_ok) {
26 LOG(LS_WARNING) << "Failed to protect SRTP packet, seqnum="
27 << seq_num << ", err=" << err << ", last seqnum="
28 << last_send_seq_num_;
29 @@ -442,7 +442,7 @@ bool SrtpSession::ProtectRtcp(void* p, int in_len, int max_len, int* out_len) {
30 *out_len = in_len;
31 int err = srtp_protect_rtcp(session_, p, out_len);
32 srtp_stat_->AddProtectRtcpResult(err);
33 - if (err != err_status_ok) {
34 + if (err != srtp_err_status_ok) {
35 LOG(LS_WARNING) << "Failed to protect SRTCP packet, err=" << err;
36 return false;
38 @@ -461,7 +461,7 @@ bool SrtpSession::UnprotectRtp(void* p, int in_len, int* out_len) {
39 if (GetRtpSsrc(p, in_len, &ssrc)) {
40 srtp_stat_->AddUnprotectRtpResult(ssrc, err);
42 - if (err != err_status_ok) {
43 + if (err != srtp_err_status_ok) {
44 LOG(LS_WARNING) << "Failed to unprotect SRTP packet, err=" << err;
45 return false;
47 @@ -477,7 +477,7 @@ bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) {
48 *out_len = in_len;
49 int err = srtp_unprotect_rtcp(session_, p, out_len);
50 srtp_stat_->AddUnprotectRtcpResult(err);
51 - if (err != err_status_ok) {
52 + if (err != srtp_err_status_ok) {
53 LOG(LS_WARNING) << "Failed to unprotect SRTCP packet, err=" << err;
54 return false;
56 @@ -504,11 +504,11 @@ bool SrtpSession::SetKey(int type, const std::string& cs,
57 memset(&policy, 0, sizeof(policy));
59 if (cs == CS_AES_CM_128_HMAC_SHA1_80) {
60 - crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtp);
61 - crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);
62 + srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtp);
63 + srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);
64 } else if (cs == CS_AES_CM_128_HMAC_SHA1_32) {
65 - crypto_policy_set_aes_cm_128_hmac_sha1_32(&policy.rtp); // rtp is 32,
66 - crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp); // rtcp still 80
67 + srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(&policy.rtp); // rtp is 32,
68 + srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp); // rtcp still 80
69 } else {
70 LOG(LS_WARNING) << "Failed to create SRTP session: unsupported"
71 << " cipher_suite " << cs.c_str();
72 @@ -520,7 +520,7 @@ bool SrtpSession::SetKey(int type, const std::string& cs,
73 return false;
76 - policy.ssrc.type = static_cast<ssrc_type_t>(type);
77 + policy.ssrc.type = static_cast<srtp_ssrc_type_t>(type);
78 policy.ssrc.value = 0;
79 policy.key = const_cast<uint8*>(key);
80 // TODO parse window size from WSH session-param
81 @@ -529,7 +529,7 @@ bool SrtpSession::SetKey(int type, const std::string& cs,
82 policy.next = NULL;
84 int err = srtp_create(&session_, &policy);
85 - if (err != err_status_ok) {
86 + if (err != srtp_err_status_ok) {
87 LOG(LS_ERROR) << "Failed to create SRTP session, err=" << err;
88 return false;
90 @@ -543,13 +543,13 @@ bool SrtpSession::Init() {
91 if (!inited_) {
92 int err;
93 err = srtp_init();
94 - if (err != err_status_ok) {
95 + if (err != srtp_err_status_ok) {
96 LOG(LS_ERROR) << "Failed to init SRTP, err=" << err;
97 return false;
100 err = srtp_install_event_handler(&SrtpSession::HandleEventThunk);
101 - if (err != err_status_ok) {
102 + if (err != srtp_err_status_ok) {
103 LOG(LS_ERROR) << "Failed to install SRTP event handler, err=" << err;
104 return false;
106 @@ -652,10 +652,10 @@ void SrtpStat::AddProtectRtpResult(uint32 ssrc, int result) {
107 key.ssrc = ssrc;
108 key.mode = SrtpFilter::PROTECT;
109 switch (result) {
110 - case err_status_ok:
111 + case srtp_err_status_ok:
112 key.error = SrtpFilter::ERROR_NONE;
113 break;
114 - case err_status_auth_fail:
115 + case srtp_err_status_auth_fail:
116 key.error = SrtpFilter::ERROR_AUTH;
117 break;
118 default:
119 @@ -669,14 +669,14 @@ void SrtpStat::AddUnprotectRtpResult(uint32 ssrc, int result) {
120 key.ssrc = ssrc;
121 key.mode = SrtpFilter::UNPROTECT;
122 switch (result) {
123 - case err_status_ok:
124 + case srtp_err_status_ok:
125 key.error = SrtpFilter::ERROR_NONE;
126 break;
127 - case err_status_auth_fail:
128 + case srtp_err_status_auth_fail:
129 key.error = SrtpFilter::ERROR_AUTH;
130 break;
131 - case err_status_replay_fail:
132 - case err_status_replay_old:
133 + case srtp_err_status_replay_fail:
134 + case srtp_err_status_replay_old:
135 key.error = SrtpFilter::ERROR_REPLAY;
136 break;
137 default:
138 diff --git a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h
139 index 991d4bf42..ff4e5070f 100644
140 --- a/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h
141 +++ b/protocols/jabber/libjingle/talk/session/phone/srtpfilter.h
142 @@ -39,11 +39,7 @@
143 #include "talk/session/phone/cryptoparams.h"
144 #include "talk/p2p/base/sessiondescription.h"
146 -// Forward declaration to avoid pulling in libsrtp headers here
147 -struct srtp_event_data_t;
148 -struct srtp_ctx_t;
149 -typedef srtp_ctx_t* srtp_t;
150 -struct srtp_policy_t;
151 +#include "srtp2/srtp.h"
153 namespace cricket {