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:
csoler 2014-01-15 20:15:48 +00:00
parent f7cbacdcb1
commit ba927adf1c

View File

@ -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)