From 7720b06041a674d326da9919af70cbf3d71bfdc8 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 16 Jun 2017 17:16:11 +0200 Subject: [PATCH] add a trace in case lime key is derivated because of message loses --- coreapi/lime.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coreapi/lime.c b/coreapi/lime.c index 62ecfed29..94b1a271d 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -685,6 +685,12 @@ int lime_decryptMultipartMessage(void *cachedb, uint8_t *message, const char *se return LIME_UNABLE_TO_DECRYPT_MESSAGE; } + if (associatedKey.sessionIndex != usedSessionIndex) { + ms_warning("Line: unexpected session index [%i] received from [%s], [%i] message will discarded" + , usedSessionIndex + , peerURI + , associatedKey.sessionIndex - usedSessionIndex); + } while (usedSessionIndex>associatedKey.sessionIndex) { lime_deriveKey(&associatedKey); }