summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2011-07-14 11:28:32 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-14 13:08:20 +0200
commit6ab8ecb0024a7b4cc686f2ede35e04eae50e3ecf (patch)
tree640fb8e66a1b39c7fbaa8115412ee46d6cf1d458 /src/network
parent3b19eab45e65bf4b1242ce37db512a2ac3fde3c6 (diff)
SSL internals: certificate verification: use mutex locker
there are return statements between locking and unlocking, so to not leave the mutex locked when returning, this commit introduces a QMutexLocker. Change-Id: I74e2f329bf116e92250189bf097deb47d460d9dc Reviewed-on: http://codereview.qt.nokia.com/1656 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network')
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 84e5200043..11b2ff8bcd 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1525,7 +1525,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(QList<QSslCertificate> certifi
}
}
- _q_sslErrorList()->mutex.lock();
+ QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
// Register a custom callback to get all verification errors.
X509_STORE_set_verify_cb_func(certStore, q_X509Callback);
@@ -1585,7 +1585,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(QList<QSslCertificate> certifi
const QList<QPair<int, int> > errorList = _q_sslErrorList()->errors;
_q_sslErrorList()->errors.clear();
- _q_sslErrorList()->mutex.unlock();
+ sslErrorListMutexLocker.unlock();
// Translate the errors
if (QSslCertificatePrivate::isBlacklisted(certificateChain[0])) {