mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-27 16:09:20 +00:00
Move crypto API to bctoolbox
- LIME is yet to be ported, compilation fail with LIME enabled
This commit is contained in:
parent
1980323a8e
commit
b504646e58
4 changed files with 61 additions and 2 deletions
|
|
@ -94,6 +94,7 @@ if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
|
|||
else()
|
||||
find_package(BelleSIP REQUIRED)
|
||||
find_package(Mediastreamer2 REQUIRED)
|
||||
find_package(BcToolBox REQUIRED)
|
||||
endif()
|
||||
find_package(XML2 REQUIRED)
|
||||
find_package(Zlib)
|
||||
|
|
@ -181,6 +182,7 @@ include_directories(
|
|||
${CMAKE_CURRENT_BINARY_DIR}/coreapi/
|
||||
${BELLESIP_INCLUDE_DIRS}
|
||||
${MEDIASTREAMER2_INCLUDE_DIRS}
|
||||
${BCTOOLBOX_INCLUDE_DIRS}
|
||||
)
|
||||
if(ENABLE_TUNNEL)
|
||||
include_directories(${TUNNEL_INCLUDE_DIRS})
|
||||
|
|
|
|||
56
cmake/FindBcToolBox.cmake
Executable file
56
cmake/FindBcToolBox.cmake
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
############################################################################
|
||||
# FindiBcToolBox.cmake
|
||||
# Copyright (C) 2016 Belledonne Communications, Grenoble France
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# 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 the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# - Find the bctoolbox include file and library
|
||||
#
|
||||
# BCTOOLBOX_FOUND - system has BC Toolbox
|
||||
# BCTOOLBOX_INCLUDE_DIRS - the BC Toolbox include directory
|
||||
# BCTOOLBOX_LIBRARIES - The libraries needed to use BC Toolbox
|
||||
|
||||
include(CMakePushCheckState)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
set(_BCTOOLBOX_ROOT_PATHS
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
||||
find_path(BCTOOLBOX_INCLUDE_DIRS
|
||||
NAMES bctoolbox/crypto.h
|
||||
HINTS _BCTOOLBOX_ROOT_PATHS
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
find_library(BCTOOLBOX_LIBRARIES
|
||||
NAMES bctoolbox
|
||||
HINTS _BCTOOLBOX_ROOT_PATHS
|
||||
PATH_SUFFIXES bin lib
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(BcToolBox
|
||||
DEFAULT_MSG
|
||||
BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES
|
||||
)
|
||||
|
||||
mark_as_advanced(BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES)
|
||||
|
|
@ -149,6 +149,7 @@ apply_compile_flags(LINPHONE_SOURCE_FILES_CXX "CPP" "CXX")
|
|||
apply_compile_flags(LINPHONE_SOURCE_FILES_OBJC "CPP" "OBJC")
|
||||
|
||||
set(LIBS
|
||||
${BCTOOLBOX_LIBRARIES}
|
||||
${BELLESIP_LIBRARIES}
|
||||
${MEDIASTREAMER2_LIBRARIES}
|
||||
${XML2_LIBRARIES}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "linphonecore.h"
|
||||
#include "private.h"
|
||||
|
||||
#include <polarssl/md5.h>
|
||||
#include <bctoolbox/crypto.h>
|
||||
|
||||
|
||||
static char * create_resource_list_xml(const LinphoneFriendList *list) {
|
||||
|
|
@ -392,7 +392,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon
|
|||
char *xml_content = create_resource_list_xml(list);
|
||||
if ((address != NULL) && (xml_content != NULL) && (linphone_friend_list_has_subscribe_inactive(list) == TRUE)) {
|
||||
unsigned char digest[16];
|
||||
md5((unsigned char *)xml_content, strlen(xml_content), digest);
|
||||
bctoolbox_md5((unsigned char *)xml_content, strlen(xml_content), digest);
|
||||
if ((list->event != NULL) && (list->content_digest != NULL) && (memcmp(list->content_digest, digest, sizeof(digest)) == 0)) {
|
||||
/* The content has not changed, only refresh the event. */
|
||||
linphone_event_refresh_subscribe(list->event);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue