summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-13 07:24:47 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-13 08:27:51 (GMT)
commit13cbcc0ddca0fdd5be9ede09052d31785c1e4d55 (patch)
treeb647be5699145ccae1545096aba5c495d96f8eb5 /tests/auto/qsslcertificate/tst_qsslcertificate.cpp
parent081078137a6fbc85d6be1437f6afc1d60e4f75f9 (diff)
parentde088b5a7f7b57e568399334667b14bfc9e7b893 (diff)
downloadQt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.zip
Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.tar.gz
Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.tar.bz2
Merge commit 'qt/master'
Conflicts: examples/opengl/samplebuffers/glwidget.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer.cpp src/gui/gui.pro tests/auto/qhttp/tst_qhttp.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp
Diffstat (limited to 'tests/auto/qsslcertificate/tst_qsslcertificate.cpp')
-rw-r--r--tests/auto/qsslcertificate/tst_qsslcertificate.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
index 2366414..7179a2b 100644
--- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -106,6 +106,7 @@ private slots:
void fromPath();
void certInfo();
void task256066toPem();
+ void nulInCN();
// ### add tests for certificate bundles (multiple certificates concatenated into a single
// structure); both PEM and DER formatted
#endif
@@ -733,6 +734,22 @@ void tst_QSslCertificate::task256066toPem()
QCOMPARE(pem1, pem2);
}
+void tst_QSslCertificate::nulInCN()
+{
+ QList<QSslCertificate> certList =
+ QSslCertificate::fromPath(SRCDIR "more-certificates/badguy-nul-cn.crt");
+ QCOMPARE(certList.size(), 1);
+
+ const QSslCertificate &cert = certList.at(0);
+ QVERIFY(!cert.isNull());
+
+ QString cn = cert.subjectInfo(QSslCertificate::CommonName);
+ QVERIFY(cn != "www.bank.com");
+
+ static const char realCN[] = "www.bank.com\\x00.badguy.com";
+ QCOMPARE(cn, QString::fromLatin1(realCN, sizeof realCN - 1));
+}
+
#endif // QT_NO_OPENSSL
QTEST_MAIN(tst_QSslCertificate)