Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdtls_base.cpp
Go to the documentation of this file.
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
4#include "qdtls_base_p.h"
5
7
8void QDtlsBasePrivate::setDtlsError(QDtlsError code, const QString &description)
9{
10 errorCode = code;
11 errorDescription = description;
12}
13
15{
16 return errorCode;
17}
18
23
29
34
40
42{
43 if (!params.secret.size()) {
45 QDtls::tr("Invalid (empty) secret"));
46 return false;
47 }
48
50
51 hashAlgorithm = params.hash;
52 secret = params.secret;
53
54 return true;
55}
56
62
64{
65 switch (protocol) {
68 case QSsl::DtlsV1_0:
69 case QSsl::DtlsV1_0OrLater:
71 case QSsl::DtlsV1_2:
73 return true;
74 default:
75 return false;
76 }
77}
78
QSslConfiguration configuration() const override
QCryptographicHash::Algorithm hashAlgorithm
QDtlsError error() const override
void setConfiguration(const QSslConfiguration &configuration) override
QString errorDescription
bool setCookieGeneratorParameters(const GenParams &) override
QString errorString() const override
QDtlsError errorCode
void clearDtlsError() override
QByteArray secret
GenParams cookieGeneratorParameters() const override
void setDtlsError(QDtlsError code, const QString &description) override
Definition qdtls_base.cpp:8
QSslConfiguration dtlsConfiguration
static bool isDtlsProtocol(QSsl::SslProtocol protocol)
The QSslConfiguration class holds the configuration and state of an SSL connection.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void clear()
Clears the contents of the string and makes it null.
Definition qstring.h:1252
SslProtocol
Describes the protocol of the cipher.
Definition qssl.h:50
@ DtlsV1_2
Definition qssl.h:63
@ DtlsV1_2OrLater
Definition qssl.h:64
Combined button and popup list for selecting options.
#define QT_WARNING_POP
#define QT_WARNING_DISABLE_DEPRECATED
#define QT_WARNING_PUSH
QDtlsError
Definition qdtls.h:25
@ InvalidInputParameters
void ** params
This class defines parameters for DTLS cookie generator.
Definition qdtls.h:53