diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-06 21:17:15 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-06 21:17:15 +0000 |
commit | cb233b72f5d14993dc3fc8fea3dae246c2454c1e (patch) | |
tree | 4af248003dbdf55eb9019f380a6ccc6dd18215ec | |
parent | 2cd299419273914624dcc64afa7928577fe52bb3 (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
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 14 |
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; |