mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
attempt to improve the info about GXS id usage
This commit is contained in:
parent
79fce47d75
commit
57a1c4bf5d
@ -680,7 +680,7 @@ int RsGenExchange::createMsgSignatures(RsTlvKeySignatureSet& signSet, RsTlvBinar
|
|||||||
if(GxsSecurity::getSignature((char*)msgData.bin_data, msgData.bin_len, authorKey, sign))
|
if(GxsSecurity::getSignature((char*)msgData.bin_data, msgData.bin_len, authorKey, sign))
|
||||||
{
|
{
|
||||||
id_ret = SIGN_SUCCESS;
|
id_ret = SIGN_SUCCESS;
|
||||||
mGixs->timeStampKey(msgMeta.mAuthorId,RsIdentityUsage(mServType,RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_CREATION,msgMeta.mGroupId,msgMeta.mMsgId)) ;
|
mGixs->timeStampKey(msgMeta.mAuthorId,RsIdentityUsage(RsServiceType(mServType),RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_CREATION,msgMeta.mGroupId,msgMeta.mMsgId,msgMeta.mParentId,msgMeta.mThreadId)) ;
|
||||||
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -905,7 +905,11 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
|
|||||||
{
|
{
|
||||||
RsTlvKeySignature sign = metaData.signSet.keySignSet[INDEX_AUTHEN_IDENTITY];
|
RsTlvKeySignature sign = metaData.signSet.keySignSet[INDEX_AUTHEN_IDENTITY];
|
||||||
idValidate &= GxsSecurity::validateNxsMsg(*msg, sign, authorKey);
|
idValidate &= GxsSecurity::validateNxsMsg(*msg, sign, authorKey);
|
||||||
mGixs->timeStampKey(metaData.mAuthorId,RsIdentityUsage(mServType,RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId,metaData.mMsgId)) ;
|
mGixs->timeStampKey(metaData.mAuthorId,RsIdentityUsage(RsServiceType(mServType),RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION,
|
||||||
|
metaData.mGroupId,
|
||||||
|
metaData.mMsgId,
|
||||||
|
metaData.mParentId,
|
||||||
|
metaData.mThreadId)) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -949,7 +953,7 @@ 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(serviceType(),RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION,metaData.mGroupId,metaData.mMsgId));
|
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;
|
||||||
|
@ -259,6 +259,8 @@ struct RsIdentityUsage : RsSerializable
|
|||||||
RsIdentityUsage::UsageCode code,
|
RsIdentityUsage::UsageCode code,
|
||||||
const RsGxsGroupId& gid = RsGxsGroupId(),
|
const RsGxsGroupId& gid = RsGxsGroupId(),
|
||||||
const RsGxsMessageId& mid = RsGxsMessageId(),
|
const RsGxsMessageId& mid = RsGxsMessageId(),
|
||||||
|
const RsGxsMessageId& pid = RsGxsMessageId(),
|
||||||
|
const RsGxsMessageId& tid = RsGxsMessageId(),
|
||||||
uint64_t additional_id=0,
|
uint64_t additional_id=0,
|
||||||
const std::string& comment = std::string() );
|
const std::string& comment = std::string() );
|
||||||
|
|
||||||
@ -275,6 +277,12 @@ struct RsIdentityUsage : RsSerializable
|
|||||||
/// Message ID using the identity
|
/// Message ID using the identity
|
||||||
RsGxsMessageId mMsgId;
|
RsGxsMessageId mMsgId;
|
||||||
|
|
||||||
|
/// Reference message ID. Useful for votes/comments
|
||||||
|
RsGxsMessageId mParentId;
|
||||||
|
|
||||||
|
/// Reference message ID. Useful for votes/comments
|
||||||
|
RsGxsMessageId mThreadId;
|
||||||
|
|
||||||
/// Some additional ID. Can be used for e.g. chat lobbies.
|
/// Some additional ID. Can be used for e.g. chat lobbies.
|
||||||
uint64_t mAdditionalId;
|
uint64_t mAdditionalId;
|
||||||
|
|
||||||
|
@ -4819,11 +4819,10 @@ void RsGxsIdGroup::serial_process(
|
|||||||
RS_SERIAL_PROCESS(mReputation);
|
RS_SERIAL_PROCESS(mReputation);
|
||||||
}
|
}
|
||||||
|
|
||||||
RsIdentityUsage::RsIdentityUsage(
|
RsIdentityUsage::RsIdentityUsage(RsServiceType service, RsIdentityUsage::UsageCode code,
|
||||||
RsServiceType service, RsIdentityUsage::UsageCode code,
|
const RsGxsGroupId& gid, const RsGxsMessageId& mid, const RsGxsMessageId &pid, const RsGxsMessageId &tid,
|
||||||
const RsGxsGroupId& gid, const RsGxsMessageId& mid,
|
|
||||||
uint64_t additional_id, const std::string& comment ) :
|
uint64_t additional_id, const std::string& comment ) :
|
||||||
mServiceId(service), mUsageCode(code), mGrpId(gid), mMsgId(mid),
|
mServiceId(service), mUsageCode(code), mGrpId(gid), mMsgId(mid),mParentId(pid),mThreadId(tid),
|
||||||
mAdditionalId(additional_id), mComment(comment)
|
mAdditionalId(additional_id), mComment(comment)
|
||||||
{
|
{
|
||||||
/* This is a hack, since it will hash also mHash, but because it is
|
/* This is a hack, since it will hash also mHash, but because it is
|
||||||
|
@ -1864,7 +1864,12 @@ 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::MAIL: service_name = tr("Mail") ; service_type = RetroShareLink::TYPE_MESSAGE ; break ;
|
case RsServiceType::GXS_TRANS: service_name = tr("GxsMail"); service_type = RetroShareLink::TYPE_MESSAGE ; break ;
|
||||||
|
#ifdef TODO
|
||||||
|
// We need a RS link for circles if we want to do that.
|
||||||
|
//
|
||||||
|
case RsServiceType::GXSCIRCLE: service_name = tr("GxsCircles"); service_type = RetroShareLink::TYPE_CIRCLES; break ;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
service_name = tr("Unknown (service=")+QString::number((int)u.mServiceId,16)+")"; service_type = RetroShareLink::TYPE_UNKNOWN ;
|
service_name = tr("Unknown (service=")+QString::number((int)u.mServiceId,16)+")"; service_type = RetroShareLink::TYPE_UNKNOWN ;
|
||||||
}
|
}
|
||||||
@ -1886,9 +1891,17 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
return tr("Group author for group %1 in service %2").arg(QString::fromStdString(u.mGrpId.toStdString())).arg(service_name);
|
return tr("Group author for group %1 in service %2").arg(QString::fromStdString(u.mGrpId.toStdString())).arg(service_name);
|
||||||
break ;
|
break ;
|
||||||
case RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION:
|
case RsIdentityUsage::MESSAGE_AUTHOR_SIGNATURE_VALIDATION:
|
||||||
case RsIdentityUsage::MESSAGE_AUTHOR_KEEP_ALIVE: // Identities are stamped regularly by crawlign the set of messages for all groups. That helps keepign the useful identities in hand.
|
case RsIdentityUsage::MESSAGE_AUTHOR_KEEP_ALIVE: // Identities are stamped regularly by crawling the set of messages for all groups. That helps keepign the useful identities in hand.
|
||||||
{
|
{
|
||||||
RetroShareLink l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mMsgId,tr("Message/vote/comment"));
|
RetroShareLink l;
|
||||||
|
|
||||||
|
if(service_type == RetroShareLink::TYPE_CHANNEL && !u.mThreadId.isNull())
|
||||||
|
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mThreadId,tr("vote/comment"));
|
||||||
|
else if(service_type == RetroShareLink::TYPE_POSTED && !u.mThreadId.isNull())
|
||||||
|
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mThreadId,tr("vote"));
|
||||||
|
else
|
||||||
|
l = RetroShareLink::createGxsMessageLink(service_type,u.mGrpId,u.mMsgId,tr("Message"));
|
||||||
|
|
||||||
return tr("%1 in %2 service").arg(l.toHtml()).arg(service_name) ;
|
return tr("%1 in %2 service").arg(l.toHtml()).arg(service_name) ;
|
||||||
}
|
}
|
||||||
case RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION: // Chat lobby msgs are signed, so each time one comes, or a chat lobby event comes, a signature verificaiton happens.
|
case RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION: // Chat lobby msgs are signed, so each time one comes, or a chat lobby event comes, a signature verificaiton happens.
|
||||||
@ -1925,11 +1938,18 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
}
|
}
|
||||||
case RsIdentityUsage::IDENTITY_GENERIC_SIGNATURE_CREATION: // Any signature made by that identity
|
case RsIdentityUsage::IDENTITY_GENERIC_SIGNATURE_CREATION: // Any signature made by that identity
|
||||||
{
|
{
|
||||||
return tr("Generic signature.");
|
return tr("Generic signature creation (e.g. chat room message, global router,...).");
|
||||||
}
|
}
|
||||||
case RsIdentityUsage::IDENTITY_GENERIC_ENCRYPTION: return tr("Generic encryption.");
|
case RsIdentityUsage::IDENTITY_GENERIC_ENCRYPTION: return tr("Generic encryption.");
|
||||||
case RsIdentityUsage::IDENTITY_GENERIC_DECRYPTION: return tr("Generic decryption.");
|
case RsIdentityUsage::IDENTITY_GENERIC_DECRYPTION: return tr("Generic decryption.");
|
||||||
case RsIdentityUsage::CIRCLE_MEMBERSHIP_CHECK: return tr("Membership verification in circle %1.").arg(QString::fromStdString(u.mGrpId.toStdString()));
|
case RsIdentityUsage::CIRCLE_MEMBERSHIP_CHECK:
|
||||||
|
{
|
||||||
|
RsGxsCircleDetails det;
|
||||||
|
if(rsGxsCircles->getCircleDetails(RsGxsCircleId(u.mGrpId),det))
|
||||||
|
return tr("Membership verification in circle \"%1\" (%2).").arg(QString::fromUtf8(det.mCircleName.c_str())).arg(QString::fromStdString(u.mGrpId.toStdString()));
|
||||||
|
else
|
||||||
|
return tr("Membership verification in circle (ID=%1).").arg(QString::fromStdString(u.mGrpId.toStdString()));
|
||||||
|
}
|
||||||
|
|
||||||
#warning TODO! csoler 2017-01-03: Add the different strings and translations here.
|
#warning TODO! csoler 2017-01-03: Add the different strings and translations here.
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user