From ea82d26b756f9c3f959c214b3c350740c9b0fdc6 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 9 Feb 2017 23:35:59 +0100 Subject: [PATCH] fixed signature verification bug for versionned messages --- libretroshare/src/gxs/gxssecurity.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/gxs/gxssecurity.cc b/libretroshare/src/gxs/gxssecurity.cc index 20ddc1462..8a5bb5851 100644 --- a/libretroshare/src/gxs/gxssecurity.cc +++ b/libretroshare/src/gxs/gxssecurity.cc @@ -436,8 +436,12 @@ bool GxsSecurity::validateNxsMsg(const RsNxsMsg& msg, const RsTlvKeySignature& s msgMeta.signSet.TlvClear(); RsGxsMessageId msgId = msgMeta.mMsgId, origMsgId = msgMeta.mOrigMsgId; - msgMeta.mOrigMsgId.clear(); + + if(msgMeta.mOrigMsgId == msgMeta.mMsgId) // message is not versionned, then the signature was made with mOrigMsgId==NULL + msgMeta.mOrigMsgId.clear(); + msgMeta.mMsgId.clear(); + int signOk = 0 ; {