From 56395a63c257505bc22f2de55be851abb0d7983d Mon Sep 17 00:00:00 2001 From: Jeremy Leconte Date: Wed, 11 Dec 2024 23:54:07 -0800 Subject: [PATCH] Revert "srtp: use SRTP_SRCTP_INDEX_LEN define from libsrtp 2.6.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7738bc23ed7fee0d4856bdfe7b88985865829441. Reason for revert: Some downstream projects are still using an older version of libsrtp Original change's description: > srtp: use SRTP_SRCTP_INDEX_LEN define from libsrtp 2.6.0 > > BUG=webrtc:42222036 > > Change-Id: Ibf5c6b200501c114b9709b76685bb0ecd30bf9fb > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359627 > Commit-Queue: Philipp Hancke > Reviewed-by: Harald Alvestrand > Reviewed-by: Henrik Boström > Cr-Commit-Position: refs/heads/main@{#43538} Bug: webrtc:42222036 Change-Id: Icdac768bd4ccb6f1f4ada68637c0b979aefc39f6 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371240 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com Owners-Override: Jeremy Leconte Commit-Queue: Jeremy Leconte Cr-Commit-Position: refs/heads/main@{#43544} --- pc/srtp_session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc/srtp_session.cc b/pc/srtp_session.cc index 456c02c215..509c2c9124 100644 --- a/pc/srtp_session.cc +++ b/pc/srtp_session.cc @@ -249,7 +249,7 @@ bool SrtpSession::ProtectRtcp(void* p, int in_len, int max_len, int* out_len) { // SRTP_MAX_TRAILER_LEN bytes of free space after the data. WebRTC // never includes a MKI, therefore the amount of bytes added by the // srtp_protect_rtp call is known in advance and depends on the cipher suite. - int need_len = in_len + SRTP_SRCTP_INDEX_LEN + rtcp_auth_tag_len_; + int need_len = in_len + sizeof(uint32_t) + rtcp_auth_tag_len_; // NOLINT if (max_len < need_len) { RTC_LOG(LS_WARNING) << "Failed to protect SRTCP packet: The buffer length " << max_len << " is less than the needed " << need_len;