-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <libempathy/empathy-tls-verifier.h>
-#include "test-helper.h"
-#include "mock-pkcs11.h"
-
-#include <gcr/gcr.h>
+#include "config.h"
#include <gnutls/gnutls.h>
-
#include <telepathy-glib/telepathy-glib.h>
-#include <telepathy-glib/svc-tls.h>
-#include <telepathy-glib/svc-generic.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
+
+#include "empathy-tls-verifier.h"
+#include "mock-pkcs11.h"
+#include "test-helper.h"
#define MOCK_TLS_CERTIFICATE_PATH "/mock/certificate"
{
self->state = TP_TLS_CERTIFICATE_STATE_PENDING;
self->cert_type = g_strdup ("x509");
- self->cert_data = g_ptr_array_new_with_free_func((GDestroyNotify) g_array_unref);
+ self->cert_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
+ g_array_unref);
self->rejections = g_ptr_array_new ();
}
pspec = g_param_spec_uint ("state",
"State of this certificate",
"The state of this TLS certificate.",
- 0, NUM_TP_TLS_CERTIFICATE_STATES - 1,
+ 0, TP_NUM_TLS_CERTIFICATE_STATES - 1,
TP_TLS_CERTIFICATE_STATE_PENDING,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (oclass, PROP_STATE, pspec);
gpointer iface_data)
{
TpSvcAuthenticationTLSCertificateClass *klass =
- (TpSvcAuthenticationTLSCertificateClass*)g_iface;
+ (TpSvcAuthenticationTLSCertificateClass *) g_iface;
tp_svc_authentication_tls_certificate_implement_accept (klass,
mock_tls_certificate_accept);
}
#endif
-static MockTLSCertificate*
+static MockTLSCertificate *
mock_tls_certificate_new_and_register (TpDBusDaemon *dbus,
const gchar *path,
...)
GError *error = NULL;
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", NULL);
+ "server-cert.cer", NULL);
ensure_certificate_proxy (test);
GError *error = NULL;
EmpathyTLSVerifier *verifier;
const gchar *reference_identities[] = {
- "www.collabora.co.uk",
+ "test-server.empathy.gnome.org",
NULL
};
*/
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", NULL);
+ "server-cert.cer", NULL);
/* We add the collabora directory with the collabora root */
- add_certificate_to_mock (test, "collabora-ca.cer", NULL);
+ add_certificate_to_mock (test, "certificate-authority.cer", NULL);
ensure_certificate_proxy (test);
- verifier = empathy_tls_verifier_new (test->cert, "www.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "test-server.empathy.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);
GError *error = NULL;
EmpathyTLSVerifier *verifier;
const gchar *reference_identities[] = {
- "www.collabora.co.uk",
+ "test-server.empathy.gnome.org",
NULL
};
*/
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", "collabora-ca.cer", NULL);
+ "server-cert.cer", "certificate-authority.cer", NULL);
/* We add the collabora directory with the collabora root */
- add_certificate_to_mock (test, "collabora-ca.cer", NULL);
+ add_certificate_to_mock (test, "certificate-authority.cer", NULL);
ensure_certificate_proxy (test);
- verifier = empathy_tls_verifier_new (test->cert, "www.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "test-server.empathy.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);
GError *error = NULL;
EmpathyTLSVerifier *verifier;
const gchar *reference_identities[] = {
- "www.collabora.co.uk",
+ "test-server.empathy.gnome.org",
NULL
};
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", NULL);
+ "server-cert.cer", NULL);
/* Note that we're not adding any place to find root certs */
ensure_certificate_proxy (test);
- verifier = empathy_tls_verifier_new (test->cert, "www.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "test-server.empathy.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);
GError *error = NULL;
EmpathyTLSVerifier *verifier;
const gchar *reference_identities[] = {
- "www.collabora.co.uk",
+ "test-server.empathy.gnome.org",
NULL
};
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", "collabora-ca.cer", NULL);
+ "server-cert.cer", "certificate-authority.cer", NULL);
/* Note that we're not adding any place to find root certs */
ensure_certificate_proxy (test);
- verifier = empathy_tls_verifier_new (test->cert, "www.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "test-server.empathy.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);
};
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", "collabora-ca.cer", NULL);
+ "server-cert.cer", "certificate-authority.cer", NULL);
/* We add the collabora directory with the collabora root */
- add_certificate_to_mock (test, "collabora-ca.cer", NULL);
+ add_certificate_to_mock (test, "certificate-authority.cer", NULL);
ensure_certificate_proxy (test);
};
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", "collabora-ca.cer", NULL);
+ "server-cert.cer", "certificate-authority.cer", NULL);
/* We add the collabora directory with the collabora root */
- add_certificate_to_mock (test, "collabora-ca.cer", NULL);
+ add_certificate_to_mock (test, "certificate-authority.cer", NULL);
ensure_certificate_proxy (test);
/* Should be using the reference_identities and not host name for checks */
- verifier = empathy_tls_verifier_new (test->cert, "www.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "test-server.empathy.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);
GError *error = NULL;
EmpathyTLSVerifier *verifier;
const gchar *reference_identities[] = {
- "www.collabora.co.uk",
+ "test-server.empathy.gnome.org",
NULL
};
*/
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", NULL);
+ "server-cert.cer", NULL);
/* We add the collabora directory with the collabora root */
- add_certificate_to_mock (test, "dhansak-collabora.cer", "www.collabora.co.uk");
+ add_certificate_to_mock (test, "server-cert.cer", "test-server.empathy.gnome.org");
ensure_certificate_proxy (test);
- verifier = empathy_tls_verifier_new (test->cert, "www.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "test-server.empathy.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);
GError *error = NULL;
EmpathyTLSVerifier *verifier;
const gchar *reference_identities[] = {
- "www.collabora.co.uk",
+ "test-server.empathy.gnome.org",
NULL
};
test->mock = mock_tls_certificate_new_and_register (test->dbus,
- "dhansak-collabora.cer", NULL);
+ "server-cert.cer", NULL);
/* Note that we're not adding any place to find root certs */
ensure_certificate_proxy (test);
- verifier = empathy_tls_verifier_new (test->cert, "another.collabora.co.uk",
+ verifier = empathy_tls_verifier_new (test->cert, "another.gnome.org",
reference_identities);
empathy_tls_verifier_verify_async (verifier, fetch_callback_result, test);
g_main_loop_run (test->loop);