From 8d002a156640c99167c7f0b47f2b2f7a2a39bee6 Mon Sep 17 00:00:00 2001 From: joss17 Date: Thu, 14 Jan 2010 01:33:36 +0000 Subject: [PATCH] add a ssl check that the peer isn't already connected git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2036 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/authssl.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index c7cfd0469..dc16698fb 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -2217,6 +2217,15 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx) //set location mConnMgr->setLocation(certId, getX509LocString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->subject)); + //Cgheck if peer isn't already connected + peerConnectState detail; + if (mConnMgr->getFriendNetStatus(certId, detail)) { + if (detail.state & RS_PEER_CONNECTED && detail.connecttype & RS_NET_CONN_TUNNEL) { + fprintf(stderr, "AuthSSL::VerifyX509Callback this peer is already connected, refuse a new connection."); + } + } + + } if (preverify_ok) {