mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05:00
fixed inconsistency using getKey() and getPrivateKey() supposing it returns a boolean. It should return a boolean anyway.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7709 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
03cee1b998
commit
ab038bf69e
@ -840,7 +840,7 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, RsTlvSecu
|
||||
{
|
||||
|
||||
RsTlvSecurityKey authorKey;
|
||||
bool auth_key_fetched = mGixs->getKey(metaData.mAuthorId, authorKey) == 1;
|
||||
bool auth_key_fetched = mGixs->getKey(metaData.mAuthorId, authorKey) ;
|
||||
|
||||
if (auth_key_fetched)
|
||||
{
|
||||
@ -912,7 +912,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp)
|
||||
{
|
||||
|
||||
RsTlvSecurityKey authorKey;
|
||||
bool auth_key_fetched = mGixs->getKey(metaData.mAuthorId, authorKey) == 1;
|
||||
bool auth_key_fetched = mGixs->getKey(metaData.mAuthorId, authorKey) ;
|
||||
|
||||
if (auth_key_fetched)
|
||||
{
|
||||
|
@ -155,8 +155,8 @@ public:
|
||||
* @return a pointer to a valid profile if successful, otherwise NULL
|
||||
*
|
||||
*/
|
||||
virtual int getKey(const RsGxsId &id, RsTlvSecurityKey &key) = 0;
|
||||
virtual int getPrivateKey(const RsGxsId &id, RsTlvSecurityKey &key) = 0; // For signing outgoing messages.
|
||||
virtual bool getKey(const RsGxsId &id, RsTlvSecurityKey &key) = 0;
|
||||
virtual bool getPrivateKey(const RsGxsId &id, RsTlvSecurityKey &key) = 0; // For signing outgoing messages.
|
||||
|
||||
|
||||
};
|
||||
|
@ -476,16 +476,16 @@ bool p3IdService::isPendingNetworkRequest(const RsGxsId& gxsId) const
|
||||
return false;
|
||||
}
|
||||
|
||||
int p3IdService::getKey(const RsGxsId &id, RsTlvSecurityKey &key)
|
||||
bool p3IdService::getKey(const RsGxsId &id, RsTlvSecurityKey &key)
|
||||
{
|
||||
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
||||
RsGxsIdCache data;
|
||||
if (mPublicKeyCache.fetch(id, data))
|
||||
{
|
||||
key = data.pubkey;
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3IdService::requestPrivateKey(const RsGxsId &id)
|
||||
@ -495,16 +495,16 @@ bool p3IdService::requestPrivateKey(const RsGxsId &id)
|
||||
return cache_request_load(id);
|
||||
}
|
||||
|
||||
int p3IdService::getPrivateKey(const RsGxsId &id, RsTlvSecurityKey &key)
|
||||
bool p3IdService::getPrivateKey(const RsGxsId &id, RsTlvSecurityKey &key)
|
||||
{
|
||||
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
||||
RsGxsIdCache data;
|
||||
if (mPrivateKeyCache.fetch(id, data))
|
||||
{
|
||||
key = data.pubkey;
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -283,11 +283,11 @@ virtual bool getRecognTagRequest(const RsGxsId &id, const std::string &comment,
|
||||
*/
|
||||
virtual bool haveKey(const RsGxsId &id);
|
||||
virtual bool requestKey(const RsGxsId &id, const std::list<PeerId> &peers);
|
||||
virtual int getKey(const RsGxsId &id, RsTlvSecurityKey &key);
|
||||
virtual bool getKey(const RsGxsId &id, RsTlvSecurityKey &key);
|
||||
|
||||
virtual bool havePrivateKey(const RsGxsId &id);
|
||||
virtual bool requestPrivateKey(const RsGxsId &id);
|
||||
virtual int getPrivateKey(const RsGxsId &id, RsTlvSecurityKey &key);
|
||||
virtual bool getPrivateKey(const RsGxsId &id, RsTlvSecurityKey &key);
|
||||
|
||||
/**************** RsGixsReputation Implementation
|
||||
* Notes:
|
||||
|
@ -1739,7 +1739,7 @@ bool p3MsgService::createDistantMessage(const RsGxsId& destination_gxs_id,const
|
||||
#ifdef DEBUG_DISTANT_MSG
|
||||
std::cerr << " Getting key material..." << std::endl;
|
||||
#endif
|
||||
if(mIdService->getPrivateKey(source_gxs_id,signature_key) < 0)
|
||||
if(!mIdService->getPrivateKey(source_gxs_id,signature_key))
|
||||
throw std::runtime_error("Cannot get signature key for id " + source_gxs_id.toStdString()) ;
|
||||
|
||||
#ifdef DEBUG_DISTANT_MSG
|
||||
|
Loading…
Reference in New Issue
Block a user