OpenVPN 3 Core Library
Loading...
Searching...
No Matches
bs64_data_limit.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// Special data limits on Blowfish, Triple DES, and other 64-bit
13// block-size ciphers vulnerable to "Sweet32" birthday attack
14// (CVE-2016-6329). Limit such cipher keys to no more than 64 MB
15// of data encrypted/decrypted. Note that we trigger early at
16// 48 MB to compensate for possible delays in renegotiation and
17// rollover to the new key.
18
19#ifndef OPENVPN_CRYPTO_DATALIMIT_H
20#define OPENVPN_CRYPTO_DATALIMIT_H
21
23
24#ifndef OPENVPN_BS64_DATA_LIMIT
25#define OPENVPN_BS64_DATA_LIMIT 48000000
26#endif
27
28namespace openvpn {
29inline bool is_bs64_cipher(const CryptoAlgs::Type cipher)
30{
31 return CryptoAlgs::get(cipher).block_size() == 8;
32}
33} // namespace openvpn
34
35#endif
size_t block_size() const
const Alg & get(const Type type)
Support deferred server-side state creation when client connects.
Definition ovpncli.cpp:95
bool is_bs64_cipher(const CryptoAlgs::Type cipher)