mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-27 23:57:38 -04:00
Added PGP GxsId signature creation
group creation operates on a 10 second timeout rather than number of attempts git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6205 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7c0fb5eced
commit
12172e3acc
4 changed files with 194 additions and 132 deletions
|
@ -1231,6 +1231,7 @@ static void calcPGPHash(const RsGxsId &id, const PGPFingerprintType &pgp, GxsIdP
|
|||
// Must Use meta.
|
||||
RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet)
|
||||
{
|
||||
|
||||
#ifdef DEBUG_IDS
|
||||
std::cerr << "p3IdService::service_CreateGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
@ -1304,6 +1305,8 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
std::cerr << std::endl;
|
||||
#endif // DEBUG_IDS
|
||||
|
||||
ServiceCreate_Return createStatus;
|
||||
|
||||
if (item->group.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
{
|
||||
/* create the hash */
|
||||
|
@ -1320,6 +1323,8 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (!AuthGPG::getAuthGPG()->getKeyFingerprint(ownId,ownFinger))
|
||||
{
|
||||
std::cerr << "p3IdService::service_CreateGroup() ERROR Own Finger is stuck";
|
||||
|
@ -1337,6 +1342,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
|
||||
/* do signature */
|
||||
|
||||
|
||||
#if ENABLE_PGP_SIGNATURES
|
||||
#define MAX_SIGN_SIZE 2048
|
||||
uint8_t signarray[MAX_SIGN_SIZE];
|
||||
|
@ -1348,6 +1354,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
/* error */
|
||||
std::cerr << "p3IdService::service_CreateGroup() ERROR Signing stuff";
|
||||
std::cerr << std::endl;
|
||||
createStatus = SERVICE_CREATE_FAIL_TRY_LATER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1357,6 +1364,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
{
|
||||
item->group.mPgpIdSign += signarray[i];
|
||||
}
|
||||
createStatus = SERVICE_CREATE_SUCCESS;
|
||||
}
|
||||
/* done! */
|
||||
#else
|
||||
|
@ -1364,6 +1372,10 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
createStatus = SERVICE_CREATE_SUCCESS;
|
||||
}
|
||||
|
||||
// Enforce no AuthorId.
|
||||
item->meta.mAuthorId = "";
|
||||
|
@ -1374,7 +1386,8 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
// Reload in a little bit.
|
||||
// HACK to get it to work.
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_CACHEOWNIDS, OWNID_RELOAD_DELAY);
|
||||
return SERVICE_CREATE_SUCCESS;
|
||||
|
||||
return createStatus;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue