From d1baa3821ab99200da52bdc54f7750a5a83876ad Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 19 Feb 2021 21:09:17 +0100 Subject: [PATCH] auto-validate own signed identities --- libretroshare/src/services/p3idservice.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index e32d6788d..d34f406a6 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -954,10 +954,7 @@ bool p3IdService::deserialiseIdentityFromMemory(const std::string& radix_string, return true; } -bool p3IdService::createIdentity( - RsGxsId& id, - const std::string& name, const RsGxsImage& avatar, - bool pseudonimous, const std::string& pgpPassword) +bool p3IdService::createIdentity( RsGxsId& id, const std::string& name, const RsGxsImage& avatar, bool pseudonimous, const std::string& pgpPassword) { bool ret = true; RsIdentityParameters params; @@ -1062,6 +1059,20 @@ bool p3IdService::createIdentity(uint32_t& token, RsIdentityParameters ¶ms) else id.mMeta.mGroupFlags |= GXS_SERV::FLAG_PRIVACY_PUBLIC; + // Anticipate signature validation, since we're creating the signature ourselves. + + SSGxsIdGroup ssdata; + ssdata.pgp.validatedSignature = params.isPgpLinked; + + if(params.isPgpLinked) + { + ssdata.pgp.pgpId = AuthGPG::getAuthGPG()->getGPGOwnId(); + ssdata.pgp.lastCheckTs = time(nullptr); + } + + /* save string */ + id.mMeta.mServiceString = ssdata.save(); + createGroup(token, id); return true;