summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-06 21:17:15 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-06 21:17:15 +0000
commitcb233b72f5d14993dc3fc8fea3dae246c2454c1e (patch)
tree4af248003dbdf55eb9019f380a6ccc6dd18215ec /src
parent2cd299419273914624dcc64afa7928577fe52bb3 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp14
1 files changed, 10 insertions, 4 deletions
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;