1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSL_H
7#define QSSL_H
8
9#if 0
10#pragma qt_class(QSsl)
11#endif
12
13#include <QtNetwork/qtnetworkglobal.h>
14#include <QtCore/qobjectdefs.h>
15#include <QtCore/QFlags>
16
17QT_BEGIN_NAMESPACE
18
19
20namespace QSsl {
21 Q_NAMESPACE_EXPORT(Q_NETWORK_EXPORT)
22
23 enum KeyType {
24 PrivateKey,
25 PublicKey
26 };
27 Q_ENUM_NS(KeyType)
28
29 enum EncodingFormat {
30 Pem,
31 Der
32 };
33 Q_ENUM_NS(EncodingFormat)
34
35 enum KeyAlgorithm {
36 Opaque,
37 Rsa,
38 Dsa,
39 Ec,
40 Dh,
41 };
42 Q_ENUM_NS(KeyAlgorithm)
43
44 enum AlternativeNameEntryType {
45 EmailEntry,
46 DnsEntry,
47 IpAddressEntry
48 };
49 Q_ENUM_NS(AlternativeNameEntryType)
50
51 enum SslProtocol {
52 TlsV1_0 QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
53 TlsV1_1 QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
54 TlsV1_2,
55 AnyProtocol,
56 SecureProtocols,
57
58 TlsV1_0OrLater QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
59 TlsV1_1OrLater QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
60 TlsV1_2OrLater,
61
62 DtlsV1_0 QT_DEPRECATED_VERSION_X_6_3("Use DtlsV1_2OrLater instead."),
63 DtlsV1_0OrLater QT_DEPRECATED_VERSION_X_6_3("Use DtlsV1_2OrLater instead."),
64 DtlsV1_2,
65 DtlsV1_2OrLater,
66
67 TlsV1_3,
68 TlsV1_3OrLater,
69
70 UnknownProtocol = -1
71 };
72 Q_ENUM_NS(SslProtocol)
73
74 enum SslOption {
75 SslOptionDisableEmptyFragments = 0x01,
76 SslOptionDisableSessionTickets = 0x02,
77 SslOptionDisableCompression = 0x04,
78 SslOptionDisableServerNameIndication = 0x08,
79 SslOptionDisableLegacyRenegotiation = 0x10,
80 SslOptionDisableSessionSharing = 0x20,
81 SslOptionDisableSessionPersistence = 0x40,
82 SslOptionDisableServerCipherPreference = 0x80
83 };
84 Q_ENUM_NS(SslOption)
85 Q_DECLARE_FLAGS(SslOptions, SslOption)
86
87 enum class AlertLevel {
88 Warning,
89 Fatal,
90 Unknown
91 };
92 Q_ENUM_NS(AlertLevel)
93
94 enum class AlertType {
95 CloseNotify,
96 UnexpectedMessage = 10,
97 BadRecordMac = 20,
98 RecordOverflow = 22,
99 DecompressionFailure = 30, // reserved
100 HandshakeFailure = 40,
101 NoCertificate = 41, // reserved
102 BadCertificate = 42,
103 UnsupportedCertificate = 43,
104 CertificateRevoked = 44,
105 CertificateExpired = 45,
106 CertificateUnknown = 46,
107 IllegalParameter = 47,
108 UnknownCa = 48,
109 AccessDenied = 49,
110 DecodeError = 50,
111 DecryptError = 51,
112 ExportRestriction = 60, // reserved
113 ProtocolVersion = 70,
114 InsufficientSecurity = 71,
115 InternalError = 80,
116 InappropriateFallback = 86,
117 UserCancelled = 90,
118 NoRenegotiation = 100,
119 MissingExtension = 109,
120 UnsupportedExtension = 110,
121 CertificateUnobtainable = 111, // reserved
122 UnrecognizedName = 112,
123 BadCertificateStatusResponse = 113,
124 BadCertificateHashValue = 114, // reserved
125 UnknownPskIdentity = 115,
126 CertificateRequired = 116,
127 NoApplicationProtocol = 120,
128 UnknownAlertMessage = 255
129 };
130 Q_ENUM_NS(AlertType)
131
132 enum class ImplementedClass
133 {
134 Key,
135 Certificate,
136 Socket,
137 DiffieHellman,
138 EllipticCurve,
139 Dtls,
140 DtlsCookie
141 };
142 Q_ENUM_NS(ImplementedClass)
143
144 enum class SupportedFeature
145 {
146 CertificateVerification,
147 ClientSideAlpn,
148 ServerSideAlpn,
149 Ocsp,
150 Psk,
151 SessionTicket,
152 Alerts
153 };
154 Q_ENUM_NS(SupportedFeature)
155}
156
157Q_DECLARE_OPERATORS_FOR_FLAGS(QSsl::SslOptions)
158
159QT_END_NAMESPACE
160
161#endif // QSSL_H
162

source code of qtbase/src/network/ssl/qssl.h