diff options
Diffstat (limited to 'webrtc/p2p/base/faketransportcontroller.h')
-rw-r--r-- | webrtc/p2p/base/faketransportcontroller.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/webrtc/p2p/base/faketransportcontroller.h b/webrtc/p2p/base/faketransportcontroller.h index 3e656fa4a3..65c59be98d 100644 --- a/webrtc/p2p/base/faketransportcontroller.h +++ b/webrtc/p2p/base/faketransportcontroller.h @@ -242,20 +242,20 @@ class FakeTransportChannel : public TransportChannelImpl, bool IsDtlsActive() const override { return do_dtls_; } - bool SetSrtpCiphers(const std::vector<std::string>& ciphers) override { + bool SetSrtpCryptoSuites(const std::vector<int>& ciphers) override { srtp_ciphers_ = ciphers; return true; } - bool GetSrtpCryptoSuite(std::string* cipher) override { - if (!chosen_srtp_cipher_.empty()) { - *cipher = chosen_srtp_cipher_; + bool GetSrtpCryptoSuite(int* crypto_suite) override { + if (chosen_crypto_suite_ != rtc::SRTP_INVALID_CRYPTO_SUITE) { + *crypto_suite = chosen_crypto_suite_; return true; } return false; } - bool GetSslCipherSuite(int* cipher) override { return false; } + bool GetSslCipherSuite(int* cipher_suite) override { return false; } rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const { return local_cert_; @@ -275,7 +275,7 @@ class FakeTransportChannel : public TransportChannelImpl, bool use_context, uint8_t* result, size_t result_len) override { - if (!chosen_srtp_cipher_.empty()) { + if (chosen_crypto_suite_ != rtc::SRTP_INVALID_CRYPTO_SUITE) { memset(result, 0xff, result_len); return true; } @@ -284,14 +284,13 @@ class FakeTransportChannel : public TransportChannelImpl, } void NegotiateSrtpCiphers() { - for (std::vector<std::string>::const_iterator it1 = srtp_ciphers_.begin(); + for (std::vector<int>::const_iterator it1 = srtp_ciphers_.begin(); it1 != srtp_ciphers_.end(); ++it1) { - for (std::vector<std::string>::const_iterator it2 = - dest_->srtp_ciphers_.begin(); + for (std::vector<int>::const_iterator it2 = dest_->srtp_ciphers_.begin(); it2 != dest_->srtp_ciphers_.end(); ++it2) { if (*it1 == *it2) { - chosen_srtp_cipher_ = *it1; - dest_->chosen_srtp_cipher_ = *it2; + chosen_crypto_suite_ = *it1; + dest_->chosen_crypto_suite_ = *it2; return; } } @@ -322,8 +321,8 @@ class FakeTransportChannel : public TransportChannelImpl, rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; rtc::FakeSSLCertificate* remote_cert_ = nullptr; bool do_dtls_ = false; - std::vector<std::string> srtp_ciphers_; - std::string chosen_srtp_cipher_; + std::vector<int> srtp_ciphers_; + int chosen_crypto_suite_ = rtc::SRTP_INVALID_CRYPTO_SUITE; int receiving_timeout_ = -1; bool gather_continually_ = false; IceRole role_ = ICEROLE_UNKNOWN; @@ -333,7 +332,7 @@ class FakeTransportChannel : public TransportChannelImpl, std::string remote_ice_ufrag_; std::string remote_ice_pwd_; IceMode remote_ice_mode_ = ICEMODE_FULL; - rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_10; + rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; rtc::SSLFingerprint dtls_fingerprint_; rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; size_t connection_count_ = 0; @@ -454,7 +453,7 @@ class FakeTransport : public Transport { FakeTransport* dest_ = nullptr; bool async_ = false; rtc::scoped_refptr<rtc::RTCCertificate> certificate_; - rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_10; + rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; }; // Fake TransportController class, which can be passed into a BaseChannel object |