From 31e85dc2a1ca6d79f758093bef8b47d6627c208b Mon Sep 17 00:00:00 2001 From: "Richard J. Moore" Date: Sun, 8 Feb 2015 11:38:18 +0000 Subject: Remove unnecessary direct access to SSL_CIPHER struct. The cipher is always valid here, so this check was never needed anyway. Change-Id: I22be273d166702926b98f0c9443657a1dde65f6e Reviewed-by: Daniel Molkentin --- src/network/ssl/qsslsocket_openssl.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 42befc64fa..7cadf3e0a6 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -646,15 +646,13 @@ void QSslSocketPrivate::resetDefaultCiphers() STACK_OF(SSL_CIPHER) *supportedCiphers = q_SSL_get_ciphers(mySsl); for (int i = 0; i < q_sk_SSL_CIPHER_num(supportedCiphers); ++i) { if (SSL_CIPHER *cipher = q_sk_SSL_CIPHER_value(supportedCiphers, i)) { - if (cipher->valid) { - QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher); - if (!ciph.isNull()) { - // Unconditionally exclude ADH ciphers since they offer no MITM protection - if (!ciph.name().toLower().startsWith(QLatin1String("adh"))) - ciphers << ciph; - if (ciph.usedBits() >= 128) - defaultCiphers << ciph; - } + QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher); + if (!ciph.isNull()) { + // Unconditionally exclude ADH ciphers since they offer no MITM protection + if (!ciph.name().toLower().startsWith(QLatin1String("adh"))) + ciphers << ciph; + if (ciph.usedBits() >= 128) + defaultCiphers << ciph; } } } -- cgit v1.2.3