bug fixing

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-IdCleaning@7143 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-02-22 20:26:12 +00:00
parent 00196c58b8
commit 3f4c1a1baf
3 changed files with 15 additions and 13 deletions

View file

@ -547,15 +547,17 @@ bool p3Peers::gpgSignData(const void *data, const uint32_t len, unsigned char
return AuthGPG::getAuthGPG()->SignDataBin(data,len,sign,signlen);
}
bool p3Peers::getGPGDetails(const PGPIdType &id, RsPeerDetails &d)
bool p3Peers::getGPGDetails(const PGPIdType &pgp_id, RsPeerDetails &d)
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::getPgpDetails() called for id : " << id << std::endl;
std::cerr << "p3Peers::getPgpDetails() called for id : " << pgp_id << std::endl;
#endif
/* get from mAuthMgr */
bool res = AuthGPG::getAuthGPG()->getGPGDetails(id, d);
bool res = AuthGPG::getAuthGPG()->getGPGDetails(pgp_id, d);
d.isOnlyGPGdetail = true ;
d.service_perm_flags = mPeerMgr->servicePermissionFlags(pgp_id) ;
return res ;
}

View file

@ -819,7 +819,7 @@ RsDiscContactItem *RsDiscSerialiser::deserialiseContact(void *data, uint32_t *pk
/* get mandatory parts first */
ok &= item->pgpId.deserialise(data, rssize, offset) ;
ok &= item->pgpId.deserialise(data, rssize, offset) ;
ok &= item->sslId.deserialise(data, rssize, offset) ;
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_LOCATION, item->location);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_VERSION, item->version);

View file

@ -3642,21 +3642,21 @@ void p3ChatService::cleanDistantChatInvites()
DistantChatPeerId p3ChatService::virtualPeerIdFromHash(const TurtleFileHash& hash)
{
if(DistantChatPeerId::SIZE_IN_BYTES < Sha1CheckSum::SIZE_IN_BYTES)
if(DistantChatPeerId::SIZE_IN_BYTES > Sha1CheckSum::SIZE_IN_BYTES)
std::cerr << __PRETTY_FUNCTION__ << ": Serious inconsistency error." << std::endl;
unsigned char tmp[DistantChatPeerId::SIZE_IN_BYTES] ;
memset(tmp,0,DistantChatPeerId::SIZE_IN_BYTES) ;
memcpy(tmp,Sha1CheckSum(hash).toByteArray(),Sha1CheckSum::SIZE_IN_BYTES) ;
return DistantChatPeerId(tmp) ;
return DistantChatPeerId(hash.toByteArray()) ;
}
TurtleFileHash p3ChatService::hashFromVirtualPeerId(const DistantChatPeerId& pid)
{
if(DistantChatPeerId::SIZE_IN_BYTES < Sha1CheckSum::SIZE_IN_BYTES)
if(DistantChatPeerId::SIZE_IN_BYTES > Sha1CheckSum::SIZE_IN_BYTES)
std::cerr << __PRETTY_FUNCTION__ << ": Serious inconsistency error." << std::endl;
return Sha1CheckSum(pid.toByteArray());
unsigned char tmp[Sha1CheckSum::SIZE_IN_BYTES] ;
memset(tmp,0,Sha1CheckSum::SIZE_IN_BYTES) ;
memcpy(tmp,pid.toByteArray(),DistantChatPeerId::SIZE_IN_BYTES) ;
return Sha1CheckSum(tmp);
}
bool p3ChatService::getDistantChatInviteList(std::vector<DistantChatInviteInfo>& invites)
{