Permalink
Browse files

Updated code for PHP 7. Latest toolkits.

  • Loading branch information...
cubiclesoft committed Mar 17, 2017
1 parent 6c6b24f commit 7697d86466556b276aa929c62cd33f7a03b03162
Showing with 16,080 additions and 24,235 deletions.
  1. +5 −6 admin.php
  2. +3 −4 endpoint.php
  3. +1 −2 index.php
  4. +2 −2 install.php
  5. +3 −3 providers/sso_login/index.php
  6. +3 −3 providers/sso_login/modules/sso_antiphish.php
  7. +4 −4 providers/sso_login/modules/sso_remember_me.php
  8. +9,856 −1,223 support/Net/DNS2.php
  9. +0 −254 support/Net/DNS2/BitMap.php
  10. +0 −305 support/Net/DNS2/Cache.php
  11. +0 −242 support/Net/DNS2/Cache/File.php
  12. +0 −305 support/Net/DNS2/Cache/Shm.php
  13. +0 −132 support/Net/DNS2/Exception.php
  14. +0 −282 support/Net/DNS2/Header.php
  15. +0 −545 support/Net/DNS2/Lookups.php
  16. +0 −449 support/Net/DNS2/Packet.php
  17. +0 −221 support/Net/DNS2/Packet/Request.php
  18. +0 −189 support/Net/DNS2/Packet/Response.php
  19. +0 −422 support/Net/DNS2/PrivateKey.php
  20. +0 −244 support/Net/DNS2/Question.php
  21. +0 −641 support/Net/DNS2/RR.php
  22. +0 −156 support/Net/DNS2/RR/A.php
  23. +0 −177 support/Net/DNS2/RR/AAAA.php
  24. +0 −174 support/Net/DNS2/RR/AFSDB.php
  25. +0 −129 support/Net/DNS2/RR/ANY.php
  26. +0 −343 support/Net/DNS2/RR/APL.php
  27. +0 −210 support/Net/DNS2/RR/ATMA.php
  28. +0 −179 support/Net/DNS2/RR/CAA.php
  29. +0 −77 support/Net/DNS2/RR/CDS.php
  30. +0 −292 support/Net/DNS2/RR/CERT.php
  31. +0 −153 support/Net/DNS2/RR/CNAME.php
  32. +0 −207 support/Net/DNS2/RR/DHCID.php
  33. +0 −75 support/Net/DNS2/RR/DLV.php
  34. +0 −153 support/Net/DNS2/RR/DNAME.php
  35. +0 −198 support/Net/DNS2/RR/DNSKEY.php
  36. +0 −209 support/Net/DNS2/RR/DS.php
  37. +0 −130 support/Net/DNS2/RR/EID.php
  38. +0 −187 support/Net/DNS2/RR/EUI48.php
  39. +0 −188 support/Net/DNS2/RR/EUI64.php
  40. +0 −175 support/Net/DNS2/RR/HINFO.php
  41. +0 −287 support/Net/DNS2/RR/HIP.php
  42. +0 −386 support/Net/DNS2/RR/IPSECKEY.php
  43. +0 −190 support/Net/DNS2/RR/ISDN.php
  44. +0 −85 support/Net/DNS2/RR/KEY.php
  45. +0 −179 support/Net/DNS2/RR/KX.php
  46. +0 −180 support/Net/DNS2/RR/L32.php
  47. +0 −187 support/Net/DNS2/RR/L64.php
  48. +0 −440 support/Net/DNS2/RR/LOC.php
  49. +0 −177 support/Net/DNS2/RR/LP.php
  50. +0 −175 support/Net/DNS2/RR/MX.php
  51. +0 −231 support/Net/DNS2/RR/NAPTR.php
  52. +0 −187 support/Net/DNS2/RR/NID.php
  53. +0 −130 support/Net/DNS2/RR/NIMLOC.php
  54. +0 −153 support/Net/DNS2/RR/NS.php
  55. +0 −262 support/Net/DNS2/RR/NSAP.php
  56. +0 −184 support/Net/DNS2/RR/NSEC.php
  57. +0 −310 support/Net/DNS2/RR/NSEC3.php
  58. +0 −220 support/Net/DNS2/RR/NSEC3PARAM.php
  59. +0 −292 support/Net/DNS2/RR/OPT.php
  60. +0 −152 support/Net/DNS2/RR/PTR.php
  61. +0 −186 support/Net/DNS2/RR/PX.php
  62. +0 −167 support/Net/DNS2/RR/RP.php
  63. +0 −329 support/Net/DNS2/RR/RRSIG.php
  64. +0 −175 support/Net/DNS2/RR/RT.php
  65. +0 −423 support/Net/DNS2/RR/SIG.php
  66. +0 −240 support/Net/DNS2/RR/SOA.php
  67. +0 −75 support/Net/DNS2/RR/SPF.php
  68. +0 −186 support/Net/DNS2/RR/SRV.php
  69. +0 −244 support/Net/DNS2/RR/SSHFP.php
  70. +0 −75 support/Net/DNS2/RR/TA.php
  71. +0 −171 support/Net/DNS2/RR/TALINK.php
  72. +0 −307 support/Net/DNS2/RR/TKEY.php
  73. +0 −194 support/Net/DNS2/RR/TLSA.php
  74. +0 −504 support/Net/DNS2/RR/TSIG.php
  75. +0 −177 support/Net/DNS2/RR/TXT.php
  76. +0 −183 support/Net/DNS2/RR/URI.php
  77. +0 −235 support/Net/DNS2/RR/WKS.php
  78. +0 −160 support/Net/DNS2/RR/X25.php
  79. +0 −332 support/Net/DNS2/Resolver.php
  80. +0 −189 support/Net/DNS2/Socket.php
  81. +0 −364 support/Net/DNS2/Socket/Sockets.php
  82. +0 −389 support/Net/DNS2/Socket/Streams.php
  83. +0 −654 support/Net/DNS2/Updater.php
  84. +33 −0 support/Net/license.txt
  85. +28 −105 support/aes.php
  86. +43 −582 support/blowfish.php
  87. +534 −479 support/cacert.pem
  88. +4 −4 support/crc32_stream.php
  89. +11 −9 support/deflate_stream.php
  90. +5 −1 support/emulate_curl.php
  91. +285 −41 support/http.php
  92. +21 −1 support/ipaddr.php
  93. +1 −1 support/mime_parser.php
  94. +2,731 −2,731 support/phpqrcode.php
  95. +93 −24 support/phpseclib/AES.php
  96. +491 −377 support/phpseclib/Base.php
  97. +166 −75 support/phpseclib/Blowfish.php
  98. +146 −133 support/phpseclib/Rijndael.php
  99. +1 −1 support/phpseclib/license.txt
  100. +8 −4 support/random.php
  101. +534 −380 support/smtp.php
  102. +6 −6 support/sso_functions.php
  103. +33 −2 support/str_basics.php
  104. +776 −0 support/tag_filter.php
  105. +252 −22 support/web_browser.php
  106. +1 −1 upgrade.php
