| 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" |
| 43 | 44 |
| 44 // Forward declaration to avoid pulling in libsrtp headers here | 45 // Forward declaration to avoid pulling in libsrtp headers here |
| 45 struct srtp_event_data_t; | 46 struct srtp_event_data_t; |
| 46 struct srtp_ctx_t; | 47 struct srtp_ctx_t; |
| 47 struct srtp_policy_t; | 48 struct srtp_policy_t; |
| 48 | 49 |
| 49 namespace cricket { | 50 namespace cricket { |
| 50 | 51 |
| 51 // Key is 128 bits and salt is 112 bits == 30 bytes. B64 bloat => 40 bytes. | 52 // Key is 128 bits and salt is 112 bits == 30 bytes. B64 bloat => 40 bytes. |
| 52 extern const int SRTP_MASTER_KEY_BASE64_LEN; | 53 extern const int SRTP_MASTER_KEY_BASE64_LEN; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 234 |
| 234 private: | 235 private: |
| 235 bool SetKey(int type, const std::string& cs, const uint8_t* key, int len); | 236 bool SetKey(int type, const std::string& cs, const uint8_t* key, int len); |
| 236 // Returns send stream current packet index from srtp db. | 237 // Returns send stream current packet index from srtp db. |
| 237 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); | 238 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); |
| 238 | 239 |
| 239 static bool Init(); | 240 static bool Init(); |
| 240 void HandleEvent(const srtp_event_data_t* ev); | 241 void HandleEvent(const srtp_event_data_t* ev); |
| 241 static void HandleEventThunk(srtp_event_data_t* ev); | 242 static void HandleEventThunk(srtp_event_data_t* ev); |
| 242 | 243 |
| 243 static std::list<SrtpSession*>* sessions(); | 244 rtc::ThreadChecker thread_checker_; |
| 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 |