mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
added a tab to display the certificate of friends, in peer details
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3439 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1d957f3674
commit
180f833df3
5 changed files with 58 additions and 21 deletions
|
@ -179,6 +179,7 @@ virtual bool getAllowServerIPDetermination() = 0 ;
|
|||
virtual bool getAllowTunnelConnection() = 0 ;
|
||||
|
||||
/* Auth Stuff */
|
||||
virtual std::string GetRetroshareInvite(const std::string& ssl_id) = 0;
|
||||
virtual std::string GetRetroshareInvite() = 0;
|
||||
|
||||
virtual bool loadCertificateFromFile(std::string fname, std::string &ssl_id, std::string &gpg_id) = 0;
|
||||
|
|
|
@ -805,30 +805,42 @@ p3Peers::setVisState(std::string id, uint32_t extVisState)
|
|||
/* Auth Stuff */
|
||||
std::string
|
||||
p3Peers::GetRetroshareInvite()
|
||||
{
|
||||
return GetRetroshareInvite(getOwnId());
|
||||
}
|
||||
|
||||
std::string
|
||||
p3Peers::GetRetroshareInvite(const std::string& ssl_id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::GetRetroshareInvite()" << std::endl;
|
||||
#endif
|
||||
|
||||
std::string invite = AuthGPG::getAuthGPG()->SaveCertificateToString(AuthGPG::getAuthGPG()->getGPGOwnId());
|
||||
|
||||
//add the sslid, location, ip local and external address after the signature
|
||||
RsPeerDetails ownDetail;
|
||||
if (getPeerDetails(rsPeers->getOwnId(), ownDetail)) {
|
||||
invite += CERT_SSL_ID + ownDetail.id + ";";
|
||||
invite += CERT_LOCATION + ownDetail.location + ";\n";
|
||||
invite += CERT_LOCAL_IP + ownDetail.localAddr + ":";
|
||||
std::ostringstream out;
|
||||
out << ownDetail.localPort;
|
||||
invite += out.str() + ";";
|
||||
invite += CERT_EXT_IP + ownDetail.extAddr + ":";
|
||||
std::ostringstream out2;
|
||||
out2 << ownDetail.extPort;
|
||||
invite += out2.str() + ";";
|
||||
if (!ownDetail.dyndns.empty()) {
|
||||
invite += "\n" + CERT_DYNDNS + ownDetail.dyndns + ";";
|
||||
}
|
||||
}
|
||||
RsPeerDetails Detail;
|
||||
std::string invite ;
|
||||
|
||||
if (getPeerDetails(ssl_id, Detail))
|
||||
{
|
||||
invite = AuthGPG::getAuthGPG()->SaveCertificateToString(Detail.gpg_id);
|
||||
|
||||
if(!Detail.isOnlyGPGdetail)
|
||||
{
|
||||
invite += CERT_SSL_ID + Detail.id + ";";
|
||||
invite += CERT_LOCATION + Detail.location + ";\n";
|
||||
invite += CERT_LOCAL_IP + Detail.localAddr + ":";
|
||||
std::ostringstream out;
|
||||
out << Detail.localPort;
|
||||
invite += out.str() + ";";
|
||||
invite += CERT_EXT_IP + Detail.extAddr + ":";
|
||||
std::ostringstream out2;
|
||||
out2 << Detail.extPort;
|
||||
invite += out2.str() + ";";
|
||||
if (!Detail.dyndns.empty()) {
|
||||
invite += "\n" + CERT_DYNDNS + Detail.dyndns + ";";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::GetRetroshareInvite() returns : \n" << invite << std::endl;
|
||||
|
|
|
@ -87,6 +87,9 @@ virtual bool getAllowServerIPDetermination() ;
|
|||
virtual bool getAllowTunnelConnection() ;
|
||||
|
||||
/* Auth Stuff */
|
||||
// Get the invitation (GPG cert + local/ext address + SSL id for the given peer)
|
||||
virtual std::string GetRetroshareInvite(const std::string& ssl_id);
|
||||
// same but for own id
|
||||
virtual std::string GetRetroshareInvite();
|
||||
|
||||
virtual bool loadCertificateFromFile(std::string fname, std::string &id, std::string &gpg_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue