Bug 1381198 - update fuzzing test, a=bustage NSS_TLS13_DRAFT19_BRANCH
authorMartin Thomson <martin.thomson@gmail.com>
Sat, 15 Jul 2017 10:02:05 +0200
branchNSS_TLS13_DRAFT19_BRANCH
changeset 13461 57c9c3838e79394c3f297ebe0a51c30430cf0e48
parent 13460 1ddac49068324ddb8d6c3f7bf1cb253a8ba773a9
child 13462 e1c050652e1685007a240c9c8c2c5c55d1f8ef2b
push id2270
push usermartin.thomson@gmail.com
push dateSat, 15 Jul 2017 09:08:25 +0000
reviewersbustage
bugs1381198
Bug 1381198 - update fuzzing test, a=bustage try: -b do -p linux64-fuzz -u gtest
gtests/ssl_gtest/ssl_fuzz_unittest.cc
--- a/gtests/ssl_gtest/ssl_fuzz_unittest.cc
+++ b/gtests/ssl_gtest/ssl_fuzz_unittest.cc
@@ -271,20 +271,23 @@ FUZZ_P(TlsConnectGeneric, SessionTicketR
 FUZZ_P(TlsConnectGeneric, UnencryptedSessionTickets) {
   ConfigureSessionCache(RESUME_TICKET, RESUME_TICKET);
 
   auto i1 = std::make_shared<TlsInspectorRecordHandshakeMessage>(
       kTlsHandshakeNewSessionTicket);
   server_->SetPacketFilter(i1);
   Connect();
 
+  std::cerr << "ticket" << i1->buffer() << std::endl;
   size_t offset = 4; /* lifetime */
   if (version_ == SSL_LIBRARY_VERSION_TLS_1_3) {
-    offset += 1 + 1 + /* ke_modes */
-              1 + 1;  /* auth_modes */
+    offset += 4;  /* ticket_age_add */
+    uint32_t nonce_len;
+    EXPECT_TRUE(i1->buffer().Read(offset, 1, &nonce_len));
+    offset += 1 + nonce_len;
   }
   offset += 2 + /* ticket length */
             2;  /* TLS_EX_SESS_TICKET_VERSION */
   // Check the protocol version number.
   uint32_t tls_version = 0;
   EXPECT_TRUE(i1->buffer().Read(offset, sizeof(version_), &tls_version));
   EXPECT_EQ(version_, static_cast<decltype(version_)>(tls_version));