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 <algorithm> | 11 #include <algorithm> |
12 | 12 |
13 #include "webrtc/pc/srtpfilter.h" | 13 #include "webrtc/pc/srtpfilter.h" |
14 | 14 |
15 #include "third_party/libsrtp/include/srtp.h" | 15 #include "third_party/libsrtp/include/srtp.h" |
16 #include "webrtc/base/buffer.h" | |
17 #include "webrtc/base/byteorder.h" | |
18 #include "webrtc/base/constructormagic.h" | |
19 #include "webrtc/base/gunit.h" | |
20 #include "webrtc/base/thread.h" | |
21 #include "webrtc/media/base/cryptoparams.h" | 16 #include "webrtc/media/base/cryptoparams.h" |
22 #include "webrtc/media/base/fakertp.h" | 17 #include "webrtc/media/base/fakertp.h" |
23 #include "webrtc/p2p/base/sessiondescription.h" | 18 #include "webrtc/p2p/base/sessiondescription.h" |
| 19 #include "webrtc/rtc_base/buffer.h" |
| 20 #include "webrtc/rtc_base/byteorder.h" |
| 21 #include "webrtc/rtc_base/constructormagic.h" |
| 22 #include "webrtc/rtc_base/gunit.h" |
| 23 #include "webrtc/rtc_base/thread.h" |
24 | 24 |
25 using rtc::CS_AES_CM_128_HMAC_SHA1_80; | 25 using rtc::CS_AES_CM_128_HMAC_SHA1_80; |
26 using rtc::CS_AES_CM_128_HMAC_SHA1_32; | 26 using rtc::CS_AES_CM_128_HMAC_SHA1_32; |
27 using rtc::CS_AEAD_AES_128_GCM; | 27 using rtc::CS_AEAD_AES_128_GCM; |
28 using rtc::CS_AEAD_AES_256_GCM; | 28 using rtc::CS_AEAD_AES_256_GCM; |
29 using cricket::CryptoParams; | 29 using cricket::CryptoParams; |
30 using cricket::CS_LOCAL; | 30 using cricket::CS_LOCAL; |
31 using cricket::CS_REMOTE; | 31 using cricket::CS_REMOTE; |
32 | 32 |
33 static const uint8_t kTestKey1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234"; | 33 static const uint8_t kTestKey1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234"; |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 | 932 |
933 // Go back to normal sequence nubmer. | 933 // Go back to normal sequence nubmer. |
934 // NOTE: without the fix in libsrtp, this would fail. This is because | 934 // NOTE: without the fix in libsrtp, this would fail. This is because |
935 // without the fix, the loop above would keep incrementing local sequence | 935 // without the fix, the loop above would keep incrementing local sequence |
936 // number in libsrtp, eventually the new sequence number would go out side | 936 // number in libsrtp, eventually the new sequence number would go out side |
937 // of the window. | 937 // of the window. |
938 rtc::SetBE16(reinterpret_cast<uint8_t*>(rtp_packet_) + 2, seqnum_small + 1); | 938 rtc::SetBE16(reinterpret_cast<uint8_t*>(rtp_packet_) + 2, seqnum_small + 1); |
939 EXPECT_TRUE(s1_.ProtectRtp(rtp_packet_, rtp_len_, sizeof(rtp_packet_), | 939 EXPECT_TRUE(s1_.ProtectRtp(rtp_packet_, rtp_len_, sizeof(rtp_packet_), |
940 &out_len)); | 940 &out_len)); |
941 } | 941 } |
OLD | NEW |