chromium/third_party/webrtc/pc/srtp_session.cc

/*
 *  Copyright 2017 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "pc/srtp_session.h"

#include <string.h>

#include <iomanip>
#include <string>

#include "absl/base/attributes.h"
#include "absl/base/const_init.h"
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/field_trials_view.h"
#include "modules/rtp_rtcp/source/rtp_util.h"
#include "pc/external_hmac.h"
#include "rtc_base/byte_order.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/string_encode.h"
#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"

namespace cricket {

namespace {
class LibSrtpInitializer {};

void LibSrtpInitializer::ProhibitLibsrtpInitialization() {}

bool LibSrtpInitializer::IncrementLibsrtpUsageCountAndMaybeInit(
    srtp_event_handler_func_t* handler) {}

void LibSrtpInitializer::DecrementLibsrtpUsageCountAndMaybeDeinit() {}

}  // namespace

ParseRtpSequenceNumber;

// One more than the maximum libsrtp error code. Required by
// RTC_HISTOGRAM_ENUMERATION. Keep this in sync with srtp_error_status_t defined
// in srtp.h.
constexpr int kSrtpErrorCodeBoundary =;

SrtpSession::SrtpSession() {}

SrtpSession::SrtpSession(const webrtc::FieldTrialsView& field_trials) {}

SrtpSession::~SrtpSession() {}

bool SrtpSession::SetSend(int crypto_suite,
                          const uint8_t* key,
                          size_t len,
                          const std::vector<int>& extension_ids) {}

bool SrtpSession::UpdateSend(int crypto_suite,
                             const uint8_t* key,
                             size_t len,
                             const std::vector<int>& extension_ids) {}

bool SrtpSession::SetRecv(int crypto_suite,
                          const uint8_t* key,
                          size_t len,
                          const std::vector<int>& extension_ids) {}

bool SrtpSession::UpdateRecv(int crypto_suite,
                             const uint8_t* key,
                             size_t len,
                             const std::vector<int>& extension_ids) {}

bool SrtpSession::ProtectRtp(void* p, int in_len, int max_len, int* out_len) {}

bool SrtpSession::ProtectRtp(void* p,
                             int in_len,
                             int max_len,
                             int* out_len,
                             int64_t* index) {}

bool SrtpSession::ProtectRtcp(void* p, int in_len, int max_len, int* out_len) {}

bool SrtpSession::UnprotectRtp(void* p, int in_len, int* out_len) {}

bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) {}

bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {}

int SrtpSession::GetSrtpOverhead() const {}

void SrtpSession::EnableExternalAuth() {}

bool SrtpSession::IsExternalAuthEnabled() const {}

bool SrtpSession::IsExternalAuthActive() const {}

bool SrtpSession::RemoveSsrcFromSession(uint32_t ssrc) {}

bool SrtpSession::GetSendStreamPacketIndex(void* p,
                                           int in_len,
                                           int64_t* index) {}

bool SrtpSession::DoSetKey(int type,
                           int crypto_suite,
                           const uint8_t* key,
                           size_t len,
                           const std::vector<int>& extension_ids) {}

bool SrtpSession::SetKey(int type,
                         int crypto_suite,
                         const uint8_t* key,
                         size_t len,
                         const std::vector<int>& extension_ids) {}

bool SrtpSession::UpdateKey(int type,
                            int crypto_suite,
                            const uint8_t* key,
                            size_t len,
                            const std::vector<int>& extension_ids) {}

void ProhibitLibsrtpInitialization() {}

void SrtpSession::HandleEvent(const srtp_event_data_t* ev) {}

void SrtpSession::HandleEventThunk(srtp_event_data_t* ev) {}

// Logs the unencrypted packet in text2pcap format. This can then be
// extracted by searching for RTP_DUMP
//   grep RTP_DUMP chrome_debug.log > in.txt
// and converted to pcap using
//   text2pcap -D -u 1000,2000 -t %H:%M:%S. in.txt out.pcap
// The resulting file can be replayed using the WebRTC video_replay tool and
// be inspected in Wireshark using the RTP, VP8 and H264 dissectors.
void SrtpSession::DumpPacket(const void* buf, int len, bool outbound) {}

}  // namespace cricket