mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed usage info statistics in identities
This commit is contained in:
parent
57a1c4bf5d
commit
6d665868e8
@ -219,7 +219,13 @@ bool DistributedChatService::checkSignature(RsChatLobbyBouncingObject *obj,const
|
|||||||
|
|
||||||
// network pre-request key to allow message authentication.
|
// network pre-request key to allow message authentication.
|
||||||
|
|
||||||
mGixs->requestKey(obj->signature.keyId,peer_list,RsIdentityUsage(RS_SERVICE_TYPE_CHAT,RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION,RsGxsGroupId(),RsGxsMessageId(),obj->lobby_id));
|
mGixs->requestKey(obj->signature.keyId,peer_list,RsIdentityUsage(RsServiceType::CHAT,
|
||||||
|
RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION,
|
||||||
|
RsGxsGroupId(),
|
||||||
|
RsGxsMessageId(),
|
||||||
|
RsGxsMessageId(),
|
||||||
|
RsGxsMessageId(),
|
||||||
|
obj->lobby_id));
|
||||||
|
|
||||||
uint32_t size = RsChatSerialiser(RsSerializationFlags::SIGNATURE)
|
uint32_t size = RsChatSerialiser(RsSerializationFlags::SIGNATURE)
|
||||||
.size(dynamic_cast<RsItem*>(obj));
|
.size(dynamic_cast<RsItem*>(obj));
|
||||||
@ -238,7 +244,13 @@ bool DistributedChatService::checkSignature(RsChatLobbyBouncingObject *obj,const
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t error_status ;
|
uint32_t error_status ;
|
||||||
RsIdentityUsage use_info(RS_SERVICE_TYPE_CHAT,RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION,RsGxsGroupId(),RsGxsMessageId(),obj->lobby_id) ;
|
RsIdentityUsage use_info(RsServiceType::CHAT,
|
||||||
|
RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION,
|
||||||
|
RsGxsGroupId(),
|
||||||
|
RsGxsMessageId(),
|
||||||
|
RsGxsMessageId(),
|
||||||
|
RsGxsMessageId(),
|
||||||
|
obj->lobby_id) ;
|
||||||
|
|
||||||
if(!mGixs->validateData(memory,size,obj->signature,false,use_info,error_status))
|
if(!mGixs->validateData(memory,size,obj->signature,false,use_info,error_status))
|
||||||
{
|
{
|
||||||
|
@ -450,7 +450,7 @@ void p3discovery2::recvIdentityList(const RsPeerId& pid,const std::list<RsGxsId>
|
|||||||
std::cerr << "p3discovery2::recvIdentityList(): from peer " << pid << ": " << ids.size() << " identities" << std::endl;
|
std::cerr << "p3discovery2::recvIdentityList(): from peer " << pid << ": " << ids.size() << " identities" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RsIdentityUsage use_info(RS_SERVICE_TYPE_DISC,RsIdentityUsage::IDENTITY_DATA_UPDATE);
|
RsIdentityUsage use_info(RsServiceType::GOSSIP_DISCOVERY,RsIdentityUsage::IDENTITY_NEW_FROM_DISCOVERY);
|
||||||
|
|
||||||
for(auto it(ids.begin());it!=ids.end();++it)
|
for(auto it(ids.begin());it!=ids.end();++it)
|
||||||
{
|
{
|
||||||
|
@ -2108,7 +2108,7 @@ bool p3GRouter::verifySignedDataItem(const RsGRouterAbstractMsgItem *item,const
|
|||||||
if(!signature_serializer.serialise(const_cast<RsGRouterAbstractMsgItem*>(item),data,&data_size))
|
if(!signature_serializer.serialise(const_cast<RsGRouterAbstractMsgItem*>(item),data,&data_size))
|
||||||
throw std::runtime_error("Cannot serialise signed data.");
|
throw std::runtime_error("Cannot serialise signed data.");
|
||||||
|
|
||||||
RsIdentityUsage use(RS_SERVICE_TYPE_GROUTER,info);
|
RsIdentityUsage use(RsServiceType::GROUTER,info);
|
||||||
|
|
||||||
if(!mGixs->validateData( data, data_size, item->signature, true, use, error_status ))
|
if(!mGixs->validateData( data, data_size, item->signature, true, use, error_status ))
|
||||||
{
|
{
|
||||||
|
@ -512,7 +512,7 @@ int RsGenExchange::createGroupSignatures(RsTlvKeySignatureSet& signSet, RsTlvBin
|
|||||||
if(GxsSecurity::getSignature((char*)grpData.bin_data, grpData.bin_len, authorKey, sign))
|
if(GxsSecurity::getSignature((char*)grpData.bin_data, grpData.bin_len, authorKey, sign))
|
||||||
{
|
{
|
||||||
id_ret = SIGN_SUCCESS;
|
id_ret = SIGN_SUCCESS;
|
||||||
mGixs->timeStampKey(grpMeta.mAuthorId,RsIdentityUsage(mServType,RsIdentityUsage::GROUP_AUTHOR_SIGNATURE_CREATION,grpMeta.mGroupId)) ;
|
mGixs->timeStampKey(grpMeta.mAuthorId,RsIdentityUsage(RsServiceType(mServType),RsIdentityUsage::GROUP_AUTHOR_SIGNATURE_CREATION,grpMeta.mGroupId)) ;
|
||||||
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -953,7 +953,12 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
|
|||||||
{
|
{
|
||||||
std::list<RsPeerId> peers;
|
std::list<RsPeerId> peers;
|
||||||
peers.push_back(msg->PeerId());
|
peers.push_back(msg->PeerId());
|
||||||
mGixs->requestKey(metaData.mAuthorId, peers, RsIdentityUsage((RsServiceType)serviceType(),RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId,metaData.mMsgId,metaData.mParentId,metaData.mThreadId));
|
mGixs->requestKey(metaData.mAuthorId, peers, RsIdentityUsage((RsServiceType)serviceType(),
|
||||||
|
RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION,
|
||||||
|
metaData.mGroupId,
|
||||||
|
metaData.mMsgId,
|
||||||
|
metaData.mParentId,
|
||||||
|
metaData.mThreadId));
|
||||||
|
|
||||||
#ifdef GEN_EXCH_DEBUG
|
#ifdef GEN_EXCH_DEBUG
|
||||||
std::cerr << ", Key missing. Retry later." << std::endl;
|
std::cerr << ", Key missing. Retry later." << std::endl;
|
||||||
@ -1030,7 +1035,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp)
|
|||||||
#ifdef GEN_EXCH_DEBUG
|
#ifdef GEN_EXCH_DEBUG
|
||||||
std::cerr << " key ID validation result: " << idValidate << std::endl;
|
std::cerr << " key ID validation result: " << idValidate << std::endl;
|
||||||
#endif
|
#endif
|
||||||
mGixs->timeStampKey(metaData.mAuthorId,RsIdentityUsage(mServType,RsIdentityUsage::GROUP_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId));
|
mGixs->timeStampKey(metaData.mAuthorId,RsIdentityUsage(RsServiceType(mServType),RsIdentityUsage::GROUP_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1048,7 +1053,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp)
|
|||||||
#endif
|
#endif
|
||||||
std::list<RsPeerId> peers;
|
std::list<RsPeerId> peers;
|
||||||
peers.push_back(grp->PeerId());
|
peers.push_back(grp->PeerId());
|
||||||
mGixs->requestKey(metaData.mAuthorId, peers,RsIdentityUsage(mServType,RsIdentityUsage::GROUP_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId));
|
mGixs->requestKey(metaData.mAuthorId, peers,RsIdentityUsage(RsServiceType(mServType),RsIdentityUsage::GROUP_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId));
|
||||||
return VALIDATE_FAIL_TRY_LATER;
|
return VALIDATE_FAIL_TRY_LATER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3350,7 +3355,7 @@ bool RsGenExchange::updateValid(const RsGxsGrpMetaData& oldGrpMeta, const RsNxsG
|
|||||||
// also check this is the latest published group
|
// also check this is the latest published group
|
||||||
bool latest = newGrp.metaData->mPublishTs > oldGrpMeta.mPublishTs;
|
bool latest = newGrp.metaData->mPublishTs > oldGrpMeta.mPublishTs;
|
||||||
|
|
||||||
mGixs->timeStampKey(newGrp.metaData->mAuthorId, RsIdentityUsage(mServType,RsIdentityUsage::GROUP_ADMIN_SIGNATURE_CREATION, oldGrpMeta.mGroupId)) ;
|
mGixs->timeStampKey(newGrp.metaData->mAuthorId, RsIdentityUsage(RsServiceType(mServType),RsIdentityUsage::GROUP_ADMIN_SIGNATURE_CREATION, oldGrpMeta.mGroupId)) ;
|
||||||
|
|
||||||
return GxsSecurity::validateNxsGrp(newGrp, adminSign, keyMit->second) && latest;
|
return GxsSecurity::validateNxsGrp(newGrp, adminSign, keyMit->second) && latest;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,8 @@ bool RsGxsIntegrityCheck::check()
|
|||||||
rsReputations->overallReputationLevel(
|
rsReputations->overallReputationLevel(
|
||||||
grp->metaData->mAuthorId ) >
|
grp->metaData->mAuthorId ) >
|
||||||
RsReputationLevel::LOCALLY_NEGATIVE )
|
RsReputationLevel::LOCALLY_NEGATIVE )
|
||||||
used_gxs_ids.insert(std::make_pair(grp->metaData->mAuthorId, RsIdentityUsage(mGenExchangeClient->serviceType(), RsIdentityUsage::GROUP_AUTHOR_KEEP_ALIVE,grp->grpId)));
|
used_gxs_ids.insert(std::make_pair(grp->metaData->mAuthorId, RsIdentityUsage(RsServiceType(mGenExchangeClient->serviceType()),
|
||||||
|
RsIdentityUsage::GROUP_AUTHOR_KEEP_ALIVE,grp->grpId)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -404,7 +405,12 @@ bool RsGxsIntegrityCheck::check()
|
|||||||
rsReputations->overallReputationLevel(
|
rsReputations->overallReputationLevel(
|
||||||
msg->metaData->mAuthorId ) >
|
msg->metaData->mAuthorId ) >
|
||||||
RsReputationLevel::LOCALLY_NEGATIVE )
|
RsReputationLevel::LOCALLY_NEGATIVE )
|
||||||
used_gxs_ids.insert(std::make_pair(msg->metaData->mAuthorId,RsIdentityUsage(mGenExchangeClient->serviceType(),RsIdentityUsage::MESSAGE_AUTHOR_KEEP_ALIVE,msg->metaData->mGroupId,msg->metaData->mMsgId))) ;
|
used_gxs_ids.insert(std::make_pair(msg->metaData->mAuthorId,RsIdentityUsage(RsServiceType(mGenExchangeClient->serviceType()),
|
||||||
|
RsIdentityUsage::MESSAGE_AUTHOR_KEEP_ALIVE,
|
||||||
|
msg->metaData->mGroupId,
|
||||||
|
msg->metaData->mMsgId,
|
||||||
|
msg->metaData->mParentId,
|
||||||
|
msg->metaData->mThreadId))) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -976,7 +976,7 @@ void p3GxsTunnelService::handleRecvDHPublicKey(RsGxsTunnelDHPublicKeyItem *item)
|
|||||||
std::cerr << "(SS) Signature was verified and it doesn't check! This is a security issue!" << std::endl;
|
std::cerr << "(SS) Signature was verified and it doesn't check! This is a security issue!" << std::endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
mGixs->timeStampKey(item->signature.keyId,RsIdentityUsage(RS_SERVICE_TYPE_GXS_TUNNEL,RsIdentityUsage::GXS_TUNNEL_DH_SIGNATURE_CHECK));
|
mGixs->timeStampKey(item->signature.keyId,RsIdentityUsage(RsServiceType::GXS_TUNNEL,RsIdentityUsage::GXS_TUNNEL_DH_SIGNATURE_CHECK));
|
||||||
|
|
||||||
#ifdef DEBUG_GXS_TUNNEL
|
#ifdef DEBUG_GXS_TUNNEL
|
||||||
std::cerr << " Signature checks! Sender's ID = " << senders_id << std::endl;
|
std::cerr << " Signature checks! Sender's ID = " << senders_id << std::endl;
|
||||||
|
@ -234,33 +234,30 @@ struct RsIdentityUsage : RsSerializable
|
|||||||
GXS_TUNNEL_DH_SIGNATURE_CHECK = 0x0c,
|
GXS_TUNNEL_DH_SIGNATURE_CHECK = 0x0c,
|
||||||
GXS_TUNNEL_DH_SIGNATURE_CREATION = 0x0d,
|
GXS_TUNNEL_DH_SIGNATURE_CREATION = 0x0d,
|
||||||
|
|
||||||
|
/// Identity received through GXS sync
|
||||||
|
IDENTITY_NEW_FROM_GXS_SYNC = 0x0e,
|
||||||
/// Group update on that identity data. Can be avatar, name, etc.
|
/// Group update on that identity data. Can be avatar, name, etc.
|
||||||
IDENTITY_DATA_UPDATE = 0x0e,
|
IDENTITY_NEW_FROM_DISCOVERY = 0x0f,
|
||||||
|
/// Explicit request to friend
|
||||||
|
IDENTITY_NEW_FROM_EXPLICIT_REQUEST = 0x10,
|
||||||
|
|
||||||
/// Any signature verified for that identity
|
/// Any signature verified for that identity
|
||||||
IDENTITY_GENERIC_SIGNATURE_CHECK = 0x0f,
|
IDENTITY_GENERIC_SIGNATURE_CHECK = 0x11,
|
||||||
|
|
||||||
/// Any signature made by that identity
|
/// Any signature made by that identity
|
||||||
IDENTITY_GENERIC_SIGNATURE_CREATION = 0x10,
|
IDENTITY_GENERIC_SIGNATURE_CREATION = 0x12,
|
||||||
|
|
||||||
IDENTITY_GENERIC_ENCRYPTION = 0x11,
|
IDENTITY_GENERIC_ENCRYPTION = 0x13,
|
||||||
IDENTITY_GENERIC_DECRYPTION = 0x12,
|
IDENTITY_GENERIC_DECRYPTION = 0x14,
|
||||||
CIRCLE_MEMBERSHIP_CHECK = 0x13
|
CIRCLE_MEMBERSHIP_CHECK = 0x15
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RS_DEPRECATED
|
|
||||||
RsIdentityUsage( uint16_t service, const RsIdentityUsage::UsageCode& code,
|
|
||||||
const RsGxsGroupId& gid = RsGxsGroupId(),
|
|
||||||
const RsGxsMessageId& mid = RsGxsMessageId(),
|
|
||||||
uint64_t additional_id=0,
|
|
||||||
const std::string& comment = std::string() );
|
|
||||||
|
|
||||||
RsIdentityUsage( RsServiceType service,
|
RsIdentityUsage( RsServiceType service,
|
||||||
RsIdentityUsage::UsageCode code,
|
RsIdentityUsage::UsageCode code,
|
||||||
const RsGxsGroupId& gid = RsGxsGroupId(),
|
const RsGxsGroupId& gid = RsGxsGroupId(),
|
||||||
const RsGxsMessageId& mid = RsGxsMessageId(),
|
const RsGxsMessageId& message_id = RsGxsMessageId(),
|
||||||
const RsGxsMessageId& pid = RsGxsMessageId(),
|
const RsGxsMessageId& parent_id = RsGxsMessageId(),
|
||||||
const RsGxsMessageId& tid = RsGxsMessageId(),
|
const RsGxsMessageId& thread_id = RsGxsMessageId(),
|
||||||
uint64_t additional_id=0,
|
uint64_t additional_id=0,
|
||||||
const std::string& comment = std::string() );
|
const std::string& comment = std::string() );
|
||||||
|
|
||||||
|
@ -1468,7 +1468,7 @@ bool p3GxsCircles::locked_processLoadingCacheEntry(RsGxsCircleCache& cache)
|
|||||||
rsPeers->getOnlineList(peers) ;
|
rsPeers->getOnlineList(peers) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
mIdentities->requestKey(pit->first, peers,RsIdentityUsage(serviceType(),RsIdentityUsage::CIRCLE_MEMBERSHIP_CHECK,RsGxsGroupId(cache.mCircleId)));
|
mIdentities->requestKey(pit->first, peers,RsIdentityUsage(RsServiceType::GXSCIRCLE,RsIdentityUsage::CIRCLE_MEMBERSHIP_CHECK,RsGxsGroupId(cache.mCircleId)));
|
||||||
|
|
||||||
all_ids_here = false;
|
all_ids_here = false;
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
rsEvents->postEvent(ev);
|
rsEvents->postEvent(ev);
|
||||||
|
|
||||||
// also time_stamp the key that this group represents
|
// also time_stamp the key that this group represents
|
||||||
timeStampKey(RsGxsId(gid),RsIdentityUsage(serviceType(),RsIdentityUsage::IDENTITY_DATA_UPDATE)) ;
|
timeStampKey(RsGxsId(gid),RsIdentityUsage(RsServiceType(serviceType()),RsIdentityUsage::IDENTITY_NEW_FROM_GXS_SYNC)) ;
|
||||||
should_subscribe = true;
|
should_subscribe = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -654,7 +654,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
rsEvents->postEvent(ev);
|
rsEvents->postEvent(ev);
|
||||||
|
|
||||||
// also time_stamp the key that this group represents
|
// also time_stamp the key that this group represents
|
||||||
timeStampKey(RsGxsId(gid),RsIdentityUsage(serviceType(),RsIdentityUsage::IDENTITY_DATA_UPDATE)) ;
|
timeStampKey(RsGxsId(gid),RsIdentityUsage(RsServiceType(serviceType()),RsIdentityUsage::IDENTITY_NEW_FROM_GXS_SYNC)) ;
|
||||||
should_subscribe = true;
|
should_subscribe = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1214,8 +1214,7 @@ bool p3IdService::requestIdentity(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsIdentityUsage usageInfo( RsServiceType::GXSID,
|
RsIdentityUsage usageInfo( RsServiceType::GXSID, RsIdentityUsage::IDENTITY_NEW_FROM_EXPLICIT_REQUEST );
|
||||||
RsIdentityUsage::IDENTITY_DATA_UPDATE );
|
|
||||||
|
|
||||||
return requestKey(id, askPeersList, usageInfo);
|
return requestKey(id, askPeersList, usageInfo);
|
||||||
}
|
}
|
||||||
@ -1360,7 +1359,7 @@ bool p3IdService::signData(const uint8_t *data,uint32_t data_size,const RsGxsId&
|
|||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
error_status = RS_GIXS_ERROR_NO_ERROR ;
|
error_status = RS_GIXS_ERROR_NO_ERROR ;
|
||||||
timeStampKey(own_gxs_id,RsIdentityUsage(serviceType(),RsIdentityUsage::IDENTITY_GENERIC_SIGNATURE_CREATION)) ;
|
timeStampKey(own_gxs_id,RsIdentityUsage(RsServiceType(serviceType()),RsIdentityUsage::IDENTITY_GENERIC_SIGNATURE_CREATION)) ;
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
@ -1433,7 +1432,7 @@ bool p3IdService::encryptData( const uint8_t *decrypted_data,
|
|||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
error_status = RS_GIXS_ERROR_NO_ERROR ;
|
error_status = RS_GIXS_ERROR_NO_ERROR ;
|
||||||
timeStampKey(encryption_key_id,RsIdentityUsage(serviceType(),RsIdentityUsage::IDENTITY_GENERIC_ENCRYPTION)) ;
|
timeStampKey(encryption_key_id,RsIdentityUsage(RsServiceType::GXSID,RsIdentityUsage::IDENTITY_GENERIC_ENCRYPTION)) ;
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
@ -1522,7 +1521,7 @@ bool p3IdService::encryptData( const uint8_t* decrypted_data,
|
|||||||
{
|
{
|
||||||
timeStampKey( *it,
|
timeStampKey( *it,
|
||||||
RsIdentityUsage(
|
RsIdentityUsage(
|
||||||
serviceType(),
|
RsServiceType::GXSID,
|
||||||
RsIdentityUsage::IDENTITY_GENERIC_ENCRYPTION ) );
|
RsIdentityUsage::IDENTITY_GENERIC_ENCRYPTION ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1563,7 +1562,7 @@ bool p3IdService::decryptData( const uint8_t *encrypted_data,
|
|||||||
error_status = RS_GIXS_ERROR_NO_ERROR;
|
error_status = RS_GIXS_ERROR_NO_ERROR;
|
||||||
timeStampKey( key_id,
|
timeStampKey( key_id,
|
||||||
RsIdentityUsage(
|
RsIdentityUsage(
|
||||||
serviceType(),
|
RsServiceType::GXSID,
|
||||||
RsIdentityUsage::IDENTITY_GENERIC_DECRYPTION) );
|
RsIdentityUsage::IDENTITY_GENERIC_DECRYPTION) );
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
@ -1656,7 +1655,7 @@ bool p3IdService::decryptData( const uint8_t* encrypted_data,
|
|||||||
{
|
{
|
||||||
timeStampKey( *it,
|
timeStampKey( *it,
|
||||||
RsIdentityUsage(
|
RsIdentityUsage(
|
||||||
serviceType(),
|
RsServiceType::GXSID,
|
||||||
RsIdentityUsage::IDENTITY_GENERIC_DECRYPTION ) );
|
RsIdentityUsage::IDENTITY_GENERIC_DECRYPTION ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3223,7 +3222,7 @@ bool p3IdService::cachetest_handlerequest(uint32_t token)
|
|||||||
if (!haveKey(*vit))
|
if (!haveKey(*vit))
|
||||||
{
|
{
|
||||||
std::list<RsPeerId> nullpeers;
|
std::list<RsPeerId> nullpeers;
|
||||||
requestKey(*vit, nullpeers,RsIdentityUsage(serviceType(),RsIdentityUsage::UNKNOWN_USAGE));
|
requestKey(*vit, nullpeers,RsIdentityUsage(RsServiceType::GXSID,RsIdentityUsage::UNKNOWN_USAGE));
|
||||||
|
|
||||||
#ifdef DEBUG_IDS
|
#ifdef DEBUG_IDS
|
||||||
std::cerr << "p3IdService::cachetest_request() Requested Key Id: " << *vit;
|
std::cerr << "p3IdService::cachetest_request() Requested Key Id: " << *vit;
|
||||||
@ -4840,42 +4839,6 @@ RsIdentityUsage::RsIdentityUsage(RsServiceType service, RsIdentityUsage::UsageCo
|
|||||||
mHash = hs.hash();
|
mHash = hs.hash();
|
||||||
}
|
}
|
||||||
|
|
||||||
RsIdentityUsage::RsIdentityUsage(
|
|
||||||
uint16_t service, const RsIdentityUsage::UsageCode& code,
|
|
||||||
const RsGxsGroupId& gid, const RsGxsMessageId& mid,
|
|
||||||
uint64_t additional_id,const std::string& comment ) :
|
|
||||||
mServiceId(static_cast<RsServiceType>(service)), mUsageCode(code),
|
|
||||||
mGrpId(gid), mMsgId(mid), mAdditionalId(additional_id), mComment(comment)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_IDS
|
|
||||||
std::cerr << "New identity usage: " << std::endl;
|
|
||||||
std::cerr << " service=" << std::hex << service << std::endl;
|
|
||||||
std::cerr << " code =" << std::hex << code << std::endl;
|
|
||||||
std::cerr << " grpId =" << std::hex << gid << std::endl;
|
|
||||||
std::cerr << " msgId =" << std::hex << mid << std::endl;
|
|
||||||
std::cerr << " add id =" << std::hex << additional_id << std::endl;
|
|
||||||
std::cerr << " commnt =\"" << std::hex << comment << "\"" << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is a hack, since it will hash also mHash, but because it is
|
|
||||||
* initialized to 0, and only computed in the constructor here, it should
|
|
||||||
* be ok. */
|
|
||||||
librs::crypto::HashStream hs(librs::crypto::HashStream::SHA1) ;
|
|
||||||
|
|
||||||
hs << (uint32_t)service ; // G10h4ck: Why uint32 if it's 16 bits?
|
|
||||||
hs << (uint8_t)code ;
|
|
||||||
hs << gid ;
|
|
||||||
hs << mid ;
|
|
||||||
hs << (uint64_t)additional_id ;
|
|
||||||
hs << comment ;
|
|
||||||
|
|
||||||
mHash = hs.hash();
|
|
||||||
|
|
||||||
#ifdef DEBUG_IDS
|
|
||||||
std::cerr << " hash =\"" << std::hex << mHash << "\"" << std::endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
RsIdentityUsage::RsIdentityUsage() :
|
RsIdentityUsage::RsIdentityUsage() :
|
||||||
mServiceId(RsServiceType::NONE), mUsageCode(UNKNOWN_USAGE), mAdditionalId(0)
|
mServiceId(RsServiceType::NONE), mUsageCode(UNKNOWN_USAGE), mAdditionalId(0)
|
||||||
{}
|
{}
|
||||||
|
@ -1864,7 +1864,8 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
case RsServiceType::FORUMS: service_name = tr("Forums") ; service_type = RetroShareLink::TYPE_FORUM ; break ;
|
case RsServiceType::FORUMS: service_name = tr("Forums") ; service_type = RetroShareLink::TYPE_FORUM ; break ;
|
||||||
case RsServiceType::POSTED: service_name = tr("Boards") ; service_type = RetroShareLink::TYPE_POSTED ; break ;
|
case RsServiceType::POSTED: service_name = tr("Boards") ; service_type = RetroShareLink::TYPE_POSTED ; break ;
|
||||||
case RsServiceType::CHAT: service_name = tr("Chat") ; service_type = RetroShareLink::TYPE_CHAT_ROOM ; break ;
|
case RsServiceType::CHAT: service_name = tr("Chat") ; service_type = RetroShareLink::TYPE_CHAT_ROOM ; break ;
|
||||||
case RsServiceType::GXS_TRANS: service_name = tr("GxsMail"); service_type = RetroShareLink::TYPE_MESSAGE ; break ;
|
|
||||||
|
case RsServiceType::GXS_TRANS: return tr("GxsMail author ");
|
||||||
#ifdef TODO
|
#ifdef TODO
|
||||||
// We need a RS link for circles if we want to do that.
|
// We need a RS link for circles if we want to do that.
|
||||||
//
|
//
|
||||||
@ -1895,10 +1896,17 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
{
|
{
|
||||||
RetroShareLink l;
|
RetroShareLink l;
|
||||||
|
|
||||||
|
std::cerr << "Signature validation/keep alive signature:" << std::endl;
|
||||||
|
std::cerr << " service ID = " << std::hex << (uint16_t)u.mServiceId << std::dec << std::endl;
|
||||||
|
std::cerr << " u.mGrpId = " << u.mGrpId << std::endl;
|
||||||
|
std::cerr << " u.mMsgId = " << u.mMsgId << std::endl;
|
||||||
|
std::cerr << " u.mParentId = " << u.mParentId << std::endl;
|
||||||
|
std::cerr << " u.mThreadId = " << u.mThreadId << std::endl;
|
||||||
|
|
||||||
if(service_type == RetroShareLink::TYPE_CHANNEL && !u.mThreadId.isNull())
|
if(service_type == RetroShareLink::TYPE_CHANNEL && !u.mThreadId.isNull())
|
||||||
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mThreadId,tr("vote/comment"));
|
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mThreadId,tr("Vote/comment"));
|
||||||
else if(service_type == RetroShareLink::TYPE_POSTED && !u.mThreadId.isNull())
|
else if(service_type == RetroShareLink::TYPE_POSTED && !u.mThreadId.isNull())
|
||||||
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mThreadId,tr("vote"));
|
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mThreadId,tr("Vote"));
|
||||||
else
|
else
|
||||||
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mMsgId,tr("Message"));
|
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mMsgId,tr("Message"));
|
||||||
|
|
||||||
@ -1928,9 +1936,13 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
{
|
{
|
||||||
return tr("Signature in distant tunnel system.");
|
return tr("Signature in distant tunnel system.");
|
||||||
}
|
}
|
||||||
case RsIdentityUsage::IDENTITY_DATA_UPDATE: // Group update on that identity data. Can be avatar, name, etc.
|
case RsIdentityUsage::IDENTITY_NEW_FROM_GXS_SYNC: // Group update on that identity data. Can be avatar, name, etc.
|
||||||
{
|
{
|
||||||
return tr("Update of identity data.");
|
return tr("Received from GXS sync.");
|
||||||
|
}
|
||||||
|
case RsIdentityUsage::IDENTITY_NEW_FROM_DISCOVERY: // Own friend sended his own ids
|
||||||
|
{
|
||||||
|
return tr("Friend node identity received through discovery.");
|
||||||
}
|
}
|
||||||
case RsIdentityUsage::IDENTITY_GENERIC_SIGNATURE_CHECK: // Any signature verified for that identity
|
case RsIdentityUsage::IDENTITY_GENERIC_SIGNATURE_CHECK: // Any signature verified for that identity
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user