]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/hmac.cpp
Add <oper:autologin> to allow SSL fingerprint-based automatic oper login
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / hmac.cpp
index e1b20520a172f4567cbfc8843318ca69b89fe9e3..52128b17b6a43652c0d212ac5c9e702ce679a6d0 100644 (file)
@@ -96,36 +96,6 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string
        return password;
 }
 
-std::string TreeSocket::RandString(unsigned int ilength)
-{
-       char* randombuf = new char[ilength+1];
-       std::string out;
-#ifndef WINDOWS
-       int f = open("/dev/urandom", O_RDONLY, 0);
-
-       if (f >= 0)
-       {
-               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);
-       }
-       else
-#endif
-       {
-               for (unsigned int i = 0; i < ilength; i++)
-                       randombuf[i] = rand();
-       }
-
-       for (unsigned int i = 0; i < ilength; i++)
-       {
-               char randchar = static_cast<char>(0x3F + (randombuf[i] & 0x3F));
-               out += randchar;
-       }
-
-       delete[] randombuf;
-       return out;
-}
-
 bool TreeSocket::ComparePass(const Link& link, const std::string &theirs)
 {
        capab->auth_fingerprint = !link.Fingerprint.empty();
@@ -134,7 +104,7 @@ bool TreeSocket::ComparePass(const Link& link, const std::string &theirs)
        std::string fp;
        if (GetIOHook())
        {
-               SocketCertificateRequest req(this, Utils->Creator, GetIOHook());
+               SocketCertificateRequest req(this, Utils->Creator);
                if (req.cert)
                {
                        fp = req.cert->GetFingerprint();