mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed small error in pgphandler, potentially adding empty certs in database
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7015 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f7cbacdcb1
commit
ba927adf1c
@ -913,6 +913,9 @@ bool PGPHandler::importGPGKeyPair(const std::string& filename,PGPIdType& importe
|
||||
//
|
||||
ops_keyring_free(tmp_keyring) ;
|
||||
|
||||
// write public key to disk
|
||||
syncDatabase();
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
@ -1422,6 +1425,14 @@ void PGPHandler::updateOwnSignatureFlag(const PGPIdType& own_id)
|
||||
RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures.
|
||||
|
||||
std::string own_id_str = own_id.toStdString();
|
||||
|
||||
if(_public_keyring_map.find(own_id_str)==_public_keyring_map.end())
|
||||
{
|
||||
std::cerr << __func__ << ": key with id=" << own_id_str << " not in keyring." << std::endl;
|
||||
// return now, because the following operation would add an entry to _public_keyring_map
|
||||
return;
|
||||
}
|
||||
|
||||
PGPCertificateInfo& own_cert(_public_keyring_map[ own_id_str ]) ;
|
||||
|
||||
for(std::map<std::string,PGPCertificateInfo>::iterator it=_public_keyring_map.begin();it!=_public_keyring_map.end();++it)
|
||||
|
Loading…
Reference in New Issue
Block a user