From d28ba34042d2f4d8c0263ac0de491f8d00a63d50 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Mon, 26 May 2014 12:44:04 +0200 Subject: [PATCH] notify: store ucPC2PCAVEncryption value form server --- src/core/sip-soap.c | 3 ++- src/core/sipe-core-private.h | 1 + src/core/sipe-notify.c | 14 +++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/core/sip-soap.c b/src/core/sip-soap.c index 54ed74a6..06f17811 100644 --- a/src/core/sip-soap.c +++ b/src/core/sip-soap.c @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2011-2013 SIPE Project + * Copyright (C) 2011-2015 SIPE Project * * * This program is free software; you can redistribute it and/or modify @@ -34,6 +34,7 @@ #include "sip-soap.h" #include "sip-transport.h" +#include "sipe-backend.h" #include "sipe-core.h" #include "sipe-core-private.h" #include "sipe-utils.h" diff --git a/src/core/sipe-core-private.h b/src/core/sipe-core-private.h index 40aacacf..b85454fc 100644 --- a/src/core/sipe-core-private.h +++ b/src/core/sipe-core-private.h @@ -134,6 +134,7 @@ struct sipe_core_private { gchar *media_relay_username; gchar *media_relay_password; GSList *media_relays; + SipeEncryptionPolicy server_av_encryption_policy; /* Group chat */ struct sipe_groupchat *groupchat; diff --git a/src/core/sipe-notify.c b/src/core/sipe-notify.c index fbbe0b96..2d0630ae 100644 --- a/src/core/sipe-notify.c +++ b/src/core/sipe-notify.c @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2011-2014 SIPE Project + * Copyright (C) 2011-2015 SIPE Project * * * This program is free software; you can redistribute it and/or modify @@ -98,6 +98,7 @@ static void sipe_process_provisioning_v2(struct sipe_core_private *sipe_private, "dlxExternalUrl" : "dlxInternalUrl"; const gchar *addressbook_uri_str = SIPE_CORE_PRIVATE_FLAG_IS(REMOTE_USER) ? "absExternalServerUrl" : "absInternalServerUrl"; + gchar *ucPC2PCAVEncryption = NULL; g_free(sipe_private->focus_factory_uri); sipe_private->focus_factory_uri = sipe_xml_data(sipe_xml_child(node, "focusFactoryUri")); @@ -129,6 +130,17 @@ static void sipe_process_provisioning_v2(struct sipe_core_private *sipe_private, sipe_media_get_av_edge_credentials(sipe_private); #endif + ucPC2PCAVEncryption = g_strstrip(sipe_xml_data(sipe_xml_child(node, "ucPC2PCAVEncryption"))); + if (sipe_strequal(ucPC2PCAVEncryption, "SupportEncryption")) { + sipe_private->server_av_encryption_policy = SIPE_ENCRYPTION_POLICY_OPTIONAL; + } else if (sipe_strequal(ucPC2PCAVEncryption, "DoNotSupportEncryption")) { + sipe_private->server_av_encryption_policy = SIPE_ENCRYPTION_POLICY_REJECTED; + } else { + // "RequireEncryption" or any unknown value. + sipe_private->server_av_encryption_policy = SIPE_ENCRYPTION_POLICY_REQUIRED; + } + g_free(ucPC2PCAVEncryption); + /* persistentChatConfiguration */ } else if (sipe_strequal("persistentChatConfiguration", node_name)) { const sipe_xml *property; -- 2.11.4.GIT