OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 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/base/byteorder.h" | 11 #include "webrtc/base/byteorder.h" |
12 #include "webrtc/base/gunit.h" | 12 #include "webrtc/base/gunit.h" |
13 #include "webrtc/base/thread.h" | 13 #include "webrtc/base/thread.h" |
14 #include "webrtc/media/base/cryptoparams.h" | 14 #include "webrtc/media/base/cryptoparams.h" |
15 #include "webrtc/media/base/fakertp.h" | 15 #include "webrtc/media/base/fakertp.h" |
16 #include "webrtc/p2p/base/sessiondescription.h" | 16 #include "webrtc/p2p/base/sessiondescription.h" |
17 #include "webrtc/pc/srtpfilter.h" | 17 #include "webrtc/pc/srtpfilter.h" |
18 extern "C" { | 18 extern "C" { |
19 #ifdef SRTP_RELATIVE_PATH | |
20 #include "crypto/include/err.h" | |
21 #else | |
22 #include "third_party/libsrtp/srtp/crypto/include/err.h" | 19 #include "third_party/libsrtp/srtp/crypto/include/err.h" |
23 #endif | |
24 } | 20 } |
25 | 21 |
26 using rtc::CS_AES_CM_128_HMAC_SHA1_80; | 22 using rtc::CS_AES_CM_128_HMAC_SHA1_80; |
27 using rtc::CS_AES_CM_128_HMAC_SHA1_32; | 23 using rtc::CS_AES_CM_128_HMAC_SHA1_32; |
28 using cricket::CryptoParams; | 24 using cricket::CryptoParams; |
29 using cricket::CS_LOCAL; | 25 using cricket::CS_LOCAL; |
30 using cricket::CS_REMOTE; | 26 using cricket::CS_REMOTE; |
31 | 27 |
32 static const uint8_t kTestKey1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234"; | 28 static const uint8_t kTestKey1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234"; |
33 static const uint8_t kTestKey2[] = "4321ZYXWVUTSRQPONMLKJIHGFEDCBA"; | 29 static const uint8_t kTestKey2[] = "4321ZYXWVUTSRQPONMLKJIHGFEDCBA"; |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); | 895 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); |
900 EXPECT_EQ(-1, mode_); | 896 EXPECT_EQ(-1, mode_); |
901 EXPECT_EQ(cricket::SrtpFilter::ERROR_NONE, error_); | 897 EXPECT_EQ(cricket::SrtpFilter::ERROR_NONE, error_); |
902 // Now the error will be triggered again. | 898 // Now the error will be triggered again. |
903 Reset(); | 899 Reset(); |
904 rtc::Thread::Current()->SleepMs(210); | 900 rtc::Thread::Current()->SleepMs(210); |
905 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); | 901 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); |
906 EXPECT_EQ(cricket::SrtpFilter::UNPROTECT, mode_); | 902 EXPECT_EQ(cricket::SrtpFilter::UNPROTECT, mode_); |
907 EXPECT_EQ(cricket::SrtpFilter::ERROR_FAIL, error_); | 903 EXPECT_EQ(cricket::SrtpFilter::ERROR_FAIL, error_); |
908 } | 904 } |
OLD | NEW |