Replace NSS with Pale Moon's

This commit is contained in:
wuggy 2026-06-29 21:29:25 +01:00
commit 8c2e376f94
2870 changed files with 1762232 additions and 1374220 deletions

View file

@ -1,4 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -24,21 +25,6 @@ class GatherV2ClientHelloTest : public TlsConnectTestBase {
}
};
// Gather a 5-byte v3 record, with a zero fragment length. The empty handshake
// message should be ignored, and the connection will succeed afterwards.
TEST_F(TlsConnectTest, GatherEmptyV3Record) {
DataBuffer buffer;
size_t idx = 0;
idx = buffer.Write(idx, 0x16, 1); // handshake
idx = buffer.Write(idx, 0x0301, 2); // record_version
(void)buffer.Write(idx, 0U, 2); // length=0
EnsureTlsSetup();
client_->SendDirect(buffer);
Connect();
}
// Gather a 5-byte v3 record, with a fragment length exceeding the maximum.
TEST_F(TlsConnectTest, GatherExcessiveV3Record) {
DataBuffer buffer;
@ -140,4 +126,31 @@ TEST_F(GatherV2ClientHelloTest, GatherEmptyV2RecordShortHeader) {
ConnectExpectMalformedClientHello(buffer);
}
/* Test correct gather buffer clearing/freeing and (re-)allocation.
*
* Freeing and (re-)allocation of the gather buffers after reception of single
* records is only done in DEBUG builds. Normally they are created and
* destroyed with the SSL socket.
*
* TLS 1.0 record splitting leads to implicit complete read of the data.
*
* The NSS DTLS impelmentation does not allow partial reads
* (see sslsecur.c, line 535-543). */
TEST_P(TlsConnectStream, GatherBufferPartialReadTest) {
EnsureTlsSetup();
Connect();
client_->SendData(1000);
if (version_ > SSL_LIBRARY_VERSION_TLS_1_0) {
for (unsigned i = 1; i <= 20; i++) {
server_->ReadBytes(50);
ASSERT_EQ(server_->received_bytes(), 50U * i);
}
} else {
server_->ReadBytes(50);
ASSERT_EQ(server_->received_bytes(), 1000U);
}
}
} // namespace nss_test