mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 08:07:31 -04:00
Reviewed and corrected authenPolicies.
Made authenPolicies + Identity mandatory for all services. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6279 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c9a8c0e4ec
commit
80bf2f7a39
14 changed files with 109 additions and 92 deletions
|
@ -124,7 +124,7 @@ RsIdentity *rsIdentity = NULL;
|
|||
/********************************************************************************/
|
||||
|
||||
p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *nes)
|
||||
: RsGxsIdExchange(gds, nes, new RsGxsIdSerialiser(), RS_SERVICE_GXSV1_TYPE_GXSID),
|
||||
: RsGxsIdExchange(gds, nes, new RsGxsIdSerialiser(), RS_SERVICE_GXSV1_TYPE_GXSID, idAuthenPolicy()),
|
||||
RsIdentity(this), GxsTokenQueue(this), RsTickEvent(), mIdMtx("p3IdService"),
|
||||
mPublicKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPublicKeyCache"),
|
||||
mPrivateKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPrivateKeyCache")
|
||||
|
@ -149,6 +149,24 @@ p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
|||
}
|
||||
|
||||
|
||||
uint32_t p3IdService::idAuthenPolicy()
|
||||
{
|
||||
uint32_t policy = 0;
|
||||
uint8_t flag = 0;
|
||||
|
||||
// Messages are send reputations. normally not by ID holder - so need signatures.
|
||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||
|
||||
// No ID required.
|
||||
flag = 0;
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||
|
||||
return policy;
|
||||
}
|
||||
|
||||
|
||||
void p3IdService::service_tick()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue