mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 09:56:14 -05:00
implement the remove friend for gpg key, and improve the tranfer of ip address from a dummy peer to a normal peer
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2024 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
018b84a1e1
commit
54c7f8b81a
@ -2186,13 +2186,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
|||||||
std::string certId;
|
std::string certId;
|
||||||
getX509id(X509_STORE_CTX_get_current_cert(ctx), certId);
|
getX509id(X509_STORE_CTX_get_current_cert(ctx), certId);
|
||||||
if (!mConnMgr->isFriend(certId)) {
|
if (!mConnMgr->isFriend(certId)) {
|
||||||
//we've got a new ssl id, let's add it as a friend
|
//we've got a new ssl id
|
||||||
mConnMgr->addFriend(certId, getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer));
|
|
||||||
preverify_ok = false;
|
preverify_ok = false;
|
||||||
}
|
}
|
||||||
//set location
|
|
||||||
mConnMgr->setLocation(certId, getX509LocString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->subject));
|
|
||||||
|
|
||||||
|
|
||||||
//is the connection was initiated by us, then it was for a specific peer id wich is stored is in the context
|
//is the connection was initiated by us, then it was for a specific peer id wich is stored is in the context
|
||||||
//check that the peerid in the context is the same as the cert one
|
//check that the peerid in the context is the same as the cert one
|
||||||
@ -2207,12 +2203,20 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
|||||||
//tranfer the ip address to the new peer
|
//tranfer the ip address to the new peer
|
||||||
peerConnectState detail;
|
peerConnectState detail;
|
||||||
if (mConnMgr->getFriendNetStatus(peer_id_in_context, detail)) {
|
if (mConnMgr->getFriendNetStatus(peer_id_in_context, detail)) {
|
||||||
|
mConnMgr->addFriend(certId, getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer));
|
||||||
mConnMgr->setAddressList(certId, detail.getIpAddressList());
|
mConnMgr->setAddressList(certId, detail.getIpAddressList());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context is the same as cert, continung connection.");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context is the same as cert, continung connection.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//just to be sure
|
||||||
|
mConnMgr->addFriend(certId, getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer));
|
||||||
|
|
||||||
|
//set location
|
||||||
|
mConnMgr->setLocation(certId, getX509LocString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->subject));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preverify_ok) {
|
if (preverify_ok) {
|
||||||
|
@ -621,8 +621,13 @@ bool p3Peers::removeFriend(std::string id)
|
|||||||
std::cerr << "p3Peers::removeFriend() " << id;
|
std::cerr << "p3Peers::removeFriend() " << id;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
//will remove if it's a gpg id
|
||||||
|
AuthGPG::getAuthGPG()->setAcceptToConnectGPGCertificate(id, false);
|
||||||
|
|
||||||
|
//will remove if it's a ssl id
|
||||||
|
mConnMgr->removeFriend(id);
|
||||||
|
return true;
|
||||||
|
|
||||||
return mConnMgr->removeFriend(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Network Stuff */
|
/* Network Stuff */
|
||||||
|
@ -257,13 +257,7 @@ void NetworkDialog::deleteCert()
|
|||||||
|
|
||||||
void NetworkDialog::makeFriend()
|
void NetworkDialog::makeFriend()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *wi = getCurrentNeighbour();
|
ConfCertDialog::showTrust(getCurrentNeighbour()->text(4).toStdString());
|
||||||
std::string authId = wi->text(4).toStdString() ;
|
|
||||||
|
|
||||||
rsPeers->signGPGCertificate(authId);
|
|
||||||
rsPeers->addDummyFriend(authId);
|
|
||||||
|
|
||||||
insertConnect() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Shows Peer Information/Auth Dialog */
|
/** Shows Peer Information/Auth Dialog */
|
||||||
|
@ -58,7 +58,15 @@ void ConfCertDialog::show(const std::string& peer_id)
|
|||||||
/* set the Id */
|
/* set the Id */
|
||||||
|
|
||||||
instance()->loadId(peer_id);
|
instance()->loadId(peer_id);
|
||||||
instance()->show();
|
instance()->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfCertDialog::showTrust(const std::string& peer_id)
|
||||||
|
{
|
||||||
|
/* set the Id */
|
||||||
|
|
||||||
|
instance()->loadId(peer_id);
|
||||||
|
instance()->showTrust();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -69,6 +77,18 @@ void
|
|||||||
ConfCertDialog::show()
|
ConfCertDialog::show()
|
||||||
{
|
{
|
||||||
//loadSettings();
|
//loadSettings();
|
||||||
|
ui.stabWidget->setCurrentIndex(0);
|
||||||
|
if(!this->isVisible()) {
|
||||||
|
QDialog::show();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ConfCertDialog::showTrust()
|
||||||
|
{
|
||||||
|
//loadSettings();
|
||||||
|
ui.stabWidget->setCurrentIndex(1);
|
||||||
if(!this->isVisible()) {
|
if(!this->isVisible()) {
|
||||||
QDialog::show();
|
QDialog::show();
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ class ConfCertDialog : public QDialog
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static void show(const std::string& id) ;
|
static void show(const std::string& id) ;
|
||||||
|
static void showTrust(const std::string& id) ;
|
||||||
|
|
||||||
static ConfCertDialog *instance() ;
|
static ConfCertDialog *instance() ;
|
||||||
signals:
|
signals:
|
||||||
@ -58,6 +59,7 @@ void setInfo(std::string name,
|
|||||||
private slots:
|
private slots:
|
||||||
/** Overloaded QWidget.show */
|
/** Overloaded QWidget.show */
|
||||||
void show();
|
void show();
|
||||||
|
void showTrust();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="stabWidget">
|
<widget class="QTabWidget" name="stabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
|
Loading…
Reference in New Issue
Block a user