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 | |
143 sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError; | 141 sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError; |
144 | 142 |
145 protected: | 143 protected: |
146 bool ExpectOffer(ContentSource source); | 144 bool ExpectOffer(ContentSource source); |
147 bool StoreParams(const std::vector<CryptoParams>& params, | 145 bool StoreParams(const std::vector<CryptoParams>& params, |
148 ContentSource source); | 146 ContentSource source); |
149 bool ExpectAnswer(ContentSource source); | 147 bool ExpectAnswer(ContentSource source); |
150 bool DoSetAnswer(const std::vector<CryptoParams>& answer_params, | 148 bool DoSetAnswer(const std::vector<CryptoParams>& answer_params, |
151 ContentSource source, | 149 ContentSource source, |
152 bool final); | 150 bool final); |
153 void CreateSrtpSessions(); | 151 void CreateSrtpSessions(); |
154 bool NegotiateParams(const std::vector<CryptoParams>& answer_params, | 152 bool NegotiateParams(const std::vector<CryptoParams>& answer_params, |
155 CryptoParams* selected_params); | 153 CryptoParams* selected_params); |
156 bool ApplyParams(const CryptoParams& send_params, | 154 bool ApplyParams(const CryptoParams& send_params, |
157 const CryptoParams& recv_params); | 155 const CryptoParams& recv_params); |
| 156 bool ResetParams(); |
158 static bool ParseKeyParams(const std::string& params, uint8_t* key, int len); | 157 static bool ParseKeyParams(const std::string& params, uint8_t* key, int len); |
159 | 158 |
160 private: | 159 private: |
161 enum State { | 160 enum State { |
162 ST_INIT, // SRTP filter unused. | 161 ST_INIT, // SRTP filter unused. |
163 ST_SENTOFFER, // Offer with SRTP parameters sent. | 162 ST_SENTOFFER, // Offer with SRTP parameters sent. |
164 ST_RECEIVEDOFFER, // Offer with SRTP parameters received. | 163 ST_RECEIVEDOFFER, // Offer with SRTP parameters received. |
165 ST_SENTPRANSWER_NO_CRYPTO, // Sent provisional answer without crypto. | 164 ST_SENTPRANSWER_NO_CRYPTO, // Sent provisional answer without crypto. |
166 // Received provisional answer without crypto. | 165 // Received provisional answer without crypto. |
167 ST_RECEIVEDPRANSWER_NO_CRYPTO, | 166 ST_RECEIVEDPRANSWER_NO_CRYPTO, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 std::map<FailureKey, FailureStat> failures_; | 320 std::map<FailureKey, FailureStat> failures_; |
322 // Threshold in ms to silent the signaling errors. | 321 // Threshold in ms to silent the signaling errors. |
323 uint32_t signal_silent_time_; | 322 uint32_t signal_silent_time_; |
324 | 323 |
325 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); | 324 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); |
326 }; | 325 }; |
327 | 326 |
328 } // namespace cricket | 327 } // namespace cricket |
329 | 328 |
330 #endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ | 329 #endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ |
OLD | NEW |