summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls/openssl/qdtls_openssl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tls/openssl/qdtls_openssl.cpp')
-rw-r--r--src/plugins/tls/openssl/qdtls_openssl.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/tls/openssl/qdtls_openssl.cpp b/src/plugins/tls/openssl/qdtls_openssl.cpp
index 9531d5b6aa..fc07a29ec8 100644
--- a/src/plugins/tls/openssl/qdtls_openssl.cpp
+++ b/src/plugins/tls/openssl/qdtls_openssl.cpp
@@ -1,11 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif // NOMINMAX
-
-#include <QtNetwork/private/qnativesocketengine_p.h>
+#include <QtNetwork/private/qnativesocketengine_p_p.h>
#include "qsslsocket_openssl_symbols_p.h"
#include "qdtls_openssl_p.h"
@@ -182,7 +178,7 @@ extern "C" int q_generate_cookie_callback(SSL *ssl, unsigned char *dst,
QMessageAuthenticationCode hmac(dtls->hashAlgorithm, dtls->secret);
hmac.addData(peerData);
- const QByteArray cookie = hmac.result();
+ const QByteArrayView cookie = hmac.resultView();
Q_ASSERT(cookie.size() >= 0);
// DTLS1_COOKIE_LENGTH is erroneously 256 bytes long, must be 255 - RFC 6347, 4.2.1.
*cookieLength = qMin(DTLS1_COOKIE_LENGTH - 1, cookie.size());
@@ -205,7 +201,7 @@ extern "C" int q_verify_cookie_callback(SSL *ssl, const unsigned char *cookie,
return 0;
return newCookieLength == cookieLength
- && !std::memcmp(cookie, newCookie, cookieLength);
+ && !q_CRYPTO_memcmp(cookie, newCookie, size_t(cookieLength));
}
extern "C" int q_X509DtlsCallback(int ok, X509_STORE_CTX *ctx)