diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-06-07 02:57:54 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-06-07 02:57:54 +0000 |
commit | 885d37630ef4b5b69c26c6eb3fc97e9cd2e35eae (patch) | |
tree | 51624b6cb5e5bb06531bc127bb1d0cd465502641 /src/modules/extra | |
parent | 193acaa853fe0f3bbf4cd8d8bccbe480088d76cc (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')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 14 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 14 |
2 files changed, 28 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; } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 53a0e241f..f468e3c53 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -407,6 +407,20 @@ class ModuleSSLOpenSSL : public Module return "OK"; } } + 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; } |