Lime key validity gets easier config file setting

- can use expression like 1W, 2M or 3d instead of number of seconds
This commit is contained in:
Johan Pascal 2017-02-06 14:39:14 +07:00
parent 1841b4222e
commit bced2b3534
2 changed files with 2 additions and 2 deletions

View file

@ -880,7 +880,7 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
fclose(CACHEFD);
cacheXml = xmlParseDoc((xmlChar*)cacheString);
ms_free(cacheString);
retval = lime_decryptMultipartMessage(cacheXml, (uint8_t *)msg->message, &decrypted_body, &decrypted_content_type, lp_config_get_int(lc->config, "sip", "lime_key_validity", 0));
retval = lime_decryptMultipartMessage(cacheXml, (uint8_t *)msg->message, &decrypted_body, &decrypted_content_type, bctbx_time_string_to_sec(lp_config_get_string(lc->config, "sip", "lime_key_validity", "0")));
if (retval != 0) {
ms_warning("Unable to decrypt message, reason : %s", lime_error_code_to_string(retval));
if (decrypted_body) ms_free(decrypted_body);

View file

@ -2531,7 +2531,7 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
/*call->current_params.media_encryption will be set later when zrtp is activated*/
params.zid_file=lc->zrtp_secrets_cache;
params.uri=uri;
params.limeKeyTimeSpan = lp_config_get_int(lc->config, "sip", "lime_key_validity", 0); /* get key lifespan from config file, default is 0:forever valid */
params.limeKeyTimeSpan = bctbx_time_string_to_sec(lp_config_get_string(lc->config, "sip", "lime_key_validity", "0")); /* get key lifespan from config file, default is 0:forever valid */
setZrtpCryptoTypesParameters(&params,call->core);
audio_stream_enable_zrtp(call->audiostream,&params);
if (uri != NULL) ms_free(uri);