OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2009 Google Inc. | 3 * Copyright 2009 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include <string> | 33 #include <string> |
34 #include <vector> | 34 #include <vector> |
35 | 35 |
36 #include "talk/media/base/cryptoparams.h" | 36 #include "talk/media/base/cryptoparams.h" |
37 #include "webrtc/p2p/base/sessiondescription.h" | 37 #include "webrtc/p2p/base/sessiondescription.h" |
38 #include "webrtc/base/basictypes.h" | 38 #include "webrtc/base/basictypes.h" |
39 #include "webrtc/base/criticalsection.h" | 39 #include "webrtc/base/criticalsection.h" |
40 #include "webrtc/base/scoped_ptr.h" | 40 #include "webrtc/base/scoped_ptr.h" |
41 #include "webrtc/base/sigslotrepeater.h" | 41 #include "webrtc/base/sigslotrepeater.h" |
42 #include "webrtc/base/sslstreamadapter.h" | 42 #include "webrtc/base/sslstreamadapter.h" |
43 #include "webrtc/base/thread_checker.h" | |
44 | 43 |
45 // Forward declaration to avoid pulling in libsrtp headers here | 44 // Forward declaration to avoid pulling in libsrtp headers here |
46 struct srtp_event_data_t; | 45 struct srtp_event_data_t; |
47 struct srtp_ctx_t; | 46 struct srtp_ctx_t; |
48 struct srtp_policy_t; | 47 struct srtp_policy_t; |
49 | 48 |
50 namespace cricket { | 49 namespace cricket { |
51 | 50 |
52 // Key is 128 bits and salt is 112 bits == 30 bytes. B64 bloat => 40 bytes. | 51 // Key is 128 bits and salt is 112 bits == 30 bytes. B64 bloat => 40 bytes. |
53 extern const int SRTP_MASTER_KEY_BASE64_LEN; | 52 extern const int SRTP_MASTER_KEY_BASE64_LEN; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 233 |
235 private: | 234 private: |
236 bool SetKey(int type, const std::string& cs, const uint8_t* key, int len); | 235 bool SetKey(int type, const std::string& cs, const uint8_t* key, int len); |
237 // Returns send stream current packet index from srtp db. | 236 // Returns send stream current packet index from srtp db. |
238 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); | 237 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); |
239 | 238 |
240 static bool Init(); | 239 static bool Init(); |
241 void HandleEvent(const srtp_event_data_t* ev); | 240 void HandleEvent(const srtp_event_data_t* ev); |
242 static void HandleEventThunk(srtp_event_data_t* ev); | 241 static void HandleEventThunk(srtp_event_data_t* ev); |
243 | 242 |
244 rtc::ThreadChecker thread_checker_; | 243 static std::list<SrtpSession*>* sessions(); |
| 244 |
245 srtp_ctx_t* session_; | 245 srtp_ctx_t* session_; |
246 int rtp_auth_tag_len_; | 246 int rtp_auth_tag_len_; |
247 int rtcp_auth_tag_len_; | 247 int rtcp_auth_tag_len_; |
248 rtc::scoped_ptr<SrtpStat> srtp_stat_; | 248 rtc::scoped_ptr<SrtpStat> srtp_stat_; |
249 static bool inited_; | 249 static bool inited_; |
250 static rtc::GlobalLockPod lock_; | 250 static rtc::GlobalLockPod lock_; |
251 int last_send_seq_num_; | 251 int last_send_seq_num_; |
252 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession); | 252 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession); |
253 }; | 253 }; |
254 | 254 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 std::map<FailureKey, FailureStat> failures_; | 320 std::map<FailureKey, FailureStat> failures_; |
321 // Threshold in ms to silent the signaling errors. | 321 // Threshold in ms to silent the signaling errors. |
322 uint32_t signal_silent_time_; | 322 uint32_t signal_silent_time_; |
323 | 323 |
324 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); | 324 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); |
325 }; | 325 }; |
326 | 326 |
327 } // namespace cricket | 327 } // namespace cricket |
328 | 328 |
329 #endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ | 329 #endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ |
OLD | NEW |