diff --git a/configure.ac b/configure.ac index 3142b0ffd..07562cc7b 100644 --- a/configure.ac +++ b/configure.ac @@ -639,6 +639,58 @@ AC_ARG_ENABLE(g729bCN, [g729bCN=false] ) +dnl Polarssl lib is requested for Lime +AC_ARG_WITH( polarssl, + [ --with-polarssl Set prefix where polarssl can be found (ex:/usr, /usr/local)[[default=PREFIX or /usr if NONE]] ], + [ polarssl_prefix=${withval}],[ if test "$prefix" != "NONE"; then + polarssl_prefix=${prefix} + else + polarssl_prefix="/usr" + fi ]) + +found_polarssl=no + +if test "$polarssl_prefix" != "none" ; then + if test "$polarssl_prefix" != "/usr" ; then + POLARSSL_CFLAGS="-I${polarssl_prefix}/include" + POLARSSL_LIBS="-L${polarssl_prefix}/lib" + fi + POLARSSL_LIBS="$POLARSSL_LIBS -lpolarssl" + + CPPFLAGS_save=$CPPFLAGS + LIBS_save=$LIBS + + CPPFLAGS="$CPPFLAGS $POLARSSL_CFLAGS" + LIBS="$LIBS $POLARSSL_LIBS" + AC_CHECK_HEADERS(polarssl/gcm.h, + [found_polarssl=yes; AC_MSG_NOTICE([polarssl usable])], + [POLARSSL_CFLAGS="" + POLARSSL_LIBS=""]) + CPPFLAGS=$CPPFLAGS_save + LIBS=$LIBS_save +fi + +dnl check for Lime support, need polarssl version >= 1.3 (with gcm.h) +AC_ARG_ENABLE(lime, + [AS_HELP_STRING([--enable-lime], [Turn on or off compilation of Instant Messaging Encryption (default=yes)])], + [case "${enableval}" in + yes) lime=true ;; + no) lime=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-lime) ;; + esac], + [lime=true] +) + +if test "$lime" = "true" ; then + if test "x$found_polarssl" != "xyes" ; then + AC_MSG_ERROR("LIME requires POLARSSL in version >= 1.3") + else + AC_DEFINE(HAVE_LIME, 1, [Defined when LIME support is compiled]) + fi +else + echo "LIME compilation is disabled." +fi + dnl build console if required AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue) @@ -1001,6 +1053,7 @@ printf "* %-30s %s\n" "Tools" $build_tools printf "* %-30s %s\n" "Message storage" $enable_msg_storage printf "* %-30s %s\n" "zRTP encryption" $zrtp printf "* %-30s %s\n" "DTLS encryption" $dtls +printf "* %-30s %s\n" "IM encryption" $lime printf "* %-30s %s\n" "uPnP support" $build_upnp printf "* %-30s %s\n" "LDAP support" $enable_ldap printf "* %-30s %s\n" "ZLIB support" $found_zlib diff --git a/coreapi/lime.c b/coreapi/lime.c index 1deafb6d9..190ea6be7 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -1,4 +1,10 @@ #include "lime.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_LIME + #include "linphonecore.h" #include "ortp/b64.h" #include "polarssl/gcm.h" @@ -11,6 +17,14 @@ #else /* for Polarssl version 1.2 */ #include "polarssl/sha2.h" #endif + +/** + * @brief check at runtime if LIME is available + * + * @return TRUE when Lime was fully compiled, FALSE when it wasn't + */ +bool_t lime_is_available() { return TRUE; } + /** * @brief convert an hexa char [0-9a-fA-F] into the corresponding unsigned integer value * Any invalid char will be converted to zero without any warning @@ -89,7 +103,15 @@ void lime_int8ToStr(uint8_t *outputString, uint8_t *inputBytes, uint16_t inputBy -int lime_getSelfZid(xmlDocPtr cacheBuffer, uint8_t selfZid[25]) { +/** + * @brief Retrieve selfZID from cache + * + * @param[in] cacheBuffer The xmlDoc containing current cache + * @param[out] selfZid The ZID found as a 24 hexa char string null terminated + * + * @return 0 on success, error code otherwise + */ +static int lime_getSelfZid(xmlDocPtr cacheBuffer, uint8_t selfZid[25]) { xmlNodePtr cur; xmlChar *selfZidHex; @@ -379,7 +401,15 @@ int lime_setCachedKey(xmlDocPtr cacheBuffer, limeKey_t *associatedKey, uint8_t r return 0; } -int lime_deriveKey(limeKey_t *key) { +/** + * @brief Derive in place the key given in parameter and increment session index + * Derivation is made derived Key = HMAC_SHA256(Key, 0x0000001||"MessageKey"||0x00||SessionId||SessionIndex||256) + * + * @param[in/out] key The structure containing the original key which will be overwritten, the sessionId and SessionIndex + * + * @return 0 on success, error code otherwise + */ +static int lime_deriveKey(limeKey_t *key) { uint8_t inputData[55]; uint8_t derivedKey[32]; @@ -779,6 +809,18 @@ int lime_decryptMultipartMessage(xmlDocPtr cacheBuffer, uint8_t *message, uint8_ return 0; } + +#else /* HAVE_LIME */ + +bool_t lime_is_available() { return FALSE; } +int lime_decryptFile(void **cryptoContext, unsigned char *key, size_t length, char *plain, char *cipher) { return LIME_NOT_ENABLED;} +int lime_decryptMultipartMessage(xmlDocPtr cacheBuffer, uint8_t *message, uint8_t **output) { return LIME_NOT_ENABLED;} +int lime_createMultipartMessage(xmlDocPtr cacheBuffer, uint8_t *message, uint8_t *peerURI, uint8_t **output) { return LIME_NOT_ENABLED;} +int lime_encryptFile(void **cryptoContext, unsigned char *key, size_t length, char *plain, char *cipher) {return LIME_NOT_ENABLED;} + + +#endif /* HAVE_LIME */ + char *lime_error_code_to_string(int errorCode) { switch (errorCode) { case LIME_INVALID_CACHE: return "Invalid ZRTP cache"; @@ -787,6 +829,7 @@ char *lime_error_code_to_string(int errorCode) { case LIME_UNABLE_TO_DECRYPT_MESSAGE: return "Unable to decrypt message"; case LIME_NO_VALID_KEY_FOUND_FOR_PEER: return "No valid key found"; case LIME_INVALID_ENCRYPTED_MESSAGE: return "Invalid encrypted message"; + case LIME_NOT_ENABLED: return "Lime not enabled at build"; } return "Unknow error"; diff --git a/coreapi/lime.h b/coreapi/lime.h index dae36d898..c196a6410 100644 --- a/coreapi/lime.h +++ b/coreapi/lime.h @@ -7,6 +7,7 @@ #define LIME_UNABLE_TO_DECRYPT_MESSAGE 0x1008 #define LIME_NO_VALID_KEY_FOUND_FOR_PEER 0x1010 #define LIME_INVALID_ENCRYPTED_MESSAGE 0x1020 +#define LIME_NOT_ENABLED 0x1100 /* this define the maximum key derivation number allowed to get the caches back in sync in case of missed messages */ #define MAX_DERIVATION_NUMBER 100 @@ -41,16 +42,6 @@ typedef struct limeURIKeys_struct { uint8_t *peerURI; /**< the sip URI associated to all the keys, must be a null terminated string */ } limeURIKeys_t; -/** - * @brief Retrieve selfZID from cache - * - * @param[in] cacheBuffer The xmlDoc containing current cache - * @param[out] selfZid The ZID found as a 24 hexa char string null terminated - * - * @return 0 on success, error code otherwise - */ -LINPHONE_PUBLIC int lime_getSelfZid(xmlDocPtr cacheBuffer, uint8_t selfZid[25]); - /** * @brief Get from cache all the senders keys associated to the given URI * peerKeys field from associatedKeys param must be NULL when calling this function. @@ -94,16 +85,6 @@ LINPHONE_PUBLIC int lime_setCachedKey(xmlDocPtr cacheBuffer, limeKey_t *associat */ LINPHONE_PUBLIC void lime_freeKeys(limeURIKeys_t associatedKeys); -/** - * @brief Derive in place the key given in parameter and increment session index - * Derivation is made derived Key = HMAC_SHA256(Key, 0x0000001||"MessageKey"||0x00||SessionId||SessionIndex||256) - * - * @param[in/out] key The structure containing the original key which will be overwritten, the sessionId and SessionIndex - * - * @return 0 on success, error code otherwise - */ -LINPHONE_PUBLIC int lime_deriveKey(limeKey_t *key); - /** * @brief encrypt a message with the given key * @@ -196,4 +177,10 @@ LINPHONE_PUBLIC int lime_decryptMultipartMessage(xmlDocPtr cacheBuffer, uint8_t */ LINPHONE_PUBLIC char *lime_error_code_to_string(int errorCode); +/** + * @brief Check if Lime was enabled at build time + * + * @return TRUE if Lime is available, FALSE if not + */ +LINPHONE_PUBLIC bool_t lime_is_available(); #endif /* LIME_H */ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 4aa402f81..c56dbe02c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "lpconfig.h" #include "private.h" #include "quality_reporting.h" +#include "lime.h" #include #include @@ -1841,7 +1842,7 @@ void linphone_core_enable_lime(LinphoneCore *lc, bool_t val){ } bool_t linphone_core_lime_enabled(const LinphoneCore *lc){ - return lp_config_get_int(lc->config,"sip", "lime", FALSE); + return (lp_config_get_int(lc->config,"sip", "lime", FALSE) && lime_is_available()); } /** diff --git a/tester/message_tester.c b/tester/message_tester.c index bddd40df2..506d714d7 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -572,6 +572,7 @@ static void small_file_transfer_message(void) { linphone_core_manager_destroy(pauline); } +#ifdef HAVE_LIME static void lime_file_transfer_message(void) { int i; char *to; @@ -659,6 +660,199 @@ static void lime_file_transfer_message(void) { } +static void printHex(char *title, uint8_t *data, uint32_t length) { + int i; + printf ("%s : ", title); + for (i=0; ipeerZID, 12); + printHex("key", associatedKeys.peerKeys[i]->key, 32); + printHex("sessionID", associatedKeys.peerKeys[i]->sessionId, 32); + printf("session index %d\n", associatedKeys.peerKeys[i]->sessionIndex); + } + + /* get data from cache : receiver */ + memcpy(associatedKey.peerZID, targetZID, 12); + retval = lime_getCachedRcvKeyByZid(cacheBuffer, &associatedKey); + printf("getCachedKey by ZID return %d\n", retval); + + printHex("Key", associatedKey.key, 32); + printHex("sessionID", associatedKey.sessionId, 32); + printf("session index %d\n", associatedKey.sessionIndex); + + /* encrypt/decrypt a message */ + lime_encryptMessage(associatedKeys.peerKeys[0], (uint8_t *)"bla Bla bla b! Pipo", 20, senderZID, encryptedMessage); + printHex("Ciphered", encryptedMessage, 32); + /* invert sender and receiverZID to decrypt/authenticate */ + memcpy(receiverZID, associatedKeys.peerKeys[0]->peerZID, 12); + memcpy(associatedKeys.peerKeys[0]->peerZID, senderZID, 12); + retval = lime_decryptMessage(associatedKeys.peerKeys[0], encryptedMessage, 36, receiverZID, plainMessage); + printf("Decrypt and auth returned %d\nPlain: %s\n", retval, plainMessage); + + /* update receiver data */ + associatedKey.sessionIndex++; + associatedKey.key[0]++; + associatedKey.sessionId[0]++; + retval = lime_setCachedKey(cacheBuffer, &associatedKey, LIME_RECEIVER); + printf("setCachedKey return %d\n", retval); + + /* update sender data */ + associatedKeys.peerKeys[0]->sessionIndex++; + associatedKeys.peerKeys[0]->key[0]++; + associatedKeys.peerKeys[0]->sessionId[0]++; + retval = lime_setCachedKey(cacheBuffer, associatedKeys.peerKeys[0], LIME_SENDER); + printf("setCachedKey return %d\n", retval); + + /* free memory */ + lime_freeKeys(associatedKeys); + + /* write the file */ + /* dump the xml document into a string */ + xmlDocDumpFormatMemoryEnc(cacheBuffer, &xmlStringOutput, &xmlStringLength, "UTF-8", 0); + /* write it to the file */ + CACHE = fopen("ZIDCache.xml", "w+"); + fwrite(xmlStringOutput, 1, xmlStringLength, CACHE); + xmlFree(xmlStringOutput); + fclose(CACHE); + xmlFreeDoc(cacheBuffer); +} + +static void lime_text_message(void) { + char* to; + FILE *ZIDCacheMarieFD, *ZIDCachePaulineFD; + LinphoneChatRoom* chat_room; + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + + /* make sure lime is enabled */ + linphone_core_enable_lime(marie->lc, 1); + linphone_core_enable_lime(pauline->lc, 1); + + /* set the zid caches files : create two ZID cache from this valid one inserting the auto-generated sip URI for the peer account as keys in ZID cache are indexed by peer sip uri */ + ZIDCacheMarieFD = fopen("tmpZIDCacheMarie.xml", "w"); + ZIDCachePaulineFD = fopen("tmpZIDCachePauline.xml", "w"); + fprintf(ZIDCacheMarieFD, "\nef7692d0792a67491ae2d44e005dbe0399643d953a2202dd9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s08df5907d30959b8cb70f6fff2d8febd88fb41b0c8afc39e4b972f86dd5cfe2d60f020a3fe11dc2cc0e1e8ed9341b4cd14944db806ca4fc95456bbe45d95c43a5f9aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193bcffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b7719300000078000001cf011234567889643d953a2202ee9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s72d80ab1cad243cf45634980c1d02cfb2df81ce0dd5dfcf1ebeacfc5345a917625d9ac653a83c4559cb0ae7394e7cd3b2d3c57bb28e62068d2df23e8f9b77193f69aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b7719322ffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b771930000000f00000000", linphone_address_as_string_uri_only(pauline->identity), linphone_address_as_string_uri_only(pauline->identity)); + fprintf(ZIDCachePaulineFD, "\n005dbe0399643d953a2202ddef7692d0792a67491ae2d44e9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s08df5907d30959b8cb70f6fff2d8febd88fb41b0c8afc39e4b972f86dd5cfe2d60f020a3fe11dc2cc0e1e8ed9341b4cd14944db806ca4fc95456bbe45d95c43a5f9aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193bcffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b7719300000078000001cf011234567889643d953a2202ee9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s81e6e6362c34dc974263d1f77cbb9a8d6d6a718330994379099a8fa19fb12faa25d9ac653a83c4559cb0ae7394e7cd3b2d3c57bb28e62068d2df23e8f9b77193f69aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b7719322ffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b771930000002e0000000001", linphone_address_as_string_uri_only(marie->identity), linphone_address_as_string_uri_only(marie->identity)); + fclose(ZIDCacheMarieFD); + fclose(ZIDCachePaulineFD); + linphone_core_set_zrtp_secrets_file(marie->lc, "tmpZIDCacheMarie.xml"); + linphone_core_set_zrtp_secrets_file(pauline->lc, "tmpZIDCachePauline.xml"); + + to = linphone_address_as_string(marie->identity); + chat_room = linphone_core_create_chat_room(pauline->lc,to); + ms_free(to); + + linphone_chat_room_send_message(chat_room,"Bla bla bla bla"); + CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1)); + CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageReceivedLegacy,1); + + CU_ASSERT_PTR_NOT_NULL(linphone_core_get_chat_room(marie->lc,pauline->identity)); + /* TODO : check the message arrived correctly deciphered */ + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} +#endif /* HAVE_LIME */ + static void file_transfer_message_io_error_upload(void) { int i; char* to; @@ -1128,199 +1322,6 @@ static void is_composing_notification(void) { linphone_core_manager_destroy(pauline); } -void printHex(char *title, uint8_t *data, uint32_t length) { - int i; - printf ("%s : ", title); - for (i=0; ipeerZID, 12); - printHex("key", associatedKeys.peerKeys[i]->key, 32); - printHex("sessionID", associatedKeys.peerKeys[i]->sessionId, 32); - printf("session index %d\n", associatedKeys.peerKeys[i]->sessionIndex); - } - - /* get data from cache : receiver */ - memcpy(associatedKey.peerZID, targetZID, 12); - retval = lime_getCachedRcvKeyByZid(cacheBuffer, &associatedKey); - printf("getCachedKey by ZID return %d\n", retval); - - printHex("Key", associatedKey.key, 32); - printHex("sessionID", associatedKey.sessionId, 32); - printf("session index %d\n", associatedKey.sessionIndex); - - /* encrypt/decrypt a message */ - lime_encryptMessage(associatedKeys.peerKeys[0], (uint8_t *)"bla Bla bla b! Pipo", 20, senderZID, encryptedMessage); - printHex("Ciphered", encryptedMessage, 32); - /* invert sender and receiverZID to decrypt/authenticate */ - memcpy(receiverZID, associatedKeys.peerKeys[0]->peerZID, 12); - memcpy(associatedKeys.peerKeys[0]->peerZID, senderZID, 12); - retval = lime_decryptMessage(associatedKeys.peerKeys[0], encryptedMessage, 36, receiverZID, plainMessage); - printf("Decrypt and auth returned %d\nPlain: %s\n", retval, plainMessage); - - /* update receiver data */ - associatedKey.sessionIndex++; - associatedKey.key[0]++; - associatedKey.sessionId[0]++; - retval = lime_setCachedKey(cacheBuffer, &associatedKey, LIME_RECEIVER); - printf("setCachedKey return %d\n", retval); - - /* update sender data */ - associatedKeys.peerKeys[0]->sessionIndex++; - associatedKeys.peerKeys[0]->key[0]++; - associatedKeys.peerKeys[0]->sessionId[0]++; - retval = lime_setCachedKey(cacheBuffer, associatedKeys.peerKeys[0], LIME_SENDER); - printf("setCachedKey return %d\n", retval); - - /* free memory */ - lime_freeKeys(associatedKeys); - - /* write the file */ - /* dump the xml document into a string */ - xmlDocDumpFormatMemoryEnc(cacheBuffer, &xmlStringOutput, &xmlStringLength, "UTF-8", 0); - /* write it to the file */ - CACHE = fopen("ZIDCache.xml", "w+"); - fwrite(xmlStringOutput, 1, xmlStringLength, CACHE); - xmlFree(xmlStringOutput); - fclose(CACHE); - xmlFreeDoc(cacheBuffer); -} - -static void lime_text_message(void) { - char* to; - FILE *ZIDCacheMarieFD, *ZIDCachePaulineFD; - LinphoneChatRoom* chat_room; - LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); - - /* make sure lime is enabled */ - linphone_core_enable_lime(marie->lc, 1); - linphone_core_enable_lime(pauline->lc, 1); - - /* set the zid caches files : create two ZID cache from this valid one inserting the auto-generated sip URI for the peer account as keys in ZID cache are indexed by peer sip uri */ - ZIDCacheMarieFD = fopen("tmpZIDCacheMarie.xml", "w"); - ZIDCachePaulineFD = fopen("tmpZIDCachePauline.xml", "w"); - fprintf(ZIDCacheMarieFD, "\nef7692d0792a67491ae2d44e005dbe0399643d953a2202dd9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s08df5907d30959b8cb70f6fff2d8febd88fb41b0c8afc39e4b972f86dd5cfe2d60f020a3fe11dc2cc0e1e8ed9341b4cd14944db806ca4fc95456bbe45d95c43a5f9aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193bcffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b7719300000078000001cf011234567889643d953a2202ee9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s72d80ab1cad243cf45634980c1d02cfb2df81ce0dd5dfcf1ebeacfc5345a917625d9ac653a83c4559cb0ae7394e7cd3b2d3c57bb28e62068d2df23e8f9b77193f69aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b7719322ffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b771930000000f00000000", linphone_address_as_string_uri_only(pauline->identity), linphone_address_as_string_uri_only(pauline->identity)); - fprintf(ZIDCachePaulineFD, "\n005dbe0399643d953a2202ddef7692d0792a67491ae2d44e9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s08df5907d30959b8cb70f6fff2d8febd88fb41b0c8afc39e4b972f86dd5cfe2d60f020a3fe11dc2cc0e1e8ed9341b4cd14944db806ca4fc95456bbe45d95c43a5f9aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193bcffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b7719300000078000001cf011234567889643d953a2202ee9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899%s81e6e6362c34dc974263d1f77cbb9a8d6d6a718330994379099a8fa19fb12faa25d9ac653a83c4559cb0ae7394e7cd3b2d3c57bb28e62068d2df23e8f9b77193f69aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b7719322ffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b771930000002e0000000001", linphone_address_as_string_uri_only(marie->identity), linphone_address_as_string_uri_only(marie->identity)); - fclose(ZIDCacheMarieFD); - fclose(ZIDCachePaulineFD); - linphone_core_set_zrtp_secrets_file(marie->lc, "tmpZIDCacheMarie.xml"); - linphone_core_set_zrtp_secrets_file(pauline->lc, "tmpZIDCachePauline.xml"); - - to = linphone_address_as_string(marie->identity); - chat_room = linphone_core_create_chat_room(pauline->lc,to); - ms_free(to); - - linphone_chat_room_send_message(chat_room,"Bla bla bla bla"); - CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1)); - CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageReceivedLegacy,1); - - CU_ASSERT_PTR_NOT_NULL(linphone_core_get_chat_room(marie->lc,pauline->identity)); - /* TODO : check the message arrived correctly deciphered */ - - linphone_core_manager_destroy(marie); - linphone_core_manager_destroy(pauline); -} - - #ifdef MSG_STORAGE_ENABLED /* @@ -1519,7 +1520,6 @@ static void history_messages_count() { #endif test_t message_tests[] = { - { "Lime Text Message", lime_text_message }, { "Text message", text_message }, { "Text message within call's dialog", text_message_within_dialog}, { "Text message with credentials from auth info cb", text_message_with_credential_from_auth_cb}, @@ -1534,13 +1534,16 @@ test_t message_tests[] = { /* { "File transfer message with io error at download", file_transfer_message_io_error_download },*/ { "File transfer message upload cancelled", file_transfer_message_upload_cancelled }, { "File transfer message download cancelled", file_transfer_message_download_cancelled }, - { "Lime File transfer message", lime_file_transfer_message }, { "File transfer message using external body url", file_transfer_using_external_body_url }, { "Text message denied", text_message_denied }, { "Info message", info_message }, { "Info message with body", info_message_with_body }, - { "IsComposing notification", is_composing_notification }, - { "Lime Unitary", lime_unit } + { "IsComposing notification", is_composing_notification } +#ifdef HAVE_LIME + ,{ "Lime Text Message", lime_text_message } + ,{ "Lime File transfer message", lime_file_transfer_message } + ,{ "Lime Unitary", lime_unit } +#endif /* HAVE_LIME */ #ifdef MSG_STORAGE_ENABLED ,{ "Database migration", message_storage_migration } ,{ "History count", history_messages_count }