diff options
author | Richard Moore <rich@kde.org> | 2011-11-11 23:08:42 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-14 10:39:47 +0100 |
commit | e66d3d98996c918162f2bf5bf94a0d356a39b5af (patch) | |
tree | 75862d157b9beb114d3293bc6d401b6b4b5827e2 /tests | |
parent | fd3d7429b2b00fe2e3f8ca7b41a04273b42077e8 (diff) |
Deprecate QSslCertificate::isValid() replace with isBlacklisted()
Currently isValid wrongly gives the impression it checks a certificate
for validity - it doesn't. It merely checks if the certificate dates
are valid and if the certificate is blacklisted. Since it's already
easy for users to check the dates, let's just give them access to the
ability to check for blacklisting.
Change-Id: I25be3bde6a01063034702a9574b28469bf4882cd
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index 10bb9dccb9..846c50bc89 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -193,7 +193,7 @@ void tst_QSslCertificate::emptyConstructor() QSslCertificate certificate; QVERIFY(certificate.isNull()); //make sure none of the functions crash (task 203035) - QVERIFY(!certificate.isValid()); + QVERIFY(!certificate.isBlacklisted()); QCOMPARE(certificate.version() , QByteArray()); QCOMPARE(certificate.serialNumber(), QByteArray()); QCOMPARE(certificate.digest(), QCryptographicHash::hash(QByteArray(), QCryptographicHash::Md5)); @@ -256,7 +256,7 @@ void tst_QSslCertificate::compareCertificates( { QCOMPARE(cert1.isNull(), cert2.isNull()); // Note: in theory, the next line could fail even if the certificates are identical! - QCOMPARE(cert1.isValid(), cert2.isValid()); + QCOMPARE(cert1.isBlacklisted(), cert2.isBlacklisted()); QCOMPARE(cert1.version(), cert2.version()); QCOMPARE(cert1.serialNumber(), cert2.serialNumber()); QCOMPARE(cert1.digest(), cert2.digest()); @@ -723,7 +723,7 @@ void tst_QSslCertificate::certInfo() QCOMPARE(cert.effectiveDate().toUTC(), QDateTime(QDate(2007, 4, 17), QTime(7,40,26), Qt::UTC)); QCOMPARE(cert.expiryDate().toUTC(), QDateTime(QDate(2007, 5, 17), QTime(7,40,26), Qt::UTC)); - QVERIFY(!cert.isValid()); // cert has expired + QVERIFY(cert.expiryDate() < QDateTime::currentDateTime()); // cert has expired QSslCertificate copy = cert; QVERIFY(cert == copy); @@ -849,7 +849,7 @@ void tst_QSslCertificate::blacklistedCertificates() QList<QSslCertificate> blacklistedCerts = QSslCertificate::fromPath("more-certificates/blacklisted*.pem", QSsl::Pem, QRegExp::Wildcard); QVERIFY2(blacklistedCerts.count() > 0, "Please run this test from the source directory"); for (int a = 0; a < blacklistedCerts.count(); a++) { - QVERIFY(! blacklistedCerts.at(a).isValid()); + QVERIFY(blacklistedCerts.at(a).isBlacklisted()); } } |