OpenVPN 3 Core Library
Loading...
Searching...
No Matches
tlsver.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
// OpenSSL specific methods for TLS version
13
14
#pragma once
15
16
#include <
openvpn/ssl/tlsver.hpp
>
17
18
namespace
openvpn::TLSVersion
{
19
20
inline
int
toTLSVersion
(
const
Type
version)
21
{
22
23
switch
(version)
24
{
25
case
Type::UNDEF
:
26
default
:
27
return
0;
28
case
Type::V1_0
:
29
return
TLS1_VERSION;
30
case
Type::V1_1
:
31
return
TLS1_1_VERSION;
32
case
Type::V1_2
:
33
return
TLS1_2_VERSION;
34
case
Type::V1_3
:
35
#ifdef TLS1_3_VERSION
36
return
TLS1_3_VERSION;
37
#else
38
// TLS 1.3 is SSL 3.4
39
return
0x0304;
40
#endif
41
}
42
}
43
}
// namespace openvpn::TLSVersion
openvpn::TLSVersion
Definition
tlsver.hpp:18
openvpn::TLSVersion::Type
Type
Definition
tlsver.hpp:25
openvpn::TLSVersion::Type::V1_3
@ V1_3
openvpn::TLSVersion::Type::V1_2
@ V1_2
openvpn::TLSVersion::Type::V1_1
@ V1_1
openvpn::TLSVersion::Type::V1_0
@ V1_0
openvpn::TLSVersion::Type::UNDEF
@ UNDEF
openvpn::TLSVersion::toTLSVersion
int toTLSVersion(const Type version)
Definition
tlsver.hpp:20
tlsver.hpp
openvpn
openssl
ssl
tlsver.hpp
Generated by
1.9.8