summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp
diff options
context:
space:
mode:
authorRichard J. Moore <rich@kde.org>2015-01-31 15:03:47 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2015-02-04 15:49:50 +0000
commit91a48160d62e6c2fd7e0e1d6739048a3401621b9 (patch)
tree4706c01555a9f41651b6df53d2b9034145fad711 /tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp
parent3bc5f8c08107bcf8b5c274411850a67aed92372d (diff)
Move Rfc822NameType, DnsNameType and UniformResourceIdentifierType.
Move these types to QAsn1Element so that they can use the toString() method which guards against malicious ASN.1. Change-Id: I7d6155147a6fc2d41da6f3ae87551b6cb75aa9ce Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Diffstat (limited to 'tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp')
-rw-r--r--tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp b/tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp
index 11518546a5..4d719e2710 100644
--- a/tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp
+++ b/tests/auto/network/ssl/qasn1element/tst_qasn1element.cpp
@@ -281,6 +281,15 @@ void tst_QAsn1Element::string_data()
QTest::newRow("utf8string")
<< QAsn1Element(QAsn1Element::Utf8StringType, QByteArray("Hello World"))
<< QStringLiteral("Hello World");
+ QTest::newRow("rfc822name")
+ << QAsn1Element(QAsn1Element::Rfc822NameType, QByteArray("Hello World"))
+ << QStringLiteral("Hello World");
+ QTest::newRow("dnsname")
+ << QAsn1Element(QAsn1Element::DnsNameType, QByteArray("Hello World"))
+ << QStringLiteral("Hello World");
+ QTest::newRow("uri")
+ << QAsn1Element(QAsn1Element::UniformResourceIdentifierType, QByteArray("Hello World"))
+ << QStringLiteral("Hello World");
// Embedded NULs are not allowed and should be rejected
QTest::newRow("evil_printablestring")
@@ -292,6 +301,15 @@ void tst_QAsn1Element::string_data()
QTest::newRow("evil_utf8string")
<< QAsn1Element(QAsn1Element::Utf8StringType, QByteArray("Hello\0World", 11))
<< QString();
+ QTest::newRow("evil_rfc822name")
+ << QAsn1Element(QAsn1Element::Rfc822NameType, QByteArray("Hello\0World", 11))
+ << QString();
+ QTest::newRow("evil_dnsname")
+ << QAsn1Element(QAsn1Element::DnsNameType, QByteArray("Hello\0World", 11))
+ << QString();
+ QTest::newRow("evil_uri")
+ << QAsn1Element(QAsn1Element::UniformResourceIdentifierType, QByteArray("Hello\0World", 11))
+ << QString();
}
void tst_QAsn1Element::string()