From cb233b72f5d14993dc3fc8fea3dae246c2454c1e Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 6 Feb 2007 21:17:15 +0000 Subject: Extra safety checks while exchanging certs, just in case git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6531 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index cb88fdf70..b88cf0c03 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -303,11 +303,17 @@ class ModuleSSLGnuTLS : public Module } else if (strcmp("IS_ATTACH", request->GetId()) == 0) { - issl_session* session = &sessions[ISR->Sock->GetFd()]; - if (session) + if (ISR->Sock->GetFd() > -1) { - VerifyCertificate(session, (InspSocket*)ISR->Sock); - return "OK"; + issl_session* session = &sessions[ISR->Sock->GetFd()]; + if (session) + { + if ((Extensible*)ServerInstance->FindDescriptor(ISR->Sock->GetFd()) == (Extensible*)(ISR->Sock)) + { + VerifyCertificate(session, (InspSocket*)ISR->Sock); + return "OK"; + } + } } } return NULL; -- cgit v1.2.3