Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
47485efe
Commit
47485efe
authored
Apr 18, 2017
by
johan
Browse files
linphone_core_get_zrtp_secrets_file is back
parent
6d00594b
Changes
3
Hide whitespace changes
Inline
Side-by-side
coreapi/linphonecore.c
View file @
47485efe
...
...
@@ -5789,6 +5789,10 @@ static void linphone_core_uninit(LinphoneCore *lc)
bctbx_list_for_each
(
lc
->
call_logs
,(
void
(
*
)(
void
*
))
linphone_call_log_unref
);
lc
->
call_logs
=
bctbx_list_free
(
lc
->
call_logs
);
if
(
lc
->
zrtp_secrets_cache
!=
NULL
)
{
ms_free
(
lc
->
zrtp_secrets_cache
);
}
if
(
lc
->
user_certificates_path
!=
NULL
)
{
ms_free
(
lc
->
user_certificates_path
);
}
...
...
@@ -6210,6 +6214,12 @@ void linphone_core_remove_iterate_hook(LinphoneCore *lc, LinphoneCoreIterateHook
#ifdef HAVE_ZRTP
void
linphone_core_set_zrtp_secrets_file
(
LinphoneCore
*
lc
,
const
char
*
file
){
if
(
lc
->
zrtp_secrets_cache
!=
NULL
)
{
ms_free
(
lc
->
zrtp_secrets_cache
);
}
lc
->
zrtp_secrets_cache
=
file
?
ms_strdup
(
file
)
:
NULL
;
/* shall we perform cache migration ? */
if
(
!
lp_config_get_int
(
lc
->
config
,
"sip"
,
"zrtp_cache_migration_done"
,
FALSE
))
{
char
*
tmpFile
=
bctbx_malloc
(
strlen
(
file
)
+
6
);
...
...
@@ -6239,7 +6249,7 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){
linphone_core_zrtp_cache_db_init
(
lc
,
tmpFile
);
/* migrate */
if
(
bzrtp_cache_migration
((
void
*
)
cacheXml
,
linphone_core_get_zrtp_cache_db
(
lc
),
linphone_core_get_identity
(
lc
))
==
0
)
{
if
(
bzrtp_cache_migration
((
void
*
)
cacheXml
,
linphone_core_get_zrtp_cache_db
(
lc
),
linphone_core_get_identity
(
lc
))
==
0
)
{
char
*
bkpFile
=
bctbx_malloc
(
strlen
(
file
)
+
6
);
sprintf
(
bkpFile
,
"%s.bkp"
,
file
);
/* migration went ok, rename the original file and replace it with by the tmp one and set the migration tag in config file */
...
...
@@ -6261,6 +6271,10 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){
}
#endif
/* HAVE_ZRTP */
const
char
*
linphone_core_get_zrtp_secrets_file
(
LinphoneCore
*
lc
){
return
lc
->
zrtp_secrets_cache
;
}
void
*
linphone_core_get_zrtp_cache_db
(
LinphoneCore
*
lc
){
#ifdef SQLITE_STORAGE_ENABLED
return
(
void
*
)
lc
->
zrtp_cache_db
;
...
...
coreapi/private.h
View file @
47485efe
...
...
@@ -1056,6 +1056,7 @@ struct _LinphoneCore
struct
_EchoTester
*
ect
;
LinphoneTaskList
hooks
;
/*tasks periodically executed in linphone_core_iterate()*/
LinphoneConference
*
conf_ctx
;
char
*
zrtp_secrets_cache
;
/**< zrtp cache filename */
char
*
user_certificates_path
;
LinphoneVideoPolicy
video_policy
;
time_t
network_last_check
;
...
...
include/linphone/core.h
View file @
47485efe
...
...
@@ -3658,6 +3658,14 @@ LINPHONE_PUBLIC void linphone_core_refresh_registers(LinphoneCore* lc);
*/
LINPHONE_PUBLIC
void
linphone_core_set_zrtp_secrets_file
(
LinphoneCore
*
lc
,
const
char
*
file
);
/**
* Get the path to the file storing the zrtp secrets cache.
* @param[in] lc #LinphoneCore object.
* @return The path to the file storing the zrtp secrets cache.
* @ingroup initializing
*/
LINPHONE_PUBLIC
const
char
*
linphone_core_get_zrtp_secrets_file
(
LinphoneCore
*
lc
);
/**
* Get a pointer to the sqlite db holding zrtp/lime cache
* @param[in] lc #LinphoneCore object.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment