Bug 1396487 - Use variables in place of all hard-coded values, r=me NSS_TLS13_DRAFT19_BRANCH
authorMartin Thomson <martin.thomson@gmail.com>
Tue, 26 Sep 2017 16:37:09 +1000
branchNSS_TLS13_DRAFT19_BRANCH
changeset 13610 7039fffea93782512241df32268edf6aa20438ba
parent 13609 27bfdd0ee644c33d3445a844d17d9042e0210035
child 13614 3e803b9a08c8820f035cfe9189409c101144f8a9
push id2391
push usermartin.thomson@gmail.com
push dateTue, 26 Sep 2017 06:37:32 +0000
reviewersme
bugs1396487
Bug 1396487 - Use variables in place of all hard-coded values, r=me
gtests/ssl_gtest/ssl_loopback_unittest.cc
--- a/gtests/ssl_gtest/ssl_loopback_unittest.cc
+++ b/gtests/ssl_gtest/ssl_loopback_unittest.cc
@@ -462,17 +462,17 @@ TEST_F(TlsConnectStreamTls13, BothAltHan
   ASSERT_EQ(kTlsHandshakeType, header_filter->header(1)->content_type());
   uint32_t ver;
   ASSERT_TRUE(sh_filter->buffer().Read(0, 2, &ver));
   ASSERT_EQ((uint32_t)(0x7a00 | TLS_1_3_DRAFT_VERSION), ver);
 }
 
 static size_t ExpectedCbcLen(size_t in, size_t hmac = 20, size_t block = 16) {
   // MAC-then-Encrypt expansion formula:
-  return ((in + hmac + (block - 1)) / 16) * 16;
+  return ((in + hmac + (block - 1)) / block) * block;
 }
 
 TEST_F(TlsConnectTest, OneNRecordSplitting) {
   ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_0);
   EnsureTlsSetup();
   ConnectWithCipherSuite(TLS_RSA_WITH_AES_128_CBC_SHA);
   auto records = std::make_shared<TlsRecordRecorder>();
   server_->SetPacketFilter(records);