mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
fixed bug that would erase private publish key when a group update is received
This commit is contained in:
parent
165b241341
commit
29ab0e9913
@ -2580,7 +2580,11 @@ void RsGenExchange::publishGrps()
|
|||||||
ggps.mKeys = fullKeySet;
|
ggps.mKeys = fullKeySet;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// We should just merge the keys instead of overwriting them, because the update may not contain private parts.
|
||||||
|
|
||||||
fullKeySet = ggps.mKeys;
|
fullKeySet = ggps.mKeys;
|
||||||
|
}
|
||||||
|
|
||||||
// find private admin key
|
// find private admin key
|
||||||
RsTlvPrivateRSAKey privAdminKey;
|
RsTlvPrivateRSAKey privAdminKey;
|
||||||
@ -3216,6 +3220,13 @@ void RsGenExchange::performUpdateValidation()
|
|||||||
|
|
||||||
gu.newGrp->metaData->mSubscribeFlags = gu.oldGrpMeta->mSubscribeFlags ;
|
gu.newGrp->metaData->mSubscribeFlags = gu.oldGrpMeta->mSubscribeFlags ;
|
||||||
|
|
||||||
|
// Also keep private keys if present
|
||||||
|
|
||||||
|
if(!gu.newGrp->metaData->keys.private_keys.empty())
|
||||||
|
std::cerr << "(EE) performUpdateValidation() group " <<gu.newGrp->metaData->mGroupId << " has been received with private keys. This is very unexpected!" << std::endl;
|
||||||
|
else
|
||||||
|
gu.newGrp->metaData->keys.private_keys = gu.oldGrpMeta->keys.private_keys ;
|
||||||
|
|
||||||
grps.push_back(gu.newGrp);
|
grps.push_back(gu.newGrp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3254,7 +3265,7 @@ void RsGenExchange::performUpdateValidation()
|
|||||||
mGroupUpdates.clear();
|
mGroupUpdates.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RsGenExchange::updateValid(const RsGxsGrpMetaData& oldGrpMeta, RsNxsGrp& newGrp) const
|
bool RsGenExchange::updateValid(const RsGxsGrpMetaData& oldGrpMeta, const RsNxsGrp& newGrp) const
|
||||||
{
|
{
|
||||||
std::map<SignType, RsTlvKeySignature>& signSet = newGrp.metaData->signSet.keySignSet;
|
std::map<SignType, RsTlvKeySignature>& signSet = newGrp.metaData->signSet.keySignSet;
|
||||||
std::map<SignType, RsTlvKeySignature>::iterator mit = signSet.find(INDEX_AUTHEN_ADMIN);
|
std::map<SignType, RsTlvKeySignature>::iterator mit = signSet.find(INDEX_AUTHEN_ADMIN);
|
||||||
|
@ -835,7 +835,7 @@ private:
|
|||||||
* @param newGrp the new group that updates the old group (must have meta data member initialised)
|
* @param newGrp the new group that updates the old group (must have meta data member initialised)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool updateValid(const RsGxsGrpMetaData& oldGrp, RsNxsGrp& newGrp) const;
|
bool updateValid(const RsGxsGrpMetaData& oldGrp, const RsNxsGrp& newGrp) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* convenience function for checking private publish and admin keys are present
|
* convenience function for checking private publish and admin keys are present
|
||||||
|
Loading…
Reference in New Issue
Block a user