Index: webrtc/p2p/base/dtlstransportchannel_unittest.cc |
diff --git a/webrtc/p2p/base/dtlstransportchannel_unittest.cc b/webrtc/p2p/base/dtlstransportchannel_unittest.cc |
index a967ae31f1b90ad11b0b1bf507920028cc69f970..07e3b87847203150eac14e38b368ab0677e270d7 100644 |
--- a/webrtc/p2p/base/dtlstransportchannel_unittest.cc |
+++ b/webrtc/p2p/base/dtlstransportchannel_unittest.cc |
@@ -28,6 +28,7 @@ |
return; \ |
} |
+static const char AES_CM_128_HMAC_SHA1_80[] = "AES_CM_128_HMAC_SHA1_80"; |
static const char kIceUfrag1[] = "TESTICEUFRAG0001"; |
static const char kIcePwd1[] = "TESTICEPWD00000000000001"; |
static const size_t kPacketNumOffset = 8; |
@@ -149,9 +150,9 @@ |
// SRTP ciphers will be set only in the beginning. |
for (std::vector<cricket::DtlsTransportChannelWrapper*>::iterator it = |
channels_.begin(); it != channels_.end(); ++it) { |
- std::vector<int> ciphers; |
- ciphers.push_back(rtc::SRTP_AES128_CM_SHA1_80); |
- ASSERT_TRUE((*it)->SetSrtpCryptoSuites(ciphers)); |
+ std::vector<std::string> ciphers; |
+ ciphers.push_back(AES_CM_128_HMAC_SHA1_80); |
+ ASSERT_TRUE((*it)->SetSrtpCiphers(ciphers)); |
} |
} |
@@ -214,16 +215,16 @@ |
} |
} |
- void CheckSrtp(int expected_crypto_suite) { |
+ void CheckSrtp(const std::string& expected_cipher) { |
for (std::vector<cricket::DtlsTransportChannelWrapper*>::iterator it = |
channels_.begin(); it != channels_.end(); ++it) { |
- int crypto_suite; |
- |
- bool rv = (*it)->GetSrtpCryptoSuite(&crypto_suite); |
- if (negotiated_dtls_ && expected_crypto_suite) { |
+ std::string cipher; |
+ |
+ bool rv = (*it)->GetSrtpCryptoSuite(&cipher); |
+ if (negotiated_dtls_ && !expected_cipher.empty()) { |
ASSERT_TRUE(rv); |
- ASSERT_EQ(crypto_suite, expected_crypto_suite); |
+ ASSERT_EQ(cipher, expected_cipher); |
} else { |
ASSERT_FALSE(rv); |
} |
@@ -468,11 +469,11 @@ |
// Check that we negotiated the right ciphers. |
if (use_dtls_srtp_) { |
- client1_.CheckSrtp(rtc::SRTP_AES128_CM_SHA1_80); |
- client2_.CheckSrtp(rtc::SRTP_AES128_CM_SHA1_80); |
+ client1_.CheckSrtp(AES_CM_128_HMAC_SHA1_80); |
+ client2_.CheckSrtp(AES_CM_128_HMAC_SHA1_80); |
} else { |
- client1_.CheckSrtp(rtc::SRTP_INVALID_CRYPTO_SUITE); |
- client2_.CheckSrtp(rtc::SRTP_INVALID_CRYPTO_SUITE); |
+ client1_.CheckSrtp(""); |
+ client2_.CheckSrtp(""); |
} |
client1_.CheckSsl(rtc::SSLStreamAdapter::GetDefaultSslCipherForTest( |
ssl_expected_version_, rtc::KT_DEFAULT)); |