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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // If an HMAC is used, this will decrease the packet size. | 131 // If an HMAC is used, this will decrease the packet size. |
132 bool UnprotectRtp(void* data, int in_len, int* out_len); | 132 bool UnprotectRtp(void* data, int in_len, int* out_len); |
133 bool UnprotectRtcp(void* data, int in_len, int* out_len); | 133 bool UnprotectRtcp(void* data, int in_len, int* out_len); |
134 | 134 |
135 // Returns rtp auth params from srtp context. | 135 // Returns rtp auth params from srtp context. |
136 bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); | 136 bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); |
137 | 137 |
138 // Update the silent threshold (in ms) for signaling errors. | 138 // Update the silent threshold (in ms) for signaling errors. |
139 void set_signal_silent_time(uint32_t signal_silent_time_in_ms); | 139 void set_signal_silent_time(uint32_t signal_silent_time_in_ms); |
140 | 140 |
| 141 bool ResetParams(); |
| 142 |
141 sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError; | 143 sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError; |
142 | 144 |
143 protected: | 145 protected: |
144 bool ExpectOffer(ContentSource source); | 146 bool ExpectOffer(ContentSource source); |
145 bool StoreParams(const std::vector<CryptoParams>& params, | 147 bool StoreParams(const std::vector<CryptoParams>& params, |
146 ContentSource source); | 148 ContentSource source); |
147 bool ExpectAnswer(ContentSource source); | 149 bool ExpectAnswer(ContentSource source); |
148 bool DoSetAnswer(const std::vector<CryptoParams>& answer_params, | 150 bool DoSetAnswer(const std::vector<CryptoParams>& answer_params, |
149 ContentSource source, | 151 ContentSource source, |
150 bool final); | 152 bool final); |
151 void CreateSrtpSessions(); | 153 void CreateSrtpSessions(); |
152 bool NegotiateParams(const std::vector<CryptoParams>& answer_params, | 154 bool NegotiateParams(const std::vector<CryptoParams>& answer_params, |
153 CryptoParams* selected_params); | 155 CryptoParams* selected_params); |
154 bool ApplyParams(const CryptoParams& send_params, | 156 bool ApplyParams(const CryptoParams& send_params, |
155 const CryptoParams& recv_params); | 157 const CryptoParams& recv_params); |
156 bool ResetParams(); | |
157 static bool ParseKeyParams(const std::string& params, uint8_t* key, int len); | 158 static bool ParseKeyParams(const std::string& params, uint8_t* key, int len); |
158 | 159 |
159 private: | 160 private: |
160 enum State { | 161 enum State { |
161 ST_INIT, // SRTP filter unused. | 162 ST_INIT, // SRTP filter unused. |
162 ST_SENTOFFER, // Offer with SRTP parameters sent. | 163 ST_SENTOFFER, // Offer with SRTP parameters sent. |
163 ST_RECEIVEDOFFER, // Offer with SRTP parameters received. | 164 ST_RECEIVEDOFFER, // Offer with SRTP parameters received. |
164 ST_SENTPRANSWER_NO_CRYPTO, // Sent provisional answer without crypto. | 165 ST_SENTPRANSWER_NO_CRYPTO, // Sent provisional answer without crypto. |
165 // Received provisional answer without crypto. | 166 // Received provisional answer without crypto. |
166 ST_RECEIVEDPRANSWER_NO_CRYPTO, | 167 ST_RECEIVEDPRANSWER_NO_CRYPTO, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 std::map<FailureKey, FailureStat> failures_; | 321 std::map<FailureKey, FailureStat> failures_; |
321 // Threshold in ms to silent the signaling errors. | 322 // Threshold in ms to silent the signaling errors. |
322 uint32_t signal_silent_time_; | 323 uint32_t signal_silent_time_; |
323 | 324 |
324 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); | 325 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); |
325 }; | 326 }; |
326 | 327 |
327 } // namespace cricket | 328 } // namespace cricket |
328 | 329 |
329 #endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ | 330 #endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ |
OLD | NEW |