diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/ssl/qsslcontext_openssl.cpp | 11 | ||||
-rw-r--r-- | src/network/ssl/qsslellipticcurve.h | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp index c1d09dce44..60573c4c83 100644 --- a/src/network/ssl/qsslcontext_openssl.cpp +++ b/src/network/ssl/qsslcontext_openssl.cpp @@ -340,11 +340,12 @@ init_context: #if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) // Set the curves to be used if (q_SSLeay() >= 0x10002000L) { - QVarLengthArray<int, 32> curves; - foreach (const QSslEllipticCurve curve, qcurves) - curves.append(curve.id); - - if (!q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_CURVES, curves.size(), curves.data())) { + // SSL_CTX_ctrl wants a non-const pointer as last argument, + // but let's avoid a copy into a temporary array + if (!q_SSL_CTX_ctrl(sslContext->ctx, + SSL_CTRL_SET_CURVES, + qcurves.size(), + const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())))) { sslContext->errorStr = QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl()); sslContext->errorCode = QSslError::UnspecifiedError; return sslContext; diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h index 8f31b32777..6d2a764d87 100644 --- a/src/network/ssl/qsslellipticcurve.h +++ b/src/network/ssl/qsslellipticcurve.h @@ -82,7 +82,6 @@ private: friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW { return qHash(curve.id, seed); } - friend class QSslContext; friend class QSslSocketPrivate; friend class QSslSocketBackendPrivate; }; |