attempt to add SSL-only friends in FriendList - does not work yet

This commit is contained in:
csoler 2019-06-20 23:09:40 +02:00
parent 6114d97c36
commit e132ce7072
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 30 additions and 2 deletions

View File

@ -295,7 +295,18 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d)
/* get from gpg (first), to fill in the sign and trust details */ /* get from gpg (first), to fill in the sign and trust details */
/* don't return now, we've got fill in the ssl and connection info */ /* don't return now, we've got fill in the ssl and connection info */
getGPGDetails(ps.gpg_id, d);
if(!getGPGDetails(ps.gpg_id, d))
{
if(!ps.skip_pgp_signature_validation)
return false;
d.gpg_id = ps.gpg_id ;
d.skip_signature_validation = true;
}
else
d.skip_signature_validation = false;
d.isOnlyGPGdetail = false; d.isOnlyGPGdetail = false;
//get the ssl details //get the ssl details

View File

@ -592,7 +592,8 @@ void FriendList::insertPeers()
std::list<RsPgpId>::iterator gpgIt; std::list<RsPgpId>::iterator gpgIt;
rsPeers->getGPGAcceptedList(gpgFriends); rsPeers->getGPGAcceptedList(gpgFriends);
//add own gpg id, if we have more than on node (ssl client) // add own gpg id, if we have more than on node (ssl client)
std::list<RsPeerId> ownSslContacts; std::list<RsPeerId> ownSslContacts;
RsPgpId ownId = rsPeers->getGPGOwnId(); RsPgpId ownId = rsPeers->getGPGOwnId();
rsPeers->getAssociatedSSLIds(ownId, ownSslContacts); rsPeers->getAssociatedSSLIds(ownId, ownSslContacts);
@ -600,6 +601,22 @@ void FriendList::insertPeers()
gpgFriends.push_back(ownId); gpgFriends.push_back(ownId);
} }
// Also add SSL peers which PGP key is not available yet.
std::list<RsPeerId> ssl_friends ;
rsPeers->getFriendList(ssl_friends);
std::cerr << "List of accepted ssl peers: " << std::endl;
for(auto it(ssl_friends.begin());it!=ssl_friends.end();++it)
{
RsPeerDetails pd;
if(rsPeers->getPeerDetails(*it,pd) && pd.skip_signature_validation)
{
std::cerr << " adding " << *it << " - " << pd.gpg_id << std::endl;
gpgFriends.push_back(pd.gpg_id);
}
}
/* get a link to the table */ /* get a link to the table */
QTreeWidget *peerTreeWidget = ui->peerTreeWidget; QTreeWidget *peerTreeWidget = ui->peerTreeWidget;