isKnownId return true also for own identities

This commit is contained in:
Gioacchino Mazzurco 2019-10-01 13:50:43 +02:00
parent ae0412c087
commit c9b5b8bbd4
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
2 changed files with 10 additions and 6 deletions

View File

@ -810,9 +810,15 @@ bool p3IdService::getOwnIds(std::list<RsGxsId> &ownIds,bool signed_only)
return true ; return true ;
} }
bool p3IdService::isKnownId(const RsGxsId& id)
{
RS_STACK_MUTEX(mIdMtx);
return mKeyCache.is_cached(id) ||
std::find(mOwnIds.begin(), mOwnIds.end(),id) != mOwnIds.end();
}
bool p3IdService::identityToBase64( const RsGxsId& id, bool p3IdService::identityToBase64( const RsGxsId& id,
std::string& base64String ) std::string& base64String )
{ return serialiseIdentityToMemory(id, base64String); } { return serialiseIdentityToMemory(id, base64String); }
bool p3IdService::serialiseIdentityToMemory( const RsGxsId& id, bool p3IdService::serialiseIdentityToMemory( const RsGxsId& id,

View File

@ -293,12 +293,10 @@ public:
/// @see RsIdentity /// @see RsIdentity
bool getOwnPseudonimousIds(std::vector<RsGxsId>& ids) override; bool getOwnPseudonimousIds(std::vector<RsGxsId>& ids) override;
virtual bool getOwnIds(std::list<RsGxsId> &ownIds, bool signed_only = false); bool getOwnIds(
std::list<RsGxsId> &ownIds, bool signed_only = false ) override;
//virtual bool getPublicKey(const RsGxsId &id, RsTlvSecurityKey &key) ; bool isKnownId(const RsGxsId& id) override;
//virtual void networkRequestPublicKey(const RsGxsId& key_id,const std::list<RsPeerId>& peer_ids) ;
inline bool isKnownId(const RsGxsId& id) override { return haveKey(id); }
bool isOwnId(const RsGxsId& key_id) override; bool isOwnId(const RsGxsId& key_id) override;