Botan
3.14.1
Crypto and TLS for C&
src
lib
tls
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
12
namespace
Botan::TLS
{
13
14
void
Channel_Impl::note_useless_record
(
const
Policy
& policy) {
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
Botan::TLS::Channel_Impl::note_useless_record
void note_useless_record(const Policy &policy)
Definition
tls_channel_impl.cpp:14
Botan::TLS::Policy
Definition
tls_policy.h:33
Botan::TLS::Policy::max_useless_records
virtual std::optional< size_t > max_useless_records() const
Definition
tls_policy.cpp:526
Botan::TLS::TLS_Exception
Definition
tls_exceptn.h:19
Botan::TLS
Definition
asio_context.cpp:17
Generated by
1.16.1