Bug 1251822 - Disable ChaCha20Poly1305 for unit tests that check cipher suite, r=ekr
authorMartin Thomson <martin.thomson@gmail.com>
Wed, 16 Mar 2016 17:52:49 +1100
changeset 312898 b569aa5415cab20998ceb7f34363e4aca14aef4c
parent 312897 57a4d8b83db2fc938aa81fcc139786086a4263b3
child 312899 22b32ab5ce8f779b35b664d6114ab5cf5f9a9f77
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersekr
bugs1251822
milestone48.0a1
Bug 1251822 - Disable ChaCha20Poly1305 for unit tests that check cipher suite, r=ekr MozReview-Commit-ID: H7IW0iOTAzx
media/mtransport/test/transport_unittests.cpp
--- a/media/mtransport/test/transport_unittests.cpp
+++ b/media/mtransport/test/transport_unittests.cpp
@@ -957,30 +957,42 @@ class TransportTest : public MtransportT
   nsCOMPtr<nsIEventTarget> target_;
 };
 
 
 TEST_F(TransportTest, TestNoDtlsVerificationSettings) {
   ConnectSocketExpectFail();
 }
 
+static void DisableChaCha(TransportTestPeer* peer) {
+  // On ARM, ChaCha20Poly1305 might be preferred; disable it for the tests that
+  // want to check the cipher suite.  It doesn't matter which peer disables the
+  // suite, disabling on either side has the same effect.
+  std::vector<uint16_t> chachaSuites;
+  chachaSuites.push_back(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256);
+  chachaSuites.push_back(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256);
+  peer->SetCipherSuiteChanges(std::vector<uint16_t>(), chachaSuites);
+}
+
 TEST_F(TransportTest, TestConnect) {
   SetDtlsPeer();
+  DisableChaCha(p1_);
   ConnectSocket();
 
   // check that we got the right suite
   ASSERT_EQ(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, p1_->cipherSuite());
 
   // no SRTP on this one
   ASSERT_EQ(0, p1_->srtpCipher());
 }
 
 TEST_F(TransportTest, TestConnectSrtp) {
   SetupSrtp();
   SetDtlsPeer();
+  DisableChaCha(p2_);
   ConnectSocket();
 
   ASSERT_EQ(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, p1_->cipherSuite());
 
   // SRTP is on
   ASSERT_EQ(SRTP_AES128_CM_HMAC_SHA1_80, p1_->srtpCipher());
 }