]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/hmac.cpp
Merge remote/local MODULES output
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / hmac.cpp
index 348a453a6bdbd7eb910839f2b14cdade4a945e24..b7cddc47ac750ce23ef349f043a830a051202a0a 100644 (file)
@@ -102,7 +102,7 @@ std::string TreeSocket::RandString(unsigned int ilength)
 
        if (f >= 0)
        {
-               if (read(f, randombuf, ilength) < ilength)
+               if (read(f, randombuf, ilength) < (int)ilength)
                        ServerInstance->Logs->Log("m_spanningtree", DEFAULT, "Entropy source has gone predictable (did not return enough data)");
                close(f);
        }
@@ -129,9 +129,9 @@ bool TreeSocket::ComparePass(const Link& link, const std::string &theirs)
        this->auth_challenge = !ourchallenge.empty() && !theirchallenge.empty();
 
        std::string fp;
-       if (GetHook())
+       if (GetIOHook())
        {
-               BufferedSocketCertificateRequest req(this, Utils->Creator, GetHook());
+               BufferedSocketCertificateRequest req(this, Utils->Creator, GetIOHook());
                req.Send();
                if (req.cert)
                {
@@ -144,7 +144,11 @@ bool TreeSocket::ComparePass(const Link& link, const std::string &theirs)
        {
                /* Require fingerprint to exist and match */
                if (link.Fingerprint != fp)
+               {
+                       ServerInstance->SNO->WriteToSnoMask('l',"Invalid SSL fingerprint on link %s: need '%s' got '%s'", 
+                               link.Name.c_str(), link.Fingerprint.c_str(), fp.c_str());
                        return false;
+               }
        }
 
        if (auth_challenge)