From c98ac9cc6760e1b3c1eb42418005714039fe6954 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Fri, 11 Nov 2011 22:19:49 +0200 Subject: [PATCH] transport: close the loop after authentication is completed sipe-certificate.c triggers a reauthentication once it has received the certificate for the target. Now we can turn our attention to the actual TLS-DSK authentication scheme implementation. --- src/core/sip-transport.c | 11 ++++++++++- src/core/sip-transport.h | 3 ++- src/core/sipe-certificate.c | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/core/sip-transport.c b/src/core/sip-transport.c index 84119934..16a3711f 100644 --- a/src/core/sip-transport.c +++ b/src/core/sip-transport.c @@ -219,7 +219,8 @@ static gchar *initialize_auth_context(struct sipe_core_private *sipe_private, if (!password) { if (auth->sts_uri) { - SIPE_DEBUG_INFO("tls-dsk: Certificate Provisioning URI %s", auth->sts_uri); + SIPE_DEBUG_INFO("initialize_auth_context: TLS-DSK Certificate Provisioning URI %s", + auth->sts_uri); if (!sipe_certificate_tls_dsk_generate(sipe_private, auth->target, authuser, @@ -240,6 +241,9 @@ static gchar *initialize_auth_context(struct sipe_core_private *sipe_private, /* we can't authenticate the message yet */ sipe_private->transport->auth_incomplete = TRUE; return(NULL); + } else { + SIPE_DEBUG_INFO("initialize_auth_context: TLS-DSK certificate for target '%s' found.", + auth->target); } } @@ -1366,6 +1370,11 @@ void sip_transport_disconnect(struct sipe_core_private *sipe_private) } +void sip_transport_authentication_completed(struct sipe_core_private *sipe_private) +{ + do_reauthenticate_cb(sipe_private, NULL); +} + guint sip_transport_port(struct sipe_core_private *sipe_private) { return sipe_private->transport->server_port; diff --git a/src/core/sip-transport.h b/src/core/sip-transport.h index b979bb85..503e0c67 100644 --- a/src/core/sip-transport.h +++ b/src/core/sip-transport.h @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2010 SIPE Project + * Copyright (C) 2010-11 SIPE Project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -110,6 +110,7 @@ void sip_transport_subscribe(struct sipe_core_private *sipe_private, guint sip_transport_port(struct sipe_core_private *sipe_private); void sip_transport_deregister(struct sipe_core_private *sipe_private); void sip_transport_disconnect(struct sipe_core_private *sipe_private); +void sip_transport_authentication_completed(struct sipe_core_private *sipe_private); int sip_transaction_cseq(struct transaction *trans); diff --git a/src/core/sipe-certificate.c b/src/core/sipe-certificate.c index 8d64fd2f..413d546e 100644 --- a/src/core/sipe-certificate.c +++ b/src/core/sipe-certificate.c @@ -38,6 +38,7 @@ #include #include "sipe-common.h" +#include "sip-transport.h" #include "sipe-backend.h" #include "sipe-core.h" #include "sipe-core-private.h" @@ -213,7 +214,8 @@ static void get_and_publish_cert(struct sipe_core_private *sipe_private, SIPE_DEBUG_INFO("get_and_publish_cert: certificate for target '%s' added", ccd->target); - /* TBD: retrigger REGISTER.... */ + /* Let's try this again... */ + sip_transport_authentication_completed(sipe_private); success = TRUE; } -- 2.11.4.GIT