View
@@ -13,9 +13,8 @@
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/str_basics.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/page_basics.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/sso_functions.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/blowfish.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/aes.php";
if (!ExtendedAES::IsMcryptAvailable()) require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/phpseclib/AES.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/blowfish.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/random.php";
SetDebugLevel();
@@ -1063,7 +1062,7 @@ function SSO_ConfigRedirect($action2, $extra = array(), $msgtype = "", $msg = ""
if (strlen($_REQUEST["namespace"]) > 20) BB_SetPageMessage("error", "'Namespace' can only be 20 characters long.");
if ($_REQUEST["type"] != "normal" && $_REQUEST["type"] != "remote" && $_REQUEST["type"] != "custom") BB_SetPageMessage("error", "Please select a 'Type'.");
if ((int)$_REQUEST["clock_drift"] < 0) BB_SetPageMessage("error", "Invalid clock drift specified.");
if ($_REQUEST["cipher"] != "blowfish" && $_REQUEST["cipher"] != "aes256") BB_SetPageMessage("error", "Please select a 'Symmetric Cipher'.");
if ($_REQUEST["cipher"] != "aes256" && $_REQUEST["cipher"] != "blowfish") BB_SetPageMessage("error", "Please select a 'Symmetric Cipher'.");
if (BB_GetPageMessageType() != "error")
{
@@ -1153,7 +1152,7 @@ function SSO_ConfigRedirect($action2, $extra = array(), $msgtype = "", $msg = ""
"title" => "Symmetric Cipher",
"type" => "select",
"name" => "cipher",
"options" => array("blowfish" => "Blowfish", "aes256" => "AES-256"),
"options" => array("aes256" => "AES-256", "blowfish" => "Blowfish"),
"value" => BB_GetValue("cipher", ""),
"desc" => "Used when generating a new secret key. The cipher to use to encrypt/decrypt data sent across the network. The ordering of the ciphers is intentional."
),
@@ -1284,7 +1283,7 @@ function SSO_ConfigRedirect($action2, $extra = array(), $msgtype = "", $msg = ""
{
if ($_REQUEST["purpose"] == "") BB_SetPageMessage("error", "Please fill in 'Purpose'.");
if (strlen($_REQUEST["namespace"]) > 20) BB_SetPageMessage("error", "'Namespace' can only be 20 characters long.");
if ($_REQUEST["cipher"] != "blowfish" && $_REQUEST["cipher"] != "aes256") BB_SetPageMessage("error", "Please select a 'Symmetric Cipher'.");
if ($_REQUEST["cipher"] != "aes256" && $_REQUEST["cipher"] != "blowfish") BB_SetPageMessage("error", "Please select a 'Symmetric Cipher'.");
if (BB_GetPageMessageType() != "error")
{
@@ -1358,7 +1357,7 @@ function SSO_ConfigRedirect($action2, $extra = array(), $msgtype = "", $msg = ""
"title" => "Symmetric Cipher",
"type" => "select",
"name" => "cipher",
"options" => array("blowfish" => "Blowfish", "aes256" => "AES-256"),
"options" => array("aes256" => "AES-256", "blowfish" => "Blowfish"),
"value" => BB_GetValue("cipher", ""),
"desc" => "The cipher to use to encrypt/decrypt data sent across the network. The ordering of the ciphers is intentional."
),
View
@@ -8,9 +8,8 @@
require_once "config.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/str_basics.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/sso_functions.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/blowfish.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/aes.php";
if (!ExtendedAES::IsMcryptAvailable()) require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/phpseclib/AES.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/blowfish.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/random.php";
Str::ProcessAllInput();
@@ -40,7 +39,7 @@ function SSO_EndpointOutput($result)
if ($sso_encrypted)
{
if ($sso_apikey_info["keyinfo"]["mode"] === "aes256") $result = ExtendedAES::CreateDataPacket($result, $sso_apikey_info["keyinfo"]["key"], $sso_apikey_info["keyinfo"]["opts"]);
else $result = Blowfish::CreateDataPacket($result, $sso_apikey_info["keyinfo"]["key"], $sso_apikey_info["keyinfo"]["opts"]);
else $result = ExtendedBlowfish::CreateDataPacket($result, $sso_apikey_info["keyinfo"]["key"], $sso_apikey_info["keyinfo"]["opts"]);
$result = base64_encode($result);
}
@@ -145,7 +144,7 @@ function SSO_EndpointError($msg, $info = "")
$sso_apikey_info["keyinfo"]["opts"]["prefix"] = pack("H*", $sso_rng->GenerateToken());
if ($sso_apikey_info["keyinfo"]["mode"] === "aes256") $sso_data = ExtendedAES::ExtractDataPacket($sso_data, $sso_apikey_info["keyinfo"]["key"], $sso_apikey_info["keyinfo"]["opts"]);
else $sso_data = Blowfish::ExtractDataPacket($sso_data, $sso_apikey_info["keyinfo"]["key"], $sso_apikey_info["keyinfo"]["opts"]);
else $sso_data = ExtendedBlowfish::ExtractDataPacket($sso_data, $sso_apikey_info["keyinfo"]["key"], $sso_apikey_info["keyinfo"]["opts"]);
if ($sso_data === false) SSO_EndpointError("Unable to decrypt data packet.");
View
@@ -9,9 +9,8 @@
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/str_basics.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/page_basics.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/sso_functions.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/blowfish.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/aes.php";
if (!ExtendedAES::IsMcryptAvailable()) require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/phpseclib/AES.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/blowfish.php";
require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/random.php";
Str::ProcessAllInput();
View
@@ -1225,10 +1225,10 @@ function RefreshEmailTest()
<div class="formitem">
<div class="formitemtitle">Primary Symmetric Cipher</div>
<select id="sso_primary_cipher" name="sso_primary_cipher">
<option value="blowfish">Blowfish</option>
<option value="aes256">AES-256</option>
<option value="blowfish">Blowfish</option>
</select>
<div class="formitemdesc">The cipher to use for encrypted database storage. The ordering of the ciphers is intentional. Blowfish is preferred, having withstood two decades of cryptanalysis.</div>
<div class="formitemdesc">The cipher to use for encrypted database storage. The ordering of the ciphers is intentional. AES-256 is faster on modern hardware.</div>
</div>
<div class="formitem">
<div class="formitemtitle">Use Dual Encryption</div>
@@ -1431,7 +1431,7 @@ public static function CalculateOptimalHashRounds($mode, $mintime)
if (!$result["success"]) return false;
} while ($ts < $mintime);
// Blowfish::Hash() does as many rounds as it can in the allotted time,
// ExtendedBlowfish::Hash() does as many rounds as it can in the allotted time,
// which will generally be more than a reasonable $minrounds setting.
if ($mode === "blowfish") $minrounds /= 2;
@@ -1459,7 +1459,7 @@ public static function HashPasswordInfo($data, $mode, $minrounds, $mintime = fal
}
else
{
$result = Blowfish::Hash($data, $minrounds, ($mintime !== false ? $mintime : $sso_settings["sso_login"]["password_mintime"]));
$result = ExtendedBlowfish::Hash($data, $minrounds, ($mintime !== false ? $mintime : $sso_settings["sso_login"]["password_mintime"]));
}
return $result;
@@ -1476,7 +1476,7 @@ public static function VerifyPasswordInfo($data, $hash, $numrounds)
}
else
{
$result = Blowfish::Hash($data, $numrounds, 0);
$result = ExtendedBlowfish::Hash($data, $numrounds, 0);
if (!$result["success"] || $hash !== bin2hex($result["hash"])) return false;
}
@@ -178,7 +178,7 @@ private function SignupUpdateAddInfo(&$userinfo, $update, $admin)
$userinfo["sso_antiphish"] = SSO_FrontendFieldValue($update ? "sso_login_antiphish_update" : "sso_login_antiphish");
// Set the anti-phishing cookie here.
$data = base64_encode(Blowfish::CreateDataPacket($userinfo["sso_antiphish"], pack("H*", $info["cookiekey"]), array("prefix" => $sso_rng->GenerateString(), "mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true)));
$data = base64_encode(ExtendedBlowfish::CreateDataPacket($userinfo["sso_antiphish"], pack("H*", $info["cookiekey"]), array("prefix" => $sso_rng->GenerateString(), "mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true)));
SetCookieFixDomain("sso_l_ap", $data, time() + 365 * 24 * 60 * 60, "", "", BB_IsSSLRequest(), true);
}
}
@@ -199,7 +199,7 @@ public function GenerateLogin($messages)
{
// Decrypt data.
$phrase = @base64_decode($_COOKIE["sso_l_ap"]);
if ($phrase !== false) $phrase = Blowfish::ExtractDataPacket($phrase, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($phrase !== false) $phrase = ExtendedBlowfish::ExtractDataPacket($phrase, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($phrase === false) $phrase = "";
}
?>
@@ -247,7 +247,7 @@ public function LoginAddMap(&$mapinfo, $userrow, &$userinfo, $admin)
if ($info["cookiekey"] != "" && $info["cookieiv"] != "" && $info["cookiekey2"] != "" && $info["cookieiv2"] != "" && isset($userinfo["sso_antiphish"]))
{
// Set the anti-phishing cookie here.
$data = base64_encode(Blowfish::CreateDataPacket($userinfo["sso_antiphish"], pack("H*", $info["cookiekey"]), array("prefix" => $sso_rng->GenerateString(), "mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true)));
$data = base64_encode(ExtendedBlowfish::CreateDataPacket($userinfo["sso_antiphish"], pack("H*", $info["cookiekey"]), array("prefix" => $sso_rng->GenerateString(), "mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true)));
SetCookieFixDomain("sso_l_ap", $data, time() + 365 * 24 * 60 * 60, "", "", BB_IsSSLRequest(), true);
}
}
@@ -132,7 +132,7 @@ public function GenerateLogin($messages)
{
// Decrypt data.
$info2 = @base64_decode($_COOKIE["sso_l_rme"]);
if ($info2 !== false) $info2 = Blowfish::ExtractDataPacket($info2, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($info2 !== false) $info2 = ExtendedBlowfish::ExtractDataPacket($info2, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($info2 !== false) $info2 = @unserialize($info2);
if ($info2 !== false)
{
@@ -283,15 +283,15 @@ public function LoginAddMap(&$mapinfo, $userrow, &$userinfo, $admin)
{
// Decrypt existing data.
$info2 = @base64_decode($_COOKIE["sso_l_rme"]);
if ($info2 !== false) $info2 = Blowfish::ExtractDataPacket($info2, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($info2 !== false) $info2 = ExtendedBlowfish::ExtractDataPacket($info2, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($info2 !== false) $info2 = @unserialize($info2);
}
if ($info2 === false) $info2 = array();
$info2[$userrow->id] = array($token, $token2);
// Set the Remember Me cookie.
$data = base64_encode(Blowfish::CreateDataPacket(serialize($info2), pack("H*", $info["cookiekey"]), array("prefix" => $sso_rng->GenerateString(), "mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true)));
$data = base64_encode(ExtendedBlowfish::CreateDataPacket(serialize($info2), pack("H*", $info["cookiekey"]), array("prefix" => $sso_rng->GenerateString(), "mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true)));
SetCookieFixDomain("sso_l_rme", $data, time() + $info["maxdays"] * 24 * 60 * 60, "", "", BB_IsSSLRequest(), true);
}
}
@@ -323,7 +323,7 @@ public function CustomFrontend()
{
// Decrypt data.
$info2 = @base64_decode($_COOKIE["sso_l_rme"]);
if ($info2 !== false) $info2 = Blowfish::ExtractDataPacket($info2, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($info2 !== false) $info2 = ExtendedBlowfish::ExtractDataPacket($info2, pack("H*", $info["cookiekey"]), array("mode" => "CBC", "iv" => pack("H*", $info["cookieiv"]), "key2" => pack("H*", $info["cookiekey2"]), "iv2" => pack("H*", $info["cookieiv2"]), "lightweight" => true));
if ($info2 !== false) $info2 = @unserialize($info2);
if ($info2 !== false)
{
Oops, something went wrong.

0 comments on commit 7697d86

Please sign in to comment.