"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "nss/gtests/ssl_gtest/ssl_recordsize_unittest.cc" between
nss-3.61.tar.gz and nss-3.62.tar.gz

About: NSS is a set of libraries, APIs, utilities, and documentation designed to support cross-platform development of security-enabled client and server applications. It provides a complete implementation of the crypto libraries used by Mozilla and other companies.

ssl_recordsize_unittest.cc  (nss-3.61):ssl_recordsize_unittest.cc  (nss-3.62)
skipping to change at line 269 skipping to change at line 269
client_->ExpectReadWriteError(); client_->ExpectReadWriteError();
ExpectAlert(client_, kTlsAlertRecordOverflow); ExpectAlert(client_, kTlsAlertRecordOverflow);
client_->ReadBytes(100); client_->ReadBytes(100);
EXPECT_EQ(SSL_ERROR_RX_RECORD_TOO_LONG, client_->error_code()); EXPECT_EQ(SSL_ERROR_RX_RECORD_TOO_LONG, client_->error_code());
// Consume the alert at the server. // Consume the alert at the server.
server_->Handshake(); server_->Handshake();
server_->CheckErrorCode(SSL_ERROR_RECORD_OVERFLOW_ALERT); server_->CheckErrorCode(SSL_ERROR_RECORD_OVERFLOW_ALERT);
} }
TEST_F(TlsConnectStreamTls13, ClientHelloF5Padding) {
EnsureTlsSetup();
ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
ScopedPK11SymKey key(
PK11_KeyGen(slot.get(), CKM_NSS_CHACHA20_POLY1305, nullptr, 32, nullptr));
auto filter =
MakeTlsFilter<TlsHandshakeRecorder>(client_, kTlsHandshakeClientHello);
// Add PSK with label long enough to push CH length into [256, 511].
std::vector<uint8_t> label(100);
EXPECT_EQ(SECSuccess,
SSL_AddExternalPsk(client_->ssl_fd(), key.get(), label.data(),
label.size(), ssl_hash_sha256));
StartConnect();
client_->Handshake();
// Filter removes the 4B handshake header.
EXPECT_EQ(508UL, filter->buffer().len());
}
// This indiscriminately adds padding to application data records. // This indiscriminately adds padding to application data records.
class TlsRecordPadder : public TlsRecordFilter { class TlsRecordPadder : public TlsRecordFilter {
public: public:
TlsRecordPadder(const std::shared_ptr<TlsAgent>& a, size_t padding) TlsRecordPadder(const std::shared_ptr<TlsAgent>& a, size_t padding)
: TlsRecordFilter(a), padding_(padding) {} : TlsRecordFilter(a), padding_(padding) {}
protected: protected:
PacketFilter::Action FilterRecord(const TlsRecordHeader& header, PacketFilter::Action FilterRecord(const TlsRecordHeader& header,
const DataBuffer& record, size_t* offset, const DataBuffer& record, size_t* offset,
DataBuffer* output) override { DataBuffer* output) override {
 End of changes. 1 change blocks. 
0 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)