mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed bug (due to new serializer) that caused a wrong hash to be computed when sending distant messages
This commit is contained in:
parent
ef59a604d2
commit
a439fbf63e
@ -1624,11 +1624,18 @@ Sha1CheckSum p3GRouter::computeDataItemHash(RsGRouterGenericDataItem *data_item)
|
||||
RsTemporaryMemory mem(total_size) ;
|
||||
|
||||
uint32_t offset = 0 ;
|
||||
signature_serializer.serialise(data_item,mem,&total_size) ;
|
||||
offset += signed_data_size ;
|
||||
uint32_t tmp_size = total_size ;
|
||||
signature_serializer.serialise(data_item,mem,&tmp_size) ;
|
||||
if(tmp_size != signed_data_size)
|
||||
std::cerr << "(EE) Some error occured in p3GRouter::computeDataItemHash(). Mismatched offset/data size" << std::endl;
|
||||
|
||||
offset += tmp_size ;
|
||||
|
||||
data_item->signature.SetTlv(mem, total_size,&offset) ;
|
||||
|
||||
if(offset != total_size)
|
||||
std::cerr << "(EE) Some error occured in p3GRouter::computeDataItemHash(). Mismatched offset/data size" << std::endl;
|
||||
|
||||
return RsDirUtil::sha1sum(mem,total_size) ;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user