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>bb10
parent
5b1a4578f5
commit
67bbe28d67
|
|
@ -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
|
||||
|
||||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue