mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-23 05:05:30 -04:00
added recording system for usage cases of GXS ids
This commit is contained in:
parent
94d099f43b
commit
ef0850e65b
6 changed files with 54 additions and 30 deletions
|
@ -470,8 +470,8 @@ int RsGenExchange::createGroupSignatures(RsTlvKeySignatureSet& signSet, RsTlvBin
|
|||
if(GxsSecurity::getSignature((char*)grpData.bin_data, grpData.bin_len, authorKey, sign))
|
||||
{
|
||||
id_ret = SIGN_SUCCESS;
|
||||
mGixs->timeStampKey(grpMeta.mAuthorId) ;
|
||||
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
||||
mGixs->timeStampKey(grpMeta.mAuthorId,"Creation of group author signature for GrpId" + grpMeta.mGroupId.toStdString()) ;
|
||||
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
||||
}
|
||||
else
|
||||
id_ret = SIGN_FAIL;
|
||||
|
@ -638,7 +638,7 @@ int RsGenExchange::createMsgSignatures(RsTlvKeySignatureSet& signSet, RsTlvBinar
|
|||
if(GxsSecurity::getSignature((char*)msgData.bin_data, msgData.bin_len, authorKey, sign))
|
||||
{
|
||||
id_ret = SIGN_SUCCESS;
|
||||
mGixs->timeStampKey(msgMeta.mAuthorId) ;
|
||||
mGixs->timeStampKey(msgMeta.mAuthorId,"Creating author signature in group " + msgMeta.mGroupId.toStdString() + ", msg " + msgMeta.mMsgId.toStdString()) ;
|
||||
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
||||
}
|
||||
else
|
||||
|
@ -855,7 +855,7 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
|
|||
{
|
||||
RsTlvKeySignature sign = metaData.signSet.keySignSet[INDEX_AUTHEN_IDENTITY];
|
||||
idValidate &= GxsSecurity::validateNxsMsg(*msg, sign, authorKey);
|
||||
mGixs->timeStampKey(metaData.mAuthorId) ;
|
||||
mGixs->timeStampKey(metaData.mAuthorId,"Validation of author signature. Grp="+metaData.mGroupId.toStdString()+", msg="+metaData.mMsgId.toStdString()) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -986,7 +986,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp)
|
|||
#ifdef GEN_EXCH_DEBUG
|
||||
std::cerr << " key ID validation result: " << idValidate << std::endl;
|
||||
#endif
|
||||
mGixs->timeStampKey(metaData.mAuthorId) ;
|
||||
mGixs->timeStampKey(metaData.mAuthorId,"Group author signature validation. GrpId=" + metaData.mGroupId.toStdString()) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3145,7 +3145,7 @@ bool RsGenExchange::updateValid(RsGxsGrpMetaData& oldGrpMeta, RsNxsGrp& newGrp)
|
|||
// also check this is the latest published group
|
||||
bool latest = newGrp.metaData->mPublishTs > oldGrpMeta.mPublishTs;
|
||||
|
||||
mGixs->timeStampKey(newGrp.metaData->mAuthorId) ;
|
||||
mGixs->timeStampKey(newGrp.metaData->mAuthorId,"Validation of signature for updated grp " + oldGrpMeta.mGroupId.toStdString()) ;
|
||||
return GxsSecurity::validateNxsGrp(newGrp, adminSign, keyMit->second) && latest;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ public:
|
|||
virtual bool getOwnIds(std::list<RsGxsId>& ids) = 0;
|
||||
virtual bool isOwnId(const RsGxsId& key_id) = 0 ;
|
||||
|
||||
virtual void timeStampKey(const RsGxsId& key_id) = 0 ;
|
||||
virtual void timeStampKey(const RsGxsId& key_id,const std::string& reason) = 0 ;
|
||||
|
||||
// Key related interface - used for validating msgs and groups.
|
||||
/*!
|
||||
|
|
|
@ -339,7 +339,7 @@ bool RsGxsIntegrityCheck::check()
|
|||
// Note: we could time_stamp even in the case where the id is not cached. Anyway, it's not really a problem here, since IDs have a high chance of
|
||||
// behing eventually stamped.
|
||||
|
||||
mGixs->timeStampKey(gxs_ids[n]) ;
|
||||
mGixs->timeStampKey(gxs_ids[n],"Used in service (Integrity check)") ;
|
||||
}
|
||||
|
||||
gxs_ids[n] = gxs_ids[gxs_ids.size()-1] ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue