10#include <botan/tls_version.h>
12#include <botan/tls_exceptn.h>
17#if defined(BOTAN_HAS_TLS_13)
18 return Protocol_Version::TLS_V13;
19#elif defined(BOTAN_HAS_TLS_12)
20 return Protocol_Version::TLS_V12;
27#if defined(BOTAN_HAS_TLS_12)
28 return Protocol_Version::DTLS_V12;
38 if(maj == 3 && min == 0) {
42 if(maj == 3 && min >= 1) {
43 return "TLS v1." + std::to_string(min - 1);
47 return "DTLS v1." + std::to_string(255 - min);
51 return "Unknown " + std::to_string(maj) +
"." + std::to_string(min);
74 return m_version < other.m_version;
77 return m_version > other.m_version;
84 if(maj == 3 && min <= 4) {
93 if(maj == 254 && (min == 253 || min == 255)) {
103#if defined(BOTAN_HAS_TLS_13)
104 if(m_version ==
static_cast<uint16_t
>(Protocol_Version::TLS_V13)) {
109#if defined(BOTAN_HAS_TLS_12)
110 if(m_version ==
static_cast<uint16_t
>(Protocol_Version::TLS_V12)) {
113 if(m_version ==
static_cast<uint16_t
>(Protocol_Version::DTLS_V12)) {
bool operator>(const Protocol_Version &other) const
static Protocol_Version latest_tls_version()
std::string to_string() const
bool is_tls_13_or_later() const
uint8_t major_version() const
bool known_version() const
static Protocol_Version latest_dtls_version()
bool is_datagram_protocol() const
uint8_t minor_version() const
bool is_pre_tls_13() const