Commit 2e726685 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed LIME tests

parent 7bcaa5bd
...@@ -832,9 +832,9 @@ bool_t linphone_chat_room_lime_available(LinphoneChatRoom *cr) { ...@@ -832,9 +832,9 @@ bool_t linphone_chat_room_lime_available(LinphoneChatRoom *cr) {
if (CACHEFD) { if (CACHEFD) {
size_t cacheSize; size_t cacheSize;
xmlDocPtr cacheXml; xmlDocPtr cacheXml;
char *cacheString=ms_load_file_content(CACHEFD, &cacheSize); char *cacheString = ms_load_file_content(CACHEFD, &cacheSize);
if (!cacheString){ if (!cacheString) {
ms_warning("Unable to load content of ZRTP ZID cache to decrypt message"); ms_warning("Unable to load content of ZRTP ZID cache");
return FALSE; return FALSE;
} }
cacheString[cacheSize] = '\0'; cacheString[cacheSize] = '\0';
...@@ -845,15 +845,18 @@ bool_t linphone_chat_room_lime_available(LinphoneChatRoom *cr) { ...@@ -845,15 +845,18 @@ bool_t linphone_chat_room_lime_available(LinphoneChatRoom *cr) {
if (cacheXml) { if (cacheXml) {
bool_t res; bool_t res;
limeURIKeys_t associatedKeys; limeURIKeys_t associatedKeys;
char *peer = linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(room));
/* retrieve keys associated to the peer URI */ /* retrieve keys associated to the peer URI */
associatedKeys.peerURI = (uint8_t *)malloc(strlen(cr->peer)+1); associatedKeys.peerURI = (uint8_t *)malloc(strlen(peer)+1);
strcpy((char *)(associatedKeys.peerURI), cr->peer); strcpy((char *)(associatedKeys.peerURI), peer);
associatedKeys.associatedZIDNumber = 0; associatedKeys.associatedZIDNumber = 0;
associatedKeys.peerKeys = NULL; associatedKeys.peerKeys = NULL;
res = (lime_getCachedSndKeysByURI(cacheXml, &associatedKeys) == 0 && associatedKeys.associatedZIDNumber != 0); res = (lime_getCachedSndKeysByURI(cacheXml, &associatedKeys) == 0 && associatedKeys.associatedZIDNumber != 0);
lime_freeKeys(&associatedKeys); lime_freeKeys(&associatedKeys);
xmlFreeDoc(cacheXml); xmlFreeDoc(cacheXml);
ms_free(peer);
return res; return res;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment