OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/pc/srtpfilter.h" | 11 #include "webrtc/pc/srtpfilter.h" |
12 | 12 |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include <algorithm> | 15 #include <algorithm> |
16 | 16 |
| 17 #include "third_party/libsrtp/include/srtp.h" |
| 18 #include "third_party/libsrtp/include/srtp_priv.h" |
17 #include "webrtc/base/base64.h" | 19 #include "webrtc/base/base64.h" |
18 #include "webrtc/base/buffer.h" | 20 #include "webrtc/base/buffer.h" |
19 #include "webrtc/base/byteorder.h" | 21 #include "webrtc/base/byteorder.h" |
20 #include "webrtc/base/checks.h" | 22 #include "webrtc/base/checks.h" |
21 #include "webrtc/base/common.h" | 23 #include "webrtc/base/common.h" |
22 #include "webrtc/base/logging.h" | 24 #include "webrtc/base/logging.h" |
23 #include "webrtc/base/stringencode.h" | 25 #include "webrtc/base/stringencode.h" |
24 #include "webrtc/base/timeutils.h" | 26 #include "webrtc/base/timeutils.h" |
25 #include "webrtc/media/base/rtputils.h" | 27 #include "webrtc/media/base/rtputils.h" |
26 #include "webrtc/pc/externalhmac.h" | 28 #include "webrtc/pc/externalhmac.h" |
27 | 29 |
28 #ifdef HAVE_SRTP | |
29 extern "C" { | |
30 #ifdef SRTP_RELATIVE_PATH | |
31 #include "srtp.h" // NOLINT | |
32 #include "srtp_priv.h" // NOLINT | |
33 #else | |
34 #include "third_party/libsrtp/include/srtp.h" | |
35 #include "third_party/libsrtp/include/srtp_priv.h" | |
36 #endif // SRTP_RELATIVE_PATH | |
37 } | |
38 #endif // HAVE_SRTP | |
39 | |
40 namespace cricket { | 30 namespace cricket { |
41 | 31 |
42 #ifndef HAVE_SRTP | 32 #ifndef HAVE_SRTP |
43 | 33 |
44 // This helper function is used on systems that don't (yet) have SRTP, | 34 // This helper function is used on systems that don't (yet) have SRTP, |
45 // to log that the functions that require it won't do anything. | 35 // to log that the functions that require it won't do anything. |
46 namespace { | 36 namespace { |
47 bool SrtpNotAvailable(const char *func) { | 37 bool SrtpNotAvailable(const char *func) { |
48 LOG(LS_ERROR) << func << ": SRTP is not available on your system."; | 38 LOG(LS_ERROR) << func << ": SRTP is not available on your system."; |
49 return false; | 39 return false; |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 SrtpNotAvailable(__FUNCTION__); | 923 SrtpNotAvailable(__FUNCTION__); |
934 } | 924 } |
935 | 925 |
936 void SrtpStat::HandleSrtpResult(const SrtpStat::FailureKey& key) { | 926 void SrtpStat::HandleSrtpResult(const SrtpStat::FailureKey& key) { |
937 SrtpNotAvailable(__FUNCTION__); | 927 SrtpNotAvailable(__FUNCTION__); |
938 } | 928 } |
939 | 929 |
940 #endif // HAVE_SRTP | 930 #endif // HAVE_SRTP |
941 | 931 |
942 } // namespace cricket | 932 } // namespace cricket |
OLD | NEW |