Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb52403' into 'mer-5.6'
Don't set temp ECDH params for OpenSSL >= 1.1.0

See merge request mer-core/qtbase!73
  • Loading branch information
llewelld committed Dec 28, 2020
2 parents f6ea444 + e15a631 commit 567a894
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/network/ssl/qsslcontext_openssl.cpp
Expand Up @@ -324,18 +324,20 @@ QSslContext* QSslContext::fromConfiguration(QSslSocket::SslMode mode, const QSsl
q_DH_free(dh);

#ifndef OPENSSL_NO_EC
#if OPENSSL_VERSION_NUMBER >= 0x10002000L && OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L // Auto is the default after 0x10100000L
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
if (q_SSLeay() >= 0x10002000L) {
q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL);
} else
#endif
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
{
// Set temp ECDH params
EC_KEY *ecdh = 0;
ecdh = q_EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
q_SSL_CTX_set_tmp_ecdh(sslContext->ctx, ecdh);
q_EC_KEY_free(ecdh);
}
#endif // OPENSSL_VERSION_NUMBER < 0x10100000L
#endif // OPENSSL_NO_EC

const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
Expand Down

0 comments on commit 567a894

Please sign in to comment.