diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-11-28 13:14:03 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-11-28 17:12:26 +0100 |
commit | 67bbe28d67c99d99e752cd6054c9b576c7702358 (patch) | |
tree | 8e3c2ac2164376d603bc78e00c48b775a7bb6022 /tests | |
parent | 5b1a4578f545d5181265d9120b48bc92753b63b9 (diff) |
tst_qsslcertificate: fix subjectAndIssuerAttributes
Instead of OID as string, OpenSSL returns a human-readable name.
No need to fail then, use such a name in QVERIFY if OID not found.
Fixes: QTBUG-80329
Change-Id: I4392fc9f37367f7c34c05d172db015b44e2a8497
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/network/ssl/qsslcertificate/BLACKLIST | 13 | ||||
-rw-r--r-- | tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp | 10 |
2 files changed, 9 insertions, 14 deletions
diff --git a/tests/auto/network/ssl/qsslcertificate/BLACKLIST b/tests/auto/network/ssl/qsslcertificate/BLACKLIST deleted file mode 100644 index 9494ee2278..0000000000 --- a/tests/auto/network/ssl/qsslcertificate/BLACKLIST +++ /dev/null @@ -1,13 +0,0 @@ -# OpenSSL version is too new. Rich will fix :) -[subjectAndIssuerAttributes] -ubuntu-16.04 -rhel-7.6 -opensuse-leap -windows-7sp1 -ubuntu-18.04 -rhel-7.4 -b2qt -windows-10 msvc-2017 -windows-10 msvc-2015 -opensuse-42.3 - diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index efc0c26076..14718ad373 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -33,6 +33,10 @@ #include <qsslsocket.h> #include <qsslcertificateextension.h> +#ifndef QT_NO_OPENSSL +#include <openssl/obj_mac.h> +#endif + class tst_QSslCertificate : public QObject { Q_OBJECT @@ -960,8 +964,12 @@ void tst_QSslCertificate::subjectAndIssuerAttributes() certList = QSslCertificate::fromPath(testDataDir + "more-certificates/natwest-banking.pem"); QVERIFY(certList.count() > 0); + QByteArray shortName("1.3.6.1.4.1.311.60.2.1.3"); +#if !defined(QT_NO_OPENSSL) && defined(SN_jurisdictionCountryName) + shortName = SN_jurisdictionCountryName; +#endif attributes = certList[0].subjectInfoAttributes(); - QVERIFY(attributes.contains(QByteArray("1.3.6.1.4.1.311.60.2.1.3"))); + QVERIFY(attributes.contains(shortName)); } void tst_QSslCertificate::verify() |