mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-27 23:57:38 -04:00
Added flag to disable dbase reset, and disable dummy data creation.
This also switches to alternative test data path - to ensure it will be empty. Fixed bug in p3idservice related to dummy id creation. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6114 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7867063734
commit
81307de7c9
8 changed files with 79 additions and 16 deletions
|
@ -38,11 +38,11 @@
|
|||
|
||||
/****
|
||||
* #define ID_DEBUG 1
|
||||
* #define GXSID_GEN_DUMMY_DATA 1
|
||||
****/
|
||||
|
||||
#define GXSID_GEN_DUMMY_DATA 1
|
||||
|
||||
|
||||
|
||||
#define ID_REQUEST_LIST 0x0001
|
||||
#define ID_REQUEST_IDENTITY 0x0002
|
||||
#define ID_REQUEST_REPUTATION 0x0003
|
||||
|
@ -129,13 +129,17 @@ p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
|||
mBgSchedule_Active = false;
|
||||
|
||||
// Kick off Cache Testing, + Others.
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_CACHETEST, CACHETEST_PERIOD);
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_PGPHASH, PGPHASH_PERIOD);
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_REPUTATION, REPUTATION_PERIOD);
|
||||
RsTickEvent::schedule_now(GXSID_EVENT_CACHEOWNIDS);
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_CACHETEST, CACHETEST_PERIOD);
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
RsTickEvent::schedule_now(GXSID_EVENT_DUMMYDATA);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -1156,6 +1160,9 @@ static void calcPGPHash(const RsGxsId &id, const PGPFingerprintType &pgp, GxsIdP
|
|||
// Must Use meta.
|
||||
void p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet)
|
||||
{
|
||||
std::cerr << "p3IdService::service_CreateGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsGxsIdGroupItem *item = dynamic_cast<RsGxsIdGroupItem *>(grpItem);
|
||||
if (!item)
|
||||
{
|
||||
|
@ -1219,29 +1226,25 @@ void p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std::cerr << "p3IdService::service_CreateGroup() for : " << item->group.mMeta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "p3IdService::service_CreateGroup() Alt GroupId : " << item->meta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
if ((item->group.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID) && (item->group.mMeta.mAuthorId != ""))
|
||||
#else
|
||||
if (item->group.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
#endif
|
||||
{
|
||||
/* create the hash */
|
||||
GxsIdPgpHash hash;
|
||||
|
||||
/* */
|
||||
PGPFingerprintType ownFinger;
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
PGPIdType ownId(item->group.mMeta.mAuthorId);
|
||||
#else
|
||||
PGPIdType ownId(AuthGPG::getAuthGPG()->getGPGOwnId());
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
if (item->group.mMeta.mAuthorId != "")
|
||||
{
|
||||
ownId = PGPIdType(item->group.mMeta.mAuthorId);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!AuthGPG::getAuthGPG()->getKeyFingerprint(ownId,ownFinger))
|
||||
|
@ -1254,6 +1257,9 @@ void p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet
|
|||
calcPGPHash(item->group.mMeta.mGroupId, ownFinger, hash);
|
||||
item->group.mPgpIdHash = hash.toStdString();
|
||||
|
||||
std::cerr << "p3IdService::service_CreateGroup() Calculated PgpIdHash : " << item->group.mPgpIdHash;
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* do signature */
|
||||
|
||||
#if ENABLE_PGP_SIGNATURES
|
||||
|
@ -1526,6 +1532,17 @@ bool p3IdService::checkId(const RsGxsIdGroup &grp, PGPIdType &pgpId)
|
|||
std::cerr << grp.mMeta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* some sanity checking... make sure hash is the right size */
|
||||
|
||||
std::cerr << "p3IdService::checkId() PgpIdHash is: " << grp.mPgpIdHash;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (grp.mPgpIdHash.length() != SHA_DIGEST_LENGTH * 2)
|
||||
{
|
||||
std::cerr << "ERROR PgpIdHash len:" << grp.mPgpIdHash.length();
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
/* iterate through and check hash */
|
||||
GxsIdPgpHash ans(grp.mPgpIdHash);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue