diff options
| author | 2019-02-05 00:47:30 +0000 | |
|---|---|---|
| committer | 2019-02-05 00:47:30 +0000 | |
| commit | bfa5fb407e13ad4adb5c062021de50ecd760ed95 (patch) | |
| tree | c573269b1a94fd7e7da27c1b90b05fa60916de23 /src/modules/m_sslinfo.cpp | |
| parent | Remove support for the deprecated <power> config tag. (diff) | |
| parent | ModuleManager: use std::flush instead of fflush(stdout). (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
| -rw-r--r-- | src/modules/m_sslinfo.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 2266b6861..7e08c8a3d 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -188,6 +188,11 @@ class ModuleSSLInfo private: CommandSSLInfo cmd; + bool MatchFP(ssl_cert* const cert, const std::string& fp) const + { + return irc::spacesepstream(fp).Contains(cert->GetFingerprint()); + } + public: ModuleSSLInfo() : WebIRC::EventListener(this) @@ -231,7 +236,7 @@ class ModuleSSLInfo } std::string fingerprint; - if (ifo->oper_block->readString("fingerprint", fingerprint) && (!cert || cert->GetFingerprint() != fingerprint)) + if (ifo->oper_block->readString("fingerprint", fingerprint) && (!cert || !MatchFP(cert, fingerprint))) { user->WriteNumeric(ERR_NOOPERHOST, "This oper login requires a matching SSL certificate fingerprint."); user->CommandFloodPenalty += 10000; @@ -251,7 +256,7 @@ class ModuleSSLInfo return; const SSLIOHook* const ssliohook = SSLIOHook::IsSSL(&localuser->eh); - if (!ssliohook) + if (!ssliohook || cmd.sslapi.nosslext.get(localuser)) return; ssl_cert* const cert = ssliohook->GetCertificate(); @@ -275,7 +280,7 @@ class ModuleSSLInfo { OperInfo* ifo = i->second; std::string fp = ifo->oper_block->getString("fingerprint"); - if (fp == cert->fingerprint && ifo->oper_block->getBool("autologin")) + if (MatchFP(cert, fp) && ifo->oper_block->getBool("autologin")) user->Oper(ifo); } } |
