Botan 3.14.1
Crypto and TLS for C&
tls_channel_impl.cpp
Go to the documentation of this file.
1/*
2* (C) 2026 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#include <botan/internal/tls_channel_impl.h>
8
9#include <botan/tls_exceptn.h>
10#include <botan/tls_policy.h>
11
12namespace Botan::TLS {
13
15 m_useless_records++;
16
17 if(const auto limit = policy.max_useless_records()) {
18 if(m_useless_records > *limit) {
19 throw TLS_Exception(Alert::UnexpectedMessage, "Peer sent too many consecutive useless records");
20 }
21 }
22}
23
24} // namespace Botan::TLS
void note_useless_record(const Policy &policy)
virtual std::optional< size_t > max_useless_records() const