mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
TestSelfSignedCertificate: add tests that exercise new email SAN behavior.
This commit adds tests to ensure that it's now possible to create a client certificate without an email, and that creating a client certificate with an email still works. This is added because SelfSignedCertificate now conditionally adds an email subject alt name (SAN) to the generated certificate. If the passed-in email is empty, SelfSignedCertificat will not include the SAN.
This commit is contained in:
parent
519d04bb3a
commit
b28c30a07e
@ -41,6 +41,20 @@ void TestSelfSignedCertificate::exerciseClientCert() {
|
||||
QCOMPARE(ok, true);
|
||||
QCOMPARE(cert.isNull(), false);
|
||||
QCOMPARE(key.isNull(), false);
|
||||
|
||||
// Test that users can create certificates without an email
|
||||
// address set.
|
||||
ok = SelfSignedCertificate::generateMumbleCertificate(QLatin1String("John Doe"), QString(), cert, key);
|
||||
QCOMPARE(ok, true);
|
||||
QCOMPARE(cert.isNull(), false);
|
||||
QCOMPARE(key.isNull(), false);
|
||||
|
||||
// Test that it's possible to create a client certificate with
|
||||
// both a name and an email.
|
||||
ok = SelfSignedCertificate::generateMumbleCertificate(QLatin1String("John Doe"), QLatin1String("john@doe.family"), cert, key);
|
||||
QCOMPARE(ok, true);
|
||||
QCOMPARE(cert.isNull(), false);
|
||||
QCOMPARE(key.isNull(), false);
|
||||
}
|
||||
|
||||
void TestSelfSignedCertificate::exerciseServerCert() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user