[empathy/wip/rishi/tls: 2/5] tests: Actually test that hostnames of pinned certificates are verified



commit 05d86a3f6e599207918a8d5b871bc3a89660dbab
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 20 19:31:39 2017 +0100

    tests: Actually test that hostnames of pinned certificates are verified
    
    This test case is about ensuring that a pinned certificate won't be
    validated if the wrong hostname is used.
    
    If we don't add the pinned certificate to our database, then checks for
    pinning are going to fail regardless of the hostname being used. The
    correct certificate-hostname pair needs to be in the database to ensure
    that the hostnames are being matched as advertised.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780160

 tests/empathy-tls-test.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/tests/empathy-tls-test.c b/tests/empathy-tls-test.c
index 0752e1b..422909e 100644
--- a/tests/empathy-tls-test.c
+++ b/tests/empathy-tls-test.c
@@ -695,7 +695,8 @@ test_certificate_verify_pinned_wrong_host (Test *test,
   test->mock = mock_tls_certificate_new_and_register (test->dbus,
           "server-cert.cer", NULL);
 
-  /* Note that we're not adding any place to find root certs */
+  /* We add the collabora directory with the collabora root */
+  add_certificate_to_mock (test, "server-cert.cer", "test-server.empathy.gnome.org");
 
   ensure_certificate_proxy (test);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]