Commit 922006f8 authored by John Brooks's avatar John Brooks

Add UOA auth handler and minor cleanups

parent 99d19de2
/* /*
* Copyright (C) 2012 Jolla Ltd.
* Contact: John Brooks <john.brooks@jollamobile.com>
*
* Based on Empathy,
* Copyright (C) 2010 Collabora Ltd. * Copyright (C) 2010 Collabora Ltd.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -29,23 +33,6 @@ ...@@ -29,23 +33,6 @@
#include <empathy-auth-factory.h> #include <empathy-auth-factory.h>
#include <empathy-server-sasl-handler.h> #include <empathy-server-sasl-handler.h>
#include <empathy-server-tls-handler.h> #include <empathy-server-tls-handler.h>
#if 0
#include <empathy-tls-verifier.h>
#define DEBUG_FLAG EMPATHY_DEBUG_TLS
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
#include <libempathy-gtk/empathy-bad-password-dialog.h>
#include <libempathy-gtk/empathy-password-dialog.h>
#include <libempathy-gtk/empathy-tls-dialog.h>
#include <libempathy-gtk/empathy-ui-utils.h>
#include "empathy-sanity-cleaning.h"
#include <gnutls/gnutls.h>
#include <extensions/extensions.h>
#endif
#define TIMEOUT 60 #define TIMEOUT 60
...@@ -303,9 +290,9 @@ main (int argc, ...@@ -303,9 +290,9 @@ main (int argc,
return EXIT_FAILURE; return EXIT_FAILURE;
} }
DEBUG ("Empathy auth client started."); DEBUG ("SASL signon auth client started.");
if (g_getenv ("EMPATHY_PERSIST") != NULL) if (g_getenv ("SASL_SIGNON_PERSIST") != NULL)
{ {
DEBUG ("Timed-exit disabled"); DEBUG ("Timed-exit disabled");
......
...@@ -22,13 +22,11 @@ ...@@ -22,13 +22,11 @@
#include "empathy-debug.h" #include "empathy-debug.h"
#include "empathy-utils.h" #include "empathy-utils.h"
//#include "empathy-keyring.h" #include "empathy-keyring.h"
//#include "empathy-sasl-mechanisms.h" #include "empathy-sasl-mechanisms.h"
#include "empathy-server-sasl-handler.h" #include "empathy-server-sasl-handler.h"
#include "empathy-server-tls-handler.h" #include "empathy-server-tls-handler.h"
//#include "empathy-utils.h"
// XXX
#ifdef HAVE_UOA #ifdef HAVE_UOA
#include "empathy-uoa-auth-handler.h" #include "empathy-uoa-auth-handler.h"
#endif /* HAVE_UOA */ #endif /* HAVE_UOA */
...@@ -648,6 +646,7 @@ empathy_auth_factory_constructed (GObject *obj) ...@@ -648,6 +646,7 @@ empathy_auth_factory_constructed (GObject *obj)
tp_base_client_set_handler_bypass_approval (client, FALSE); tp_base_client_set_handler_bypass_approval (client, FALSE);
/* Handle ServerTLSConnection and ServerAuthentication channels */ /* Handle ServerTLSConnection and ServerAuthentication channels */
/* TLS channels are disabled for now due to redundant functionality. */
#if 0 #if 0
tp_base_client_take_handler_filter (client, tp_asv_new ( tp_base_client_take_handler_filter (client, tp_asv_new (
/* ChannelType */ /* ChannelType */
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
#include <libsignon-glib/signon-identity.h> #include <libsignon-glib/signon-identity.h>
#include "empathy-uoa-utils.h" #include "empathy-uoa-utils.h"
#define EMPATHY_UOA_SERVICE_TYPE "IM"
#define EMPATHY_UOA_PROVIDER "im.telepathy.Account.Storage.UOA"
static AgAccountService * static AgAccountService *
uoa_password_common (TpAccount *tp_account, uoa_password_common (TpAccount *tp_account,
GSimpleAsyncResult *result, GSimpleAsyncResult *result,
......
This diff is collapsed.
/*
* empathy-auth-uoa.h - Header for Uoa SASL authentication
* Copyright (C) 2012 Collabora Ltd.
* @author Xavier Claessens <xavier.claessens@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __EMPATHY_UOA_AUTH_HANDLER_H__
#define __EMPATHY_UOA_AUTH_HANDLER_H__
#include <telepathy-glib/telepathy-glib.h>
G_BEGIN_DECLS
typedef struct _EmpathyUoaAuthHandler EmpathyUoaAuthHandler;
typedef struct _EmpathyUoaAuthHandlerClass EmpathyUoaAuthHandlerClass;
typedef struct _EmpathyUoaAuthHandlerPriv EmpathyUoaAuthHandlerPriv;
struct _EmpathyUoaAuthHandlerClass {
GObjectClass parent_class;
};
struct _EmpathyUoaAuthHandler {
GObject parent;
EmpathyUoaAuthHandlerPriv *priv;
};
GType empathy_uoa_auth_handler_get_type (void);
/* TYPE MACROS */
#define EMPATHY_TYPE_UOA_AUTH_HANDLER \
(empathy_uoa_auth_handler_get_type ())
#define EMPATHY_UOA_AUTH_HANDLER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_UOA_AUTH_HANDLER, \
EmpathyUoaAuthHandler))
#define EMPATHY_UOA_AUTH_HANDLER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_UOA_AUTH_HANDLER, \
EmpathyUoaAuthHandlerClass))
#define EMPATHY_IS_UOA_AUTH_HANDLER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_UOA_AUTH_HANDLER))
#define EMPATHY_IS_UOA_AUTH_HANDLER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_UOA_AUTH_HANDLER))
#define EMPATHY_UOA_AUTH_HANDLER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_UOA_AUTH_HANDLER, \
EmpathyUoaAuthHandlerClass))
EmpathyUoaAuthHandler *empathy_uoa_auth_handler_new (void);
void empathy_uoa_auth_handler_start (EmpathyUoaAuthHandler *self,
TpChannel *channel,
TpAccount *account);
gboolean empathy_uoa_auth_handler_supports (EmpathyUoaAuthHandler *self,
TpChannel *channel,
TpAccount *account);
G_END_DECLS
#endif /* #ifndef __EMPATHY_UOA_AUTH_HANDLER_H__*/
...@@ -4,6 +4,8 @@ CONFIG += link_pkgconfig ...@@ -4,6 +4,8 @@ CONFIG += link_pkgconfig
PKGCONFIG += libsignon-glib telepathy-glib libaccounts-glib libsoup-2.4 PKGCONFIG += libsignon-glib telepathy-glib libaccounts-glib libsoup-2.4
INCLUDEPATH += src INCLUDEPATH += src
DEFINES += HAVE_UOA \
EMPATHY_UOA_PROVIDER=\\\"im.telepathy.Account.Storage.UOA\\\"
SOURCES += src/empathy-auth-client.c \ SOURCES += src/empathy-auth-client.c \
src/empathy-auth-factory.c \ src/empathy-auth-factory.c \
...@@ -11,7 +13,8 @@ SOURCES += src/empathy-auth-client.c \ ...@@ -11,7 +13,8 @@ SOURCES += src/empathy-auth-client.c \
src/empathy-server-tls-handler.c \ src/empathy-server-tls-handler.c \
src/empathy-keyring.c \ src/empathy-keyring.c \
src/empathy-uoa-utils.c \ src/empathy-uoa-utils.c \
src/empathy-sasl-mechanisms.c src/empathy-sasl-mechanisms.c \
src/empathy-uoa-auth-handler.c
HEADERS += src/empathy-auth-factory.h \ HEADERS += src/empathy-auth-factory.h \
src/empathy-debug.h \ src/empathy-debug.h \
...@@ -20,7 +23,8 @@ HEADERS += src/empathy-auth-factory.h \ ...@@ -20,7 +23,8 @@ HEADERS += src/empathy-auth-factory.h \
src/empathy-server-sasl-handler.h \ src/empathy-server-sasl-handler.h \
src/empathy-server-tls-handler.h \ src/empathy-server-tls-handler.h \
src/empathy-uoa-utils.h \ src/empathy-uoa-utils.h \
src/empathy-utils.h src/empathy-utils.h \
src/empathy-uoa-auth-handler.h
OTHER_FILES += org.freedesktop.Telepathy.Client.SaslSignonAuth.service \ OTHER_FILES += org.freedesktop.Telepathy.Client.SaslSignonAuth.service \
SaslSignonAuth.client SaslSignonAuth.client
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment