summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ssl_gnutls.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-06-07 02:57:54 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-06-07 02:57:54 +0000
commit885d37630ef4b5b69c26c6eb3fc97e9cd2e35eae (patch)
tree51624b6cb5e5bb06531bc127bb1d0cd465502641 /src/modules/extra/m_ssl_gnutls.cpp
parent193acaa853fe0f3bbf4cd8d8bccbe480088d76cc (diff)
Allow SSL fingerprint-based server authentication
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11404 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_ssl_gnutls.cpp')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index c0cd05df5..1db4a84ca 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -402,6 +402,20 @@ class ModuleSSLGnuTLS : public Module
}
}
}
+ else if (strcmp("GET_FP", request->GetId()) == 0)
+ {
+ if (ISR->Sock->GetFd() > -1)
+ {
+ issl_session* session = &sessions[ISR->Sock->GetFd()];
+ if (session->sess)
+ {
+ Extensible* ext = ISR->Sock;
+ ssl_cert* certinfo;
+ if (ext->GetExt("ssl_cert",certinfo))
+ return certinfo->GetFingerprint().c_str();
+ }
+ }
+ }
return NULL;
}