fixed exchange of PGP keys in binary format and update of PGP signature flags on short invites when the key is received

This commit is contained in:
csoler 2019-09-14 15:33:43 +02:00
parent b0c7f8f0ca
commit a20ec1a885
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
13 changed files with 274 additions and 96 deletions

View file

@ -1526,12 +1526,25 @@ bool p3Peers::loadCertificateFromString(
}
RsPgpId gpgid;
bool res = AuthGPG::getAuthGPG()->LoadCertificateFromString(
crt->armouredPGPKey(), gpgid, error_string );
bool res = AuthGPG::getAuthGPG()->LoadCertificateFromString( crt->armouredPGPKey(), gpgid, error_string );
gpg_id = gpgid;
ssl_id = crt->sslid();
// now get all friends who declare this key ID to be the one needed to check connections, and clear their "skip_pgp_signature_validation" flag
if(res)
mPeerMgr->notifyPgpKeyReceived(gpgid);
return res;
}
bool p3Peers::loadPgpKeyFromBinaryData( const unsigned char *bin_key_data,uint32_t bin_key_len, RsPgpId& gpg_id, std::string& error_string )
{
bool res = AuthGPG::getAuthGPG()->LoadPGPKeyFromBinaryData( bin_key_data,bin_key_len, gpg_id, error_string );
if(res)
mPeerMgr->notifyPgpKeyReceived(gpg_id);
return res;
}

View file

@ -157,6 +157,7 @@ public:
virtual bool hasExportMinimal();
virtual bool loadCertificateFromString(const std::string& cert, RsPeerId& ssl_id,RsPgpId& pgp_id, std::string& error_string);
virtual bool loadPgpKeyFromBinaryData( const unsigned char *bin_key_data,uint32_t bin_key_len, RsPgpId& gpg_id, std::string& error_string );
virtual bool loadDetailsFromStringCert(const std::string &cert, RsPeerDetails &pd, uint32_t& error_code);
virtual bool cleanCertificate(const std::string &certstr, std::string &cleanCert, bool &is_short_format, uint32_t& error_code) override;