From 67bbe28d67c99d99e752cd6054c9b576c7702358 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 28 Nov 2019 13:14:03 +0100 Subject: tst_qsslcertificate: fix subjectAndIssuerAttributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/auto/network/ssl/qsslcertificate/BLACKLIST | 13 ------------- .../network/ssl/qsslcertificate/tst_qsslcertificate.cpp | 10 +++++++++- 2 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 tests/auto/network/ssl/qsslcertificate/BLACKLIST 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 #include +#ifndef QT_NO_OPENSSL +#include +#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() -- cgit v1.2.3