Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * This file is a part of the miniorange-saml-20-single-sign-on plugin. * ..
Decoded Output download
<?php
/**
* This file is a part of the miniorange-saml-20-single-sign-on plugin.
*
* @link https://plugins.miniorange.com/
* @author miniOrange
* @package miniorange-saml-20-single-sign-on
*/
include_once 'xmlseclibs.php';
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
use MOSAML\LicenseLibrary\Mo_License_Service;
class Utilities
{
public static function generateID()
{
return "_" . self::stringToHex(self::generateRandomBytes(21));
}
public static function stringToHex($B3)
{
$Ez = '';
$zL = 0;
Lpf:
if (!($zL < strlen($B3))) {
goto u9k;
}
$Ez .= sprintf("%02x", ord($B3[$zL]));
Rgl:
$zL++;
goto Lpf;
u9k:
return $Ez;
}
public static function generateRandomBytes($mX, $oU = TRUE)
{
return openssl_random_pseudo_bytes($mX);
}
public static function createAuthnRequest($lR, $xF, $TB, $cF = "false", $Vh = "HttpRedirect", $hY = '')
{
$hY = "urn:oasis:names:tc:SAML:" . $hY;
$l4 = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="" . self::generateID() . "" Version="2.0" IssueInstant="" . self::generateTimestamp() . """;
if (!($cF == "true")) {
goto aFI;
}
$l4 .= " ForceAuthn="true"";
aFI:
$l4 .= " ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" . $lR . "" Destination="" . $TB . ""><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $xF . "</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="" . $hY . ""
/></samlp:AuthnRequest>";
if (empty($Vh) || $Vh == "HttpRedirect") {
goto GAo;
}
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
update_site_option("mo_saml_request", $mD);
goto ClF;
GAo:
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
update_site_option("mo_saml_request", $mD);
$A0 = urlencode($mD);
$l4 = $A0;
ClF:
return $l4;
}
public static function createLogoutRequest($DV, $xF, $TB, $x5 = '', $nu = "HttpRedirect")
{
$l4 = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="" . self::generateID() . "" IssueInstant="" . self::generateTimestamp() . "" Version="2.0" Destination="" . $TB . "">\xd\xa \x9\x9\x9\x9<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $xF . "</saml:Issuer>\xd\xa \x9\x9\x9 <saml:NameID xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $DV[0] . "</saml:NameID>";
if (empty($x5)) {
goto OR2;
}
$l4 .= "<samlp:SessionIndex>" . $x5[0] . "</samlp:SessionIndex>";
OR2:
$l4 .= "</samlp:LogoutRequest>";
if (!(empty($nu) || $nu == "HttpRedirect")) {
goto i2W;
}
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
$A0 = urlencode($mD);
$l4 = $A0;
i2W:
return $l4;
}
public static function createLogoutResponse($lQ, $xF, $TB, $nu = "HttpRedirect")
{
$l4 = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:LogoutResponse xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" " . "ID="" . self::generateID() . "" " . "Version="2.0" IssueInstant="" . self::generateTimestamp() . "" " . "Destination="" . $TB . "" " . "InResponseTo="" . $lQ . "">" . "<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $xF . "</saml:Issuer>" . "<samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status></samlp:LogoutResponse>";
if (!(empty($nu) || $nu == "HttpRedirect")) {
goto Fv9;
}
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
$A0 = urlencode($mD);
$l4 = $A0;
Fv9:
return $l4;
}
public static function generateTimestamp($XK = NULL)
{
if (!($XK === NULL)) {
goto A2m;
}
$XK = time();
A2m:
return gmdate("Y-m-d\TH:i:s\Z", $XK);
}
public static function xpQuery(DOMNode $c4, $oi)
{
static $Zu = NULL;
if ($c4 instanceof DOMDocument) {
goto U38;
}
$Hy = $c4->ownerDocument;
goto ZBh;
U38:
$Hy = $c4;
ZBh:
if (!($Zu === NULL || !$Zu->document->isSameNode($Hy))) {
goto Mwi;
}
$Zu = new DOMXPath($Hy);
$Zu->registerNamespace("soap-env", "http://schemas.xmlsoap.org/soap/envelope/");
$Zu->registerNamespace("saml_protocol", "urn:oasis:names:tc:SAML:2.0:protocol");
$Zu->registerNamespace("saml_assertion", "urn:oasis:names:tc:SAML:2.0:assertion");
$Zu->registerNamespace("saml_metadata", "urn:oasis:names:tc:SAML:2.0:metadata");
$Zu->registerNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
$Zu->registerNamespace("xenc", "http://www.w3.org/2001/04/xmlenc#");
Mwi:
$CD = $Zu->query($oi, $c4);
$Ez = array();
$zL = 0;
Wd5:
if (!($zL < $CD->length)) {
goto BkZ;
}
$Ez[$zL] = $CD->item($zL);
T89:
$zL++;
goto Wd5;
BkZ:
return $Ez;
}
public static function parseNameId(DOMElement $RO)
{
$Ez = array("Value" => trim($RO->textContent));
foreach (array("NameQualifier", "SPNameQualifier", "Format") as $a6) {
if (!$RO->hasAttribute($a6)) {
goto I1w;
}
$Ez[$a6] = $RO->getAttribute($a6);
I1w:
M52:
}
UAi:
return $Ez;
}
public static function xsDateTimeToTimestamp($W3)
{
$Ry = array();
$Sh = "/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.\d+)?Z$/D";
if (!(preg_match($Sh, $W3, $Ry) == 0)) {
goto IKd;
}
echo sprintf("nvalid SAML2 timestamp passed to xsDateTimeToTimestamp: " . $W3);
exit;
IKd:
$aY = intval($Ry[1]);
$xv = intval($Ry[2]);
$JS = intval($Ry[3]);
$CB = intval($Ry[4]);
$vl = intval($Ry[5]);
$YH = intval($Ry[6]);
$IF = gmmktime($CB, $vl, $YH, $xv, $JS, $aY);
return $IF;
}
public static function extractStrings(DOMElement $dV, $Dn, $N7)
{
$Ez = array();
$c4 = $dV->firstChild;
jrr:
if (!($c4 !== NULL)) {
goto OBJ;
}
if (!($c4->namespaceURI !== $Dn || $c4->localName !== $N7)) {
goto u3y;
}
goto puK;
u3y:
$Ez[] = trim($c4->textContent);
puK:
$c4 = $c4->nextSibling;
goto jrr;
OBJ:
return $Ez;
}
public static function validateElement(DOMElement $Bs)
{
$Dk = new XMLSecurityDSig();
$Dk->idKeys[] = "ID";
$Xx = self::xpQuery($Bs, "./ds:Signature");
if (count($Xx) === 0) {
goto LJH;
}
if (count($Xx) > 1) {
goto Fgr;
}
goto uee;
LJH:
return FALSE;
goto uee;
Fgr:
echo sprintf("XMLSec: more than one signature element in root.");
exit;
uee:
$Xx = $Xx[0];
$Dk->sigNode = $Xx;
$Dk->canonicalizeSignedInfo();
if ($Dk->validateReference()) {
goto jkK;
}
echo sprintf("XMLsec: digest validation failed");
exit;
jkK:
$mT = FALSE;
foreach ($Dk->getValidatedNodes() as $dt) {
if ($dt->isSameNode($Bs)) {
goto mz2;
}
if ($Bs->parentNode instanceof DOMDocument && $dt->isSameNode($Bs->ownerDocument)) {
goto AEj;
}
goto w0x;
mz2:
$mT = TRUE;
goto NAp;
goto w0x;
AEj:
$mT = TRUE;
goto NAp;
w0x:
yjH:
}
NAp:
if ($mT) {
goto cw0;
}
echo sprintf("XMLSec: The root element is not signed.");
exit;
cw0:
$Bg = array();
foreach (self::xpQuery($Xx, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate") as $wY) {
$sS = trim($wY->textContent);
$sS = str_replace(array("\xd", "
", "\x9", " "), '', $sS);
$Bg[] = $sS;
kMi:
}
mRv:
$Ez = array("Signature" => $Dk, "Certificates" => $Bg);
return $Ez;
}
public static function validateSignature(array $Gi, XMLSecurityKey $ns)
{
$Dk = $Gi["Signature"];
$E1 = self::xpQuery($Dk->sigNode, "./ds:SignedInfo/ds:SignatureMethod");
if (!empty($E1)) {
goto x4U;
}
echo sprintf("Missing SignatureMethod element");
exit;
x4U:
$E1 = $E1[0];
if ($E1->hasAttribute("Algorithm")) {
goto PmD;
}
echo sprintf("Missing Algorithm-attribute on SignatureMethod element.");
exit;
PmD:
$QW = $E1->getAttribute("Algorithm");
if (!($ns->type === XMLSecurityKey::RSA_SHA1 && $QW !== $ns->type)) {
goto JAs;
}
$ns = self::castKey($ns, $QW);
JAs:
if ($Dk->verify($ns)) {
goto kIE;
}
return false;
kIE:
}
public static function castKey(XMLSecurityKey $ns, $dC, $CL = "public")
{
if (!($ns->type === $dC)) {
goto eCo;
}
return $ns;
eCo:
$e6 = openssl_pkey_get_details($ns->key);
if (!($e6 === FALSE)) {
goto nZU;
}
echo sprintf("Unable to get key details from XMLSecurityKey.");
exit;
nZU:
if (!empty($e6["key"])) {
goto E0c;
}
echo sprintf("Missing key in public key details.");
exit;
E0c:
$Ao = new XMLSecurityKey($dC, array("type" => $CL));
$Ao->loadKey($e6["key"]);
return $Ao;
}
public static function processResponse($xu, $XF, $OA, SAML2_Response $uk, $Rc, $XS)
{
$Cl = current($uk->getAssertions());
$iP = $Cl->getNotBefore();
if (!($iP !== NULL && $iP > time() + 60)) {
goto Np2;
}
wp_die("Received an assertion that is valid in the future. Check clock synchronization on IdP and SP.");
Np2:
$BX = $Cl->getNotOnOrAfter();
if (!($BX !== NULL && $BX <= time() - 60)) {
goto FIR;
}
wp_die("Received an assertion that has expired. Check clock synchronization on IdP and SP.");
FIR:
$AN = $Cl->getSessionNotOnOrAfter();
if (!($AN !== NULL && $AN <= time() - 60)) {
goto i7M;
}
wp_die("Received an assertion with a session that has expired. Check clock synchronization on IdP and SP.");
i7M:
$WW = $uk->getDestination();
if (!(substr($WW, -1) == "/")) {
goto skS;
}
$WW = substr($WW, 0, -1);
skS:
if (!(substr($xu, -1) == "/")) {
goto r6w;
}
$xu = substr($xu, 0, -1);
r6w:
if (!($WW !== NULL && $WW !== $xu)) {
goto wqE;
}
echo "Destination in response doesn't match the current URL. Destination is "" . htmlspecialchars($WW) . "", current URL is "" . htmlspecialchars($xu) . "".";
exit;
wqE:
$F7 = self::checkSign($XF, $OA, $Rc, $XS);
return $F7;
}
public static function checkSign($XF, $OA, $Rc, $XS)
{
$Bg = $OA["Certificates"];
if (count($Bg) === 0) {
goto t9J;
}
$ui = array();
$ui[] = $XF;
$lr = self::findCertificate($ui, $Bg, $XS);
if ($lr) {
goto yYl;
}
return FALSE;
yYl:
goto e11;
t9J:
$g7 = maybe_unserialize(get_site_option("saml_x509_certificate"));
$lr = $g7[$Rc];
e11:
$t7 = NULL;
$ns = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array("type" => "public"));
$ns->loadKey($lr);
try {
self::validateSignature($OA, $ns);
return TRUE;
} catch (Exception $XJ) {
$t7 = $XJ;
return FALSE;
}
if ($t7 !== NULL) {
goto rC9;
}
return FALSE;
goto rnM;
rC9:
throw $t7;
rnM:
}
public static function validateIssuerAndAudience($xb, $eP, $eX, $XS)
{
$xF = current($xb->getAssertions())->getIssuer();
$Cl = current($xb->getAssertions());
$LH = $Cl->getValidAudiences();
if (strcmp($eX, $xF) === 0) {
goto EoT;
}
if ($XS == "testValidate" or $XS == "testNewCertificate") {
goto L2o;
}
wp_die("We could not sign you in. Please contact your Administrator", "Error :Issuer cannot be verified");
goto kka;
L2o:
ob_end_clean();
$W_ = mo_options_error_constants::Error_issuer_not_verfied;
$FQ = mo_options_error_constants::Cause_issuer_not_verfied;
echo "<div style="font-family:Calibri;padding:0 3%;">";
echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\x9\x9\x9 <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Issuer cannot be verified.</p>
\xa \x9 <p>Please contact your administrator and report the following error:</p>\xd
\x9 \x9 <p><strong>Possible Cause: </strong>IdP Entity ID configured in the plugin is incorrect</p>
\x9 <p><strong>Entity ID in SAML Response: </strong>" . esc_html($xF) . "<p>\xd\xa \x9\x9 <p><strong>Entity ID configured in the plugin: </strong>" . esc_html($eX) . "</p>
\xa\x9 \x9 <p><strong>Solution:</strong></p>\xd
\x9\x9\x9<ol>
\x9 \x9\x9\x9<li>Copy the Entity ID of SAML Response from above and paste it in Entity ID or Issuer field under Service Provider Setup tab.</li>
\xa\x9\x9 \x9</ol>\xd
\x9 </div>\xd\xa \x9 <div style="margin:3%;display:block;text-align:center;">
\x9 <div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
mo_saml_download_logs($W_, $FQ);
exit;
kka:
goto js8;
EoT:
if (empty($LH)) {
goto yFW;
}
if (self::mo_saml_in_array($eP, $LH, TRUE)) {
goto EyI;
}
if ($XS == "testValidate" or $XS == "testNewCertificate") {
goto kPW;
}
wp_die("We could not sign you in. Please contact your Administrator", "Error :Invalid Audience URI");
goto eOT;
kPW:
$W_ = mo_options_error_constants::Error_invalid_audience;
$FQ = mo_options_error_constants::Cause_invalid_audience;
ob_end_clean();
echo "<div style="font-family:Calibri;padding:0 3%;">";
echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Invalid Audience URI.</p>
<p>Please contact your administrator and report the following error:</p>\xd\xa <p><strong>Possible Cause: </strong>The value of 'Audience URI' field on Identity Provider's side is incorrect</p>\xd
<p>Expected one of the Audiences to be: " . $eP . "<p>
\x9\x9 \x9 <p><strong>Solution:</strong></p>
\xa \x9\x9<ol>
\xa \x9\x9 \x9\x9<li>Copy the Expected Audience URI from above and paste it in the Audience URI field at Identity Provider side.</li>\xd
\x9 \x9 </ol>
\x9 \x9\x9</div>
<div style="margin:3%;display:block;text-align:center;">\xd
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
exit;
mo_saml_download_logs($W_, $FQ);
eOT:
goto PTz;
EyI:
return TRUE;
PTz:
yFW:
js8:
}
private static function findCertificate(array $eI, array $Bg, $XS)
{
$LP = array();
foreach ($Bg as $eH) {
$Mv = strtolower(sha1(base64_decode($eH)));
if (!self::mo_saml_in_array($Mv, $eI, TRUE)) {
goto Yg4;
}
$N2 = "-----BEGIN CERTIFICATE-----
" . chunk_split($eH, 64) . "-----END CERTIFICATE-----
";
return $N2;
Yg4:
$LP[] = $Mv;
Ry6:
}
sie:
return false;
}
private static function doDecryptElement(DOMElement $cR, XMLSecurityKey $Xr, array &$gz)
{
$J8 = new XMLSecEnc();
$J8->setNode($cR);
$J8->type = $cR->getAttribute("Type");
$Qt = $J8->locateKey($cR);
if ($Qt) {
goto YnB;
}
echo sprintf("Could not locate key algorithm in encrypted data.");
exit;
YnB:
$Tp = $J8->locateKeyInfo($Qt);
if ($Tp) {
goto r2c;
}
echo sprintf("Could not locate <dsig:KeyInfo> for the encrypted key.");
exit;
r2c:
$Wm = $Xr->getAlgorith();
if ($Tp->isEncrypted) {
goto vfq;
}
$pa = $Qt->getAlgorith();
if (!($Wm !== $pa)) {
goto ixj;
}
echo sprintf("Algorithm mismatch between input key and key in message. " . "Key was: " . var_export($Wm, TRUE) . "; message was: " . var_export($pa, TRUE));
exit;
ixj:
$Qt = $Xr;
goto T3B;
vfq:
$xT = $Tp->getAlgorith();
if (!self::mo_saml_in_array($xT, $gz, TRUE)) {
goto WtM;
}
echo sprintf("Algorithm disabled: " . var_export($xT, TRUE));
exit;
WtM:
if (!($xT === XMLSecurityKey::RSA_OAEP_MGF1P && $Wm === XMLSecurityKey::RSA_1_5)) {
goto J9k;
}
$Wm = XMLSecurityKey::RSA_OAEP_MGF1P;
J9k:
if (!($Wm !== $xT)) {
goto qCC;
}
echo sprintf("Algorithm mismatch between input key and key used to encrypt " . " the symmetric key for the message. Key was: " . var_export($Wm, TRUE) . "; message was: " . var_export($xT, TRUE));
exit;
qCC:
$hA = $Tp->encryptedCtx;
$Tp->key = $Xr->key;
$QS = $Qt->getSymmetricKeySize();
if (!($QS === NULL)) {
goto qzo;
}
echo sprintf("Unknown key size for encryption algorithm: " . var_export($Qt->type, TRUE));
exit;
qzo:
try {
$ns = $hA->decryptKey($Tp);
if (!(strlen($ns) != $QS)) {
goto eUG;
}
echo sprintf("Unexpected key size (" . strlen($ns) * 8 . "bits) for encryption algorithm: " . var_export($Qt->type, TRUE));
exit;
eUG:
} catch (Exception $XJ) {
$QF = $hA->getCipherValue();
$rW = openssl_pkey_get_details($Tp->key);
$rW = sha1(serialize($rW), TRUE);
$ns = sha1($QF . $rW, TRUE);
if (strlen($ns) > $QS) {
goto Pfl;
}
if (strlen($ns) < $QS) {
goto yg2;
}
goto x3q;
Pfl:
$ns = substr($ns, 0, $QS);
goto x3q;
yg2:
$ns = str_pad($ns, $QS);
x3q:
}
$Qt->loadkey($ns);
T3B:
$dC = $Qt->getAlgorith();
if (!self::mo_saml_in_array($dC, $gz, TRUE)) {
goto C5p;
}
echo sprintf("Algorithm disabled: " . var_export($dC, TRUE));
exit;
C5p:
$tN = $J8->decryptNode($Qt, FALSE);
$RO = "<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" " . "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">" . $tN . "</root>";
$rc = new DOMDocument();
if (@$rc->loadXML($RO)) {
goto M9S;
}
echo sprintf("Failed to parse decrypted XML. Maybe the wrong sharedkey was used?");
throw new Exception("Failed to parse decrypted XML. Maybe the wrong sharedkey was used?");
M9S:
$eV = $rc->firstChild->firstChild;
if (!($eV === NULL)) {
goto tEz;
}
echo sprintf("Missing encrypted element.");
throw new Exception("Missing encrypted element.");
tEz:
if ($eV instanceof DOMElement) {
goto P0K;
}
echo sprintf("Decrypted element was not actually a DOMElement.");
P0K:
return $eV;
}
public static function decryptElement(DOMElement $cR, XMLSecurityKey $Xr, array $gz = array(), XMLSecurityKey $do = NULL)
{
try {
return self::doDecryptElement($cR, $Xr, $gz);
} catch (Exception $XJ) {
echo sprintf("Failed to decrypt XML element.");
exit;
}
}
public static function get_mapped_groups($f1, $Xe)
{
$Sx = array();
if (empty($Xe)) {
goto tX2;
}
$Ph = array();
$zL = 1;
XA4:
if (!($zL < 10)) {
goto Zma;
}
$gF = $f1->get("group" . $zL . "_map");
$Ph[$zL] = explode(";", $gF);
$zL++;
goto XA4;
Zma:
tX2:
foreach ($Xe as $Tw) {
if (empty($Tw)) {
goto OZp;
}
$zL = 0;
$MN = false;
jvm:
if (!($zL < 9 && !$MN)) {
goto Vh5;
}
if (!(!empty($Ph[$zL]) && in_array($Tw, $Ph[$zL]))) {
goto VHV;
}
$Sx[] = $f1->get("group" . $zL);
$MN = true;
VHV:
$zL++;
goto jvm;
Vh5:
OZp:
TXv:
}
gam:
return array_unique($Sx);
}
public static function getEncryptionAlgorithm($xW)
{
switch ($xW) {
case "http://www.w3.org/2001/04/xmlenc#tripledes-cbc":
return XMLSecurityKey::TRIPLEDES_CBC;
goto ArX;
case "http://www.w3.org/2001/04/xmlenc#aes128-cbc":
return XMLSecurityKey::AES128_CBC;
case "http://www.w3.org/2001/04/xmlenc#aes192-cbc":
return XMLSecurityKey::AES192_CBC;
goto ArX;
case "http://www.w3.org/2001/04/xmlenc#aes256-cbc":
return XMLSecurityKey::AES256_CBC;
goto ArX;
case "http://www.w3.org/2001/04/xmlenc#rsa-1_5":
return XMLSecurityKey::RSA_1_5;
goto ArX;
case "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p":
return XMLSecurityKey::RSA_OAEP_MGF1P;
goto ArX;
case "http://www.w3.org/2000/09/xmldsig#dsa-sha1":
return XMLSecurityKey::DSA_SHA1;
goto ArX;
case "http://www.w3.org/2000/09/xmldsig#rsa-sha1":
return XMLSecurityKey::RSA_SHA1;
goto ArX;
case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":
return XMLSecurityKey::RSA_SHA256;
goto ArX;
case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384":
return XMLSecurityKey::RSA_SHA384;
goto ArX;
case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":
return XMLSecurityKey::RSA_SHA512;
goto ArX;
default:
echo sprintf("Invalid Encryption Method: " . $xW);
exit;
goto ArX;
}
Fx4:
ArX:
}
public static function insertSignature(XMLSecurityKey $ns, array $Bg, DOMElement $Bs, DOMNode $HB = NULL)
{
$Dk = new XMLSecurityDSig();
$Dk->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
switch ($ns->type) {
case XMLSecurityKey::RSA_SHA256:
$CL = XMLSecurityDSig::SHA256;
goto kco;
case XMLSecurityKey::RSA_SHA384:
$CL = XMLSecurityDSig::SHA384;
goto kco;
case XMLSecurityKey::RSA_SHA512:
$CL = XMLSecurityDSig::SHA512;
goto kco;
default:
$CL = XMLSecurityDSig::SHA1;
}
H5g:
kco:
$Dk->addReferenceList(array($Bs), $CL, array("http://www.w3.org/2000/09/xmldsig#enveloped-signature", XMLSecurityDSig::EXC_C14N), array("id_name" => "ID", "overwrite" => FALSE));
$Dk->sign($ns);
foreach ($Bg as $RV) {
$Dk->add509Cert($RV, TRUE);
n1M:
}
ZXI:
$Dk->insertSignature($Bs, $HB);
}
public static function getRemainingDaysOfCurrentCertificate()
{
$RV = get_site_option("mo_saml_current_cert");
$jR = openssl_x509_parse($RV);
$fY = $jR["validTo_time_t"];
$zV = $fY - time();
return round($zV / (60 * 60 * 24));
}
public static function getExpiryDateOfCurrentCertificate()
{
$RV = get_site_option("mo_saml_current_cert");
$jR = openssl_x509_parse($RV);
return $jR["validTo_time_t"];
}
public static function getValidUntilDateFromCert($RV)
{
$jR = openssl_x509_parse($RV);
$fY = $jR["validTo_time_t"];
$nn = date("Y-m-d", $fY);
$AG = $nn . "T23:59:59Z";
return $AG;
}
public static function signXML($RO, $Zp = '', $Yk = false)
{
$HH = array("type" => "private");
$ns = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $HH);
if ($Yk) {
goto DYE;
}
$at = get_site_option("mo_saml_current_cert_private_key");
$a4 = get_site_option("mo_saml_current_cert");
goto EL7;
DYE:
$at = file_get_contents(plugin_dir_path(__FILE__) . "resources" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Private_Key);
$a4 = file_get_contents(plugin_dir_path(__FILE__) . "resources" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Public_Certificate);
EL7:
$ns->loadKey($at, FALSE);
$G7 = new DOMDocument();
$G7->loadXML($RO);
$Nd = $G7->firstChild;
if (!empty($Zp)) {
goto loa;
}
self::insertSignature($ns, array($a4), $Nd);
goto rJf;
loa:
$ji = $G7->getElementsByTagName($Zp)->item(0);
self::insertSignature($ns, array($a4), $Nd, $ji);
rJf:
$MZ = $Nd->ownerDocument->saveXML($Nd);
$E2 = base64_encode($MZ);
return $E2;
}
public static function postSAMLRequest($qp, $D5, $XS)
{
echo "<html><body>Please wait...<form action="" . $qp . "" method="post" id="saml-request-form"><input type="hidden" name="SAMLRequest" value="" . $D5 . "" /><input type="hidden" name="RelayState" value="" . htmlentities($XS) . "" /></form><script>document.getElementById('saml-request-form').submit();</script></body></html>";
exit;
}
public static function postSAMLResponse($qp, $s4, $XS)
{
echo "<html><body>Please wait...<form action="" . $qp . "" method="post" id="saml-response-form"><input type="hidden" name="SAMLResponse" value="" . $s4 . "" /><input type="hidden" name="RelayState" value="" . htmlentities($XS) . "" /></form><script>document.getElementById('saml-response-form').submit();</script></body></html>";
exit;
}
public static function sanitize_certificate($RV)
{
$RV = preg_replace("/[
]+/", '', $RV);
$RV = str_replace("-", '', $RV);
$RV = str_replace("BEGIN CERTIFICATE", '', $RV);
$RV = str_replace("END CERTIFICATE", '', $RV);
$RV = str_replace(" ", '', $RV);
$RV = chunk_split($RV, 64, "\xd\xa");
$RV = "-----BEGIN CERTIFICATE-----\xd
" . $RV . "-----END CERTIFICATE-----";
return $RV;
}
public static function desanitize_certificate($RV)
{
$RV = preg_replace("/[
\xa]+/", '', $RV);
$RV = str_replace("-----BEGIN CERTIFICATE-----", '', $RV);
$RV = str_replace("-----END CERTIFICATE-----", '', $RV);
$RV = str_replace(" ", '', $RV);
return $RV;
}
public static function get_sites()
{
$u5 = array("network_id" => null, "public" => null, "archived" => 0, "mature" => null, "spam" => 0, "deleted" => 0, "number" => 0, "offset" => 0);
if (function_exists("get_sites") && class_exists("WP_Site_Query")) {
goto iIg;
}
if (!function_exists("wp_get_sites")) {
goto L4v;
}
$aX = wp_get_sites($u5);
L4v:
goto Uu5;
iIg:
$aX = get_sites($u5);
Uu5:
return $aX;
}
public static function get_active_sites()
{
$EK = maybe_unserialize(get_site_option("mo_enable_sso_sites"));
if (!empty($EK)) {
goto a0U;
}
$EK = array();
$aX = self::get_sites();
foreach ($aX as $GW) {
array_push($EK, $GW->blog_id);
b5A:
}
hSK:
a0U:
$r3 = self::get_main_subsite_id();
if (self::mo_saml_in_array($r3, $EK)) {
goto vBs;
}
array_push($EK, $r3);
vBs:
return $EK;
}
public static function get_all_roles()
{
$aX = self::get_sites();
$XW = array();
foreach ($aX as $GW) {
$mw = new WP_Roles($GW->blog_id);
$tw = $mw->get_names();
$XW = array_merge($XW, $tw);
ml8:
}
KpT:
return $XW;
}
public static function get_main_subsite_id()
{
$aX = self::get_sites();
$fs = get_site_option("mo_saml_sp_base_url");
if (!empty($fs)) {
goto M1C;
}
$fs = get_network_site_url();
M1C:
$lR = $fs . "/";
$n1 = parse_url($fs, PHP_URL_SCHEME);
$lR = str_replace($n1 . "://", '', $lR);
$Rf = 1;
foreach ($aX as $GW) {
$YD = $GW->domain . $GW->path;
if (!($YD == $lR)) {
goto YI1;
}
$Rf = $GW->blog_id;
YI1:
ZK1:
}
aID:
return $Rf;
}
public static function mo_saml_wp_remote_call($qp, $Ak, $u5 = array(), $Vl = false)
{
if (!$Vl) {
goto T0C;
}
$uk = wp_remote_get($qp, $u5);
goto HUb;
T0C:
$uk = wp_remote_post($qp, $u5);
HUb:
if (!is_wp_error($uk)) {
goto emv;
}
$z_ = $Ak;
update_option("mo_saml_message", "Unable to connect to the Internet. Please try again.");
$z_->mo_saml_show_error_message();
return false;
goto nFV;
emv:
return $uk["body"];
nFV:
}
public static function mo_saml_in_array($ns, $w6, $Ud = false)
{
if (!(is_array($w6) and in_array($ns, $w6, $Ud))) {
goto Dhd;
}
return true;
Dhd:
return false;
}
public static function get_box_expiry_notice_heading($wf)
{
$zW = '';
$ax = Mo_License_Service::is_license_expired();
if (true === $ax["STATUS"]) {
goto Vss;
}
if (false === $ax["STATUS"] && "LICENSE_IN_GRACE" === $ax["CODE"]) {
goto Wd9;
}
if ($wf["##remaining_days##"] <= 60) {
goto iUj;
}
goto LXp;
Vss:
$zW = "Warning : Your SSO has stopped working. Renew your license now!";
goto LXp;
Wd9:
$zW = "Your plugin has expired and SSO will stop working in <span id="mo_saml_profile_box_counter">" . esc_html($wf["##grace_days_left##"]) . "</span> days. Renew your license now to avoid disruption.";
goto LXp;
iUj:
$zW = "License Expiry Notice : Plugin License getting expired in <span id="mo_saml_profile_box_counter"> " . esc_html($wf["##remaining_days##"]) . " </span> days";
LXp:
return $zW;
}
public static function get_expiry_notice_class($Yg)
{
if ($Yg < 60 && $Yg > 0) {
goto n3n;
}
if ($Yg <= 0 && $Yg > -15) {
goto Acm;
}
if ($Yg <= -15) {
goto Gf2;
}
goto q0u;
n3n:
return "mo-saml-warning-yellow";
goto q0u;
Acm:
return "mo-saml-warning-orange";
goto q0u;
Gf2:
return "mo-saml-warning-red";
q0u:
return '';
}
public static function mo_saml_display_end_user_error_message_with_code($T3)
{
wp_die("<b>" . "[" . esc_attr($T3) . "]" . "</b> We could not sign you in. Please contact your administrator with the mentioned code.", "License is expired");
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* This file is a part of the miniorange-saml-20-single-sign-on plugin.
*
* @link https://plugins.miniorange.com/
* @author miniOrange
* @package miniorange-saml-20-single-sign-on
*/
include_once 'xmlseclibs.php';
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
use MOSAML\LicenseLibrary\Mo_License_Service;
class Utilities
{
public static function generateID()
{
return "\x5f" . self::stringToHex(self::generateRandomBytes(21));
}
public static function stringToHex($B3)
{
$Ez = '';
$zL = 0;
Lpf:
if (!($zL < strlen($B3))) {
goto u9k;
}
$Ez .= sprintf("\45\x30\x32\170", ord($B3[$zL]));
Rgl:
$zL++;
goto Lpf;
u9k:
return $Ez;
}
public static function generateRandomBytes($mX, $oU = TRUE)
{
return openssl_random_pseudo_bytes($mX);
}
public static function createAuthnRequest($lR, $xF, $TB, $cF = "\x66\141\x6c\x73\x65", $Vh = "\110\164\164\x70\x52\x65\144\x69\x72\x65\x63\x74", $hY = '')
{
$hY = "\165\x72\x6e\72\157\x61\163\151\163\x3a\156\x61\x6d\145\x73\72\x74\143\72\123\x41\x4d\x4c\x3a" . $hY;
$l4 = "\x3c\x3f\x78\x6d\154\40\x76\145\x72\x73\151\157\156\x3d\42\x31\56\x30\x22\40\145\156\143\157\144\x69\156\147\x3d\x22\125\x54\106\x2d\70\42\77\x3e" . "\74\x73\141\155\x6c\x70\72\101\x75\x74\150\156\x52\x65\161\x75\145\163\164\40\170\x6d\154\x6e\x73\72\x73\x61\x6d\154\x70\75\42\x75\162\156\x3a\x6f\141\163\151\163\x3a\156\x61\x6d\x65\163\72\x74\143\x3a\123\101\115\114\72\62\x2e\60\x3a\x70\162\157\164\157\x63\x6f\154\x22\x20\x78\x6d\x6c\x6e\x73\75\42\x75\x72\156\72\x6f\141\163\151\163\x3a\156\x61\x6d\x65\163\72\x74\143\72\x53\x41\x4d\x4c\72\x32\56\x30\72\x61\x73\163\145\x72\164\151\x6f\x6e\42\x20\x49\104\x3d\42" . self::generateID() . "\x22\x20\126\145\162\x73\151\157\x6e\x3d\x22\x32\56\x30\42\40\x49\x73\x73\165\x65\111\156\163\164\141\x6e\164\75\42" . self::generateTimestamp() . "\42";
if (!($cF == "\x74\x72\165\x65")) {
goto aFI;
}
$l4 .= "\x20\106\157\162\x63\145\x41\165\x74\150\156\x3d\x22\x74\162\x75\x65\x22";
aFI:
$l4 .= "\x20\120\162\157\x74\157\143\x6f\154\x42\x69\x6e\x64\151\x6e\147\x3d\x22\165\162\x6e\72\x6f\x61\163\x69\163\72\156\141\155\x65\163\x3a\164\143\x3a\123\x41\x4d\x4c\x3a\x32\56\60\72\142\151\156\x64\151\x6e\x67\163\72\x48\124\124\x50\55\120\117\x53\124\42\40\101\163\163\145\162\x74\151\157\156\103\157\x6e\x73\x75\155\145\162\x53\145\162\166\151\x63\145\x55\x52\114\x3d\x22" . $lR . "\x22\x20\x44\145\x73\x74\151\x6e\141\x74\x69\157\156\x3d\42" . $TB . "\42\x3e\74\163\x61\x6d\154\x3a\x49\x73\x73\x75\145\x72\x20\x78\x6d\154\156\163\x3a\x73\141\x6d\154\75\x22\x75\x72\156\72\157\141\163\151\x73\x3a\156\x61\155\x65\163\72\x74\143\x3a\x53\x41\x4d\114\x3a\62\x2e\x30\x3a\x61\x73\163\x65\162\x74\151\x6f\x6e\42\x3e" . $xF . "\74\57\x73\x61\x6d\154\72\x49\x73\163\x75\145\162\x3e\74\163\141\155\154\x70\x3a\116\141\155\145\111\104\x50\x6f\x6c\151\x63\x79\40\x41\154\x6c\x6f\167\x43\x72\x65\141\x74\145\75\x22\x74\x72\x75\x65\x22\40\106\x6f\x72\x6d\x61\164\75\x22" . $hY . "\x22\15\12\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\x20\40\40\40\x2f\x3e\x3c\x2f\x73\141\155\154\160\x3a\x41\x75\164\x68\x6e\122\145\x71\165\x65\x73\164\x3e";
if (empty($Vh) || $Vh == "\x48\x74\x74\160\x52\145\144\151\x72\x65\x63\x74") {
goto GAo;
}
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
update_site_option("\x6d\x6f\137\x73\x61\155\154\x5f\x72\x65\x71\x75\x65\163\x74", $mD);
goto ClF;
GAo:
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
update_site_option("\x6d\x6f\x5f\163\x61\x6d\154\137\x72\145\x71\x75\x65\x73\164", $mD);
$A0 = urlencode($mD);
$l4 = $A0;
ClF:
return $l4;
}
public static function createLogoutRequest($DV, $xF, $TB, $x5 = '', $nu = "\x48\x74\164\x70\x52\145\x64\151\162\x65\143\164")
{
$l4 = "\x3c\77\170\155\x6c\40\166\x65\x72\163\x69\157\156\75\x22\61\56\x30\x22\x20\145\156\143\x6f\144\x69\156\147\75\x22\125\124\x46\x2d\x38\x22\x3f\76" . "\x3c\x73\141\155\x6c\x70\72\x4c\157\147\157\165\164\122\x65\161\165\145\163\164\40\170\x6d\x6c\156\x73\72\x73\x61\x6d\154\x70\x3d\x22\x75\162\x6e\x3a\x6f\141\163\x69\x73\x3a\x6e\141\155\x65\163\72\164\x63\x3a\123\x41\115\114\72\x32\x2e\60\72\160\162\x6f\x74\x6f\143\x6f\x6c\42\40\x78\x6d\154\x6e\163\x3a\x73\141\x6d\154\x3d\42\165\x72\156\x3a\157\x61\163\151\x73\72\156\x61\x6d\145\163\72\x74\x63\x3a\x53\x41\115\x4c\x3a\62\56\x30\72\x61\x73\x73\145\x72\164\151\x6f\156\x22\40\111\104\x3d\42" . self::generateID() . "\x22\40\x49\163\x73\165\145\x49\156\x73\x74\141\156\x74\75\x22" . self::generateTimestamp() . "\42\40\x56\x65\162\163\151\x6f\156\x3d\x22\62\56\x30\42\x20\x44\x65\163\x74\x69\156\141\x74\151\x6f\156\75\x22" . $TB . "\42\x3e\xd\xa\11\11\x9\x9\x9\x9\x3c\163\141\x6d\x6c\72\x49\x73\x73\165\x65\x72\40\170\x6d\154\156\163\x3a\163\x61\x6d\154\75\x22\x75\x72\156\72\157\141\x73\x69\x73\72\x6e\x61\155\x65\163\x3a\164\143\x3a\123\x41\x4d\114\x3a\x32\x2e\60\x3a\x61\x73\163\145\x72\164\x69\157\x6e\42\x3e" . $xF . "\74\x2f\x73\141\155\154\x3a\x49\x73\163\x75\x65\x72\76\xd\xa\11\11\x9\x9\x9\11\74\163\141\x6d\x6c\72\116\x61\155\x65\x49\x44\x20\x78\155\x6c\x6e\x73\x3a\x73\x61\155\154\75\42\x75\x72\x6e\x3a\x6f\x61\x73\x69\x73\72\156\x61\x6d\145\x73\x3a\164\x63\x3a\x53\x41\x4d\x4c\x3a\62\x2e\60\72\x61\x73\x73\145\x72\164\x69\x6f\156\x22\x3e" . $DV[0] . "\74\57\x73\x61\155\x6c\72\x4e\141\x6d\145\x49\104\x3e";
if (empty($x5)) {
goto OR2;
}
$l4 .= "\x3c\x73\x61\155\x6c\160\72\x53\145\x73\x73\151\x6f\156\111\x6e\144\x65\170\76" . $x5[0] . "\74\x2f\x73\x61\155\154\160\72\123\x65\163\163\x69\157\x6e\x49\156\x64\x65\170\76";
OR2:
$l4 .= "\x3c\57\x73\141\155\154\160\x3a\x4c\157\x67\157\x75\164\x52\x65\161\x75\145\163\164\x3e";
if (!(empty($nu) || $nu == "\110\x74\x74\160\122\145\144\x69\162\145\x63\x74")) {
goto i2W;
}
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
$A0 = urlencode($mD);
$l4 = $A0;
i2W:
return $l4;
}
public static function createLogoutResponse($lQ, $xF, $TB, $nu = "\x48\164\x74\x70\122\x65\144\151\162\145\x63\x74")
{
$l4 = "\74\77\x78\x6d\154\x20\x76\x65\162\x73\151\157\156\x3d\42\61\x2e\x30\x22\x20\145\x6e\143\157\144\151\156\147\75\42\x55\124\106\55\70\42\x3f\x3e" . "\74\163\x61\x6d\154\160\x3a\114\x6f\147\x6f\165\164\122\145\x73\x70\x6f\156\163\x65\x20\170\155\154\x6e\x73\72\x73\141\155\x6c\160\x3d\42\165\162\x6e\x3a\x6f\141\x73\x69\x73\x3a\156\141\x6d\145\x73\72\x74\143\72\x53\101\x4d\x4c\x3a\62\x2e\x30\x3a\160\x72\157\x74\157\x63\x6f\x6c\x22\40\x78\x6d\x6c\x6e\x73\x3a\163\141\155\x6c\x3d\42\x75\x72\x6e\x3a\x6f\141\x73\x69\163\72\156\x61\155\x65\x73\x3a\164\x63\72\123\101\115\114\x3a\62\x2e\60\x3a\141\x73\x73\145\162\164\x69\x6f\x6e\x22\x20" . "\x49\x44\x3d\x22" . self::generateID() . "\42\40" . "\x56\x65\162\163\x69\x6f\156\x3d\x22\x32\56\x30\42\40\111\x73\x73\165\x65\111\156\163\164\141\x6e\164\x3d\42" . self::generateTimestamp() . "\x22\40" . "\104\145\x73\x74\x69\156\141\x74\151\157\x6e\75\42" . $TB . "\42\x20" . "\x49\156\x52\145\163\x70\x6f\x6e\163\x65\x54\x6f\x3d\42" . $lQ . "\42\x3e" . "\74\163\141\155\154\x3a\x49\x73\163\x75\x65\162\40\170\155\154\x6e\x73\72\x73\x61\155\154\x3d\42\x75\x72\x6e\x3a\157\141\x73\151\163\72\156\141\155\145\163\72\x74\x63\72\123\x41\115\114\x3a\62\56\60\x3a\141\x73\163\145\162\x74\151\x6f\x6e\42\76" . $xF . "\74\57\x73\141\x6d\x6c\72\x49\x73\x73\165\145\x72\x3e" . "\74\163\141\x6d\x6c\x70\72\x53\x74\141\164\165\x73\x3e\x3c\163\141\155\x6c\160\72\x53\164\x61\x74\x75\x73\x43\x6f\x64\145\x20\x56\x61\x6c\x75\145\x3d\42\165\162\156\x3a\157\x61\x73\151\163\72\156\141\155\x65\x73\x3a\164\x63\72\123\101\115\x4c\x3a\62\x2e\60\72\163\164\141\164\x75\x73\72\x53\165\143\x63\145\x73\163\42\57\x3e\x3c\57\163\141\155\154\160\72\123\164\141\164\x75\x73\76\74\x2f\163\x61\x6d\154\x70\72\x4c\157\x67\157\x75\x74\122\145\163\160\x6f\x6e\163\x65\x3e";
if (!(empty($nu) || $nu == "\110\164\x74\160\x52\145\144\x69\x72\145\x63\164")) {
goto Fv9;
}
$ri = gzdeflate($l4);
$mD = base64_encode($ri);
$A0 = urlencode($mD);
$l4 = $A0;
Fv9:
return $l4;
}
public static function generateTimestamp($XK = NULL)
{
if (!($XK === NULL)) {
goto A2m;
}
$XK = time();
A2m:
return gmdate("\131\x2d\x6d\x2d\144\x5c\124\x48\72\x69\72\163\x5c\132", $XK);
}
public static function xpQuery(DOMNode $c4, $oi)
{
static $Zu = NULL;
if ($c4 instanceof DOMDocument) {
goto U38;
}
$Hy = $c4->ownerDocument;
goto ZBh;
U38:
$Hy = $c4;
ZBh:
if (!($Zu === NULL || !$Zu->document->isSameNode($Hy))) {
goto Mwi;
}
$Zu = new DOMXPath($Hy);
$Zu->registerNamespace("\x73\x6f\141\x70\55\145\156\166", "\x68\164\x74\160\72\x2f\57\x73\x63\x68\145\x6d\141\x73\56\x78\155\x6c\x73\157\141\x70\56\157\x72\x67\57\163\157\x61\160\57\145\156\166\x65\x6c\x6f\160\145\x2f");
$Zu->registerNamespace("\x73\141\x6d\x6c\x5f\160\x72\x6f\x74\157\x63\157\x6c", "\x75\162\x6e\x3a\157\x61\163\151\163\72\x6e\x61\155\145\163\72\164\143\x3a\x53\x41\x4d\114\72\62\56\x30\72\x70\x72\x6f\164\157\x63\x6f\154");
$Zu->registerNamespace("\163\x61\155\154\x5f\141\163\x73\145\x72\164\151\157\x6e", "\165\162\156\72\157\x61\x73\x69\x73\x3a\156\141\155\x65\x73\x3a\x74\143\72\x53\101\x4d\114\72\x32\56\60\72\x61\x73\x73\x65\162\164\151\x6f\156");
$Zu->registerNamespace("\163\141\x6d\x6c\x5f\x6d\145\164\141\144\141\164\x61", "\165\x72\156\72\x6f\141\163\x69\163\x3a\x6e\x61\x6d\145\x73\x3a\164\143\x3a\x53\x41\115\x4c\x3a\62\x2e\60\72\x6d\x65\164\141\144\141\x74\x61");
$Zu->registerNamespace("\144\x73", "\150\164\x74\160\x3a\57\57\x77\x77\x77\x2e\x77\x33\56\x6f\x72\147\x2f\x32\x30\60\x30\x2f\60\71\x2f\170\x6d\154\144\x73\x69\147\x23");
$Zu->registerNamespace("\170\x65\156\x63", "\150\164\x74\x70\x3a\x2f\57\167\x77\x77\56\x77\63\x2e\157\162\x67\57\62\x30\60\61\x2f\60\x34\57\170\x6d\154\145\x6e\143\x23");
Mwi:
$CD = $Zu->query($oi, $c4);
$Ez = array();
$zL = 0;
Wd5:
if (!($zL < $CD->length)) {
goto BkZ;
}
$Ez[$zL] = $CD->item($zL);
T89:
$zL++;
goto Wd5;
BkZ:
return $Ez;
}
public static function parseNameId(DOMElement $RO)
{
$Ez = array("\126\141\154\x75\x65" => trim($RO->textContent));
foreach (array("\116\141\x6d\x65\121\165\141\x6c\151\146\151\145\162", "\123\120\116\x61\155\x65\x51\x75\141\154\x69\x66\151\x65\162", "\x46\157\x72\155\x61\x74") as $a6) {
if (!$RO->hasAttribute($a6)) {
goto I1w;
}
$Ez[$a6] = $RO->getAttribute($a6);
I1w:
M52:
}
UAi:
return $Ez;
}
public static function xsDateTimeToTimestamp($W3)
{
$Ry = array();
$Sh = "\x2f\x5e\50\134\144\x5c\x64\x5c\144\134\x64\x29\55\x28\134\144\134\x64\51\x2d\50\134\144\x5c\144\51\x54\x28\134\x64\134\144\51\72\50\134\144\x5c\x64\51\72\x28\x5c\x64\x5c\144\51\50\77\72\x5c\56\x5c\x64\x2b\51\x3f\132\44\57\x44";
if (!(preg_match($Sh, $W3, $Ry) == 0)) {
goto IKd;
}
echo sprintf("\156\x76\141\154\151\144\x20\x53\101\115\114\x32\40\x74\x69\x6d\x65\x73\164\x61\x6d\160\x20\160\x61\163\x73\x65\x64\40\164\157\x20\170\163\104\141\164\145\x54\151\155\x65\x54\157\x54\x69\x6d\145\163\x74\141\155\160\x3a\x20" . $W3);
exit;
IKd:
$aY = intval($Ry[1]);
$xv = intval($Ry[2]);
$JS = intval($Ry[3]);
$CB = intval($Ry[4]);
$vl = intval($Ry[5]);
$YH = intval($Ry[6]);
$IF = gmmktime($CB, $vl, $YH, $xv, $JS, $aY);
return $IF;
}
public static function extractStrings(DOMElement $dV, $Dn, $N7)
{
$Ez = array();
$c4 = $dV->firstChild;
jrr:
if (!($c4 !== NULL)) {
goto OBJ;
}
if (!($c4->namespaceURI !== $Dn || $c4->localName !== $N7)) {
goto u3y;
}
goto puK;
u3y:
$Ez[] = trim($c4->textContent);
puK:
$c4 = $c4->nextSibling;
goto jrr;
OBJ:
return $Ez;
}
public static function validateElement(DOMElement $Bs)
{
$Dk = new XMLSecurityDSig();
$Dk->idKeys[] = "\x49\104";
$Xx = self::xpQuery($Bs, "\56\x2f\x64\163\x3a\x53\x69\x67\156\x61\164\x75\162\x65");
if (count($Xx) === 0) {
goto LJH;
}
if (count($Xx) > 1) {
goto Fgr;
}
goto uee;
LJH:
return FALSE;
goto uee;
Fgr:
echo sprintf("\130\115\x4c\x53\x65\x63\72\x20\155\x6f\162\x65\40\x74\150\141\x6e\x20\157\156\145\x20\x73\x69\x67\x6e\141\164\165\x72\x65\40\x65\x6c\x65\x6d\145\156\x74\40\151\x6e\x20\x72\x6f\x6f\x74\56");
exit;
uee:
$Xx = $Xx[0];
$Dk->sigNode = $Xx;
$Dk->canonicalizeSignedInfo();
if ($Dk->validateReference()) {
goto jkK;
}
echo sprintf("\x58\x4d\x4c\x73\x65\143\72\40\x64\x69\x67\145\x73\164\x20\166\141\x6c\x69\144\x61\164\x69\x6f\x6e\x20\x66\141\x69\x6c\145\144");
exit;
jkK:
$mT = FALSE;
foreach ($Dk->getValidatedNodes() as $dt) {
if ($dt->isSameNode($Bs)) {
goto mz2;
}
if ($Bs->parentNode instanceof DOMDocument && $dt->isSameNode($Bs->ownerDocument)) {
goto AEj;
}
goto w0x;
mz2:
$mT = TRUE;
goto NAp;
goto w0x;
AEj:
$mT = TRUE;
goto NAp;
w0x:
yjH:
}
NAp:
if ($mT) {
goto cw0;
}
echo sprintf("\x58\115\114\x53\145\143\72\40\x54\150\x65\x20\x72\157\157\164\40\x65\x6c\x65\155\x65\x6e\164\x20\151\163\x20\156\x6f\x74\40\x73\x69\x67\156\145\144\x2e");
exit;
cw0:
$Bg = array();
foreach (self::xpQuery($Xx, "\56\x2f\144\x73\72\x4b\145\x79\x49\x6e\146\x6f\57\x64\163\72\x58\65\60\71\x44\x61\x74\x61\57\144\163\72\x58\65\60\71\103\145\x72\x74\x69\x66\x69\143\x61\x74\145") as $wY) {
$sS = trim($wY->textContent);
$sS = str_replace(array("\xd", "\12", "\x9", "\40"), '', $sS);
$Bg[] = $sS;
kMi:
}
mRv:
$Ez = array("\123\151\147\x6e\x61\x74\165\x72\145" => $Dk, "\103\145\x72\x74\151\146\151\x63\141\x74\x65\x73" => $Bg);
return $Ez;
}
public static function validateSignature(array $Gi, XMLSecurityKey $ns)
{
$Dk = $Gi["\123\151\147\156\x61\x74\165\162\145"];
$E1 = self::xpQuery($Dk->sigNode, "\56\x2f\x64\x73\72\x53\151\147\x6e\145\144\x49\156\146\157\x2f\x64\x73\72\123\x69\147\x6e\x61\164\x75\x72\x65\x4d\145\164\x68\x6f\x64");
if (!empty($E1)) {
goto x4U;
}
echo sprintf("\115\151\x73\163\151\x6e\x67\x20\123\151\x67\156\x61\x74\x75\x72\x65\115\x65\x74\x68\157\x64\x20\x65\x6c\x65\155\x65\x6e\x74");
exit;
x4U:
$E1 = $E1[0];
if ($E1->hasAttribute("\x41\154\x67\157\162\151\164\x68\155")) {
goto PmD;
}
echo sprintf("\115\151\163\x73\x69\156\x67\40\x41\154\147\x6f\162\151\x74\x68\x6d\55\x61\164\x74\162\151\x62\165\164\x65\40\157\156\x20\123\x69\x67\x6e\141\x74\x75\x72\145\x4d\x65\x74\x68\157\144\x20\145\154\x65\155\145\x6e\x74\56");
exit;
PmD:
$QW = $E1->getAttribute("\101\x6c\x67\157\162\x69\164\150\x6d");
if (!($ns->type === XMLSecurityKey::RSA_SHA1 && $QW !== $ns->type)) {
goto JAs;
}
$ns = self::castKey($ns, $QW);
JAs:
if ($Dk->verify($ns)) {
goto kIE;
}
return false;
kIE:
}
public static function castKey(XMLSecurityKey $ns, $dC, $CL = "\x70\x75\142\x6c\x69\143")
{
if (!($ns->type === $dC)) {
goto eCo;
}
return $ns;
eCo:
$e6 = openssl_pkey_get_details($ns->key);
if (!($e6 === FALSE)) {
goto nZU;
}
echo sprintf("\125\156\141\x62\154\145\40\164\x6f\40\147\145\x74\40\x6b\145\171\40\144\145\x74\x61\x69\154\x73\x20\146\162\157\x6d\x20\x58\115\114\123\145\x63\x75\x72\151\164\171\x4b\x65\x79\56");
exit;
nZU:
if (!empty($e6["\153\x65\x79"])) {
goto E0c;
}
echo sprintf("\x4d\151\163\x73\x69\156\147\x20\x6b\x65\x79\40\151\156\40\160\165\x62\154\151\143\x20\153\145\171\x20\x64\x65\164\141\151\154\163\56");
exit;
E0c:
$Ao = new XMLSecurityKey($dC, array("\x74\171\x70\x65" => $CL));
$Ao->loadKey($e6["\x6b\145\x79"]);
return $Ao;
}
public static function processResponse($xu, $XF, $OA, SAML2_Response $uk, $Rc, $XS)
{
$Cl = current($uk->getAssertions());
$iP = $Cl->getNotBefore();
if (!($iP !== NULL && $iP > time() + 60)) {
goto Np2;
}
wp_die("\x52\145\143\x65\x69\166\x65\x64\x20\141\156\40\141\163\163\x65\162\164\151\x6f\156\x20\x74\150\x61\x74\x20\x69\163\40\166\141\x6c\151\x64\40\151\156\x20\164\x68\x65\x20\146\x75\x74\x75\x72\145\56\x20\x43\150\x65\143\153\x20\x63\154\157\143\153\x20\163\171\156\143\x68\x72\157\156\151\172\x61\164\x69\157\156\40\x6f\156\x20\111\144\120\40\141\x6e\x64\x20\x53\x50\56");
Np2:
$BX = $Cl->getNotOnOrAfter();
if (!($BX !== NULL && $BX <= time() - 60)) {
goto FIR;
}
wp_die("\x52\x65\143\145\151\x76\x65\x64\x20\x61\156\40\141\x73\163\x65\162\164\151\x6f\156\x20\164\150\x61\x74\40\150\x61\x73\x20\145\170\160\151\x72\145\x64\56\x20\x43\150\145\x63\153\40\143\x6c\157\143\x6b\40\163\171\156\143\150\x72\157\156\151\x7a\141\x74\151\157\156\x20\157\x6e\40\x49\x64\x50\40\x61\156\x64\40\x53\120\x2e");
FIR:
$AN = $Cl->getSessionNotOnOrAfter();
if (!($AN !== NULL && $AN <= time() - 60)) {
goto i7M;
}
wp_die("\x52\145\x63\145\x69\x76\145\x64\x20\141\156\x20\x61\163\163\x65\162\164\151\157\x6e\x20\x77\x69\x74\x68\40\141\40\x73\x65\x73\163\x69\x6f\x6e\40\x74\x68\141\164\x20\x68\141\163\x20\x65\170\x70\x69\x72\145\x64\x2e\x20\103\x68\145\143\153\x20\143\x6c\157\x63\153\40\x73\x79\x6e\x63\x68\x72\157\156\x69\x7a\x61\164\x69\157\x6e\x20\157\x6e\40\x49\144\120\40\141\x6e\144\40\123\x50\x2e");
i7M:
$WW = $uk->getDestination();
if (!(substr($WW, -1) == "\57")) {
goto skS;
}
$WW = substr($WW, 0, -1);
skS:
if (!(substr($xu, -1) == "\57")) {
goto r6w;
}
$xu = substr($xu, 0, -1);
r6w:
if (!($WW !== NULL && $WW !== $xu)) {
goto wqE;
}
echo "\104\145\x73\164\151\156\x61\x74\151\157\x6e\40\x69\156\40\162\x65\x73\x70\157\x6e\163\x65\x20\x64\157\145\x73\156\x27\x74\40\155\x61\x74\x63\150\x20\164\150\x65\40\143\165\x72\x72\x65\156\164\40\125\122\114\56\40\104\145\163\x74\x69\156\141\164\151\157\156\40\151\x73\x20\x22" . htmlspecialchars($WW) . "\42\x2c\40\x63\165\162\162\145\156\164\x20\125\x52\114\x20\x69\x73\40\x22" . htmlspecialchars($xu) . "\x22\56";
exit;
wqE:
$F7 = self::checkSign($XF, $OA, $Rc, $XS);
return $F7;
}
public static function checkSign($XF, $OA, $Rc, $XS)
{
$Bg = $OA["\103\x65\162\x74\151\146\x69\x63\x61\x74\145\x73"];
if (count($Bg) === 0) {
goto t9J;
}
$ui = array();
$ui[] = $XF;
$lr = self::findCertificate($ui, $Bg, $XS);
if ($lr) {
goto yYl;
}
return FALSE;
yYl:
goto e11;
t9J:
$g7 = maybe_unserialize(get_site_option("\x73\141\x6d\154\x5f\x78\x35\60\71\x5f\x63\145\162\x74\151\146\151\x63\141\164\145"));
$lr = $g7[$Rc];
e11:
$t7 = NULL;
$ns = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array("\164\171\x70\x65" => "\x70\165\x62\154\151\143"));
$ns->loadKey($lr);
try {
self::validateSignature($OA, $ns);
return TRUE;
} catch (Exception $XJ) {
$t7 = $XJ;
return FALSE;
}
if ($t7 !== NULL) {
goto rC9;
}
return FALSE;
goto rnM;
rC9:
throw $t7;
rnM:
}
public static function validateIssuerAndAudience($xb, $eP, $eX, $XS)
{
$xF = current($xb->getAssertions())->getIssuer();
$Cl = current($xb->getAssertions());
$LH = $Cl->getValidAudiences();
if (strcmp($eX, $xF) === 0) {
goto EoT;
}
if ($XS == "\164\x65\x73\x74\x56\x61\x6c\151\144\141\x74\145" or $XS == "\x74\145\x73\164\116\145\167\x43\145\162\164\151\146\151\x63\x61\164\x65") {
goto L2o;
}
wp_die("\127\145\x20\143\x6f\165\154\x64\40\156\x6f\x74\40\x73\151\x67\x6e\x20\x79\157\165\40\151\x6e\x2e\x20\x50\x6c\145\141\163\145\x20\143\157\156\x74\x61\143\164\40\x79\157\165\x72\x20\101\x64\x6d\x69\156\x69\163\164\x72\x61\x74\x6f\x72", "\105\x72\x72\x6f\x72\x20\x3a\111\x73\x73\x75\x65\162\x20\x63\x61\x6e\156\x6f\x74\40\x62\x65\x20\166\x65\x72\x69\x66\x69\x65\x64");
goto kka;
L2o:
ob_end_clean();
$W_ = mo_options_error_constants::Error_issuer_not_verfied;
$FQ = mo_options_error_constants::Cause_issuer_not_verfied;
echo "\74\x64\151\x76\x20\163\x74\x79\x6c\x65\75\x22\146\x6f\x6e\164\55\x66\x61\155\x69\154\171\72\x43\x61\154\x69\142\x72\x69\x3b\x70\141\144\144\151\156\x67\x3a\x30\x20\63\x25\x3b\x22\x3e";
echo "\74\144\x69\166\x20\163\164\171\154\145\75\x22\143\x6f\154\157\x72\x3a\40\x23\x61\71\x34\64\x34\x32\73\x62\141\143\153\x67\162\x6f\165\x6e\x64\55\143\157\x6c\157\162\72\x20\43\146\x32\x64\x65\144\145\x3b\160\x61\x64\x64\x69\156\x67\x3a\x20\61\65\x70\x78\73\155\x61\162\x67\x69\156\x2d\x62\x6f\x74\164\157\155\x3a\x20\62\60\160\x78\x3b\164\145\170\164\55\141\x6c\x69\147\156\72\x63\145\x6e\164\x65\162\x3b\142\157\162\144\145\162\72\61\160\170\40\x73\x6f\x6c\151\144\40\x23\x45\x36\102\63\102\62\x3b\146\157\156\x74\55\x73\x69\x7a\x65\x3a\61\70\x70\164\x3b\42\x3e\x20\105\122\122\x4f\122\74\57\x64\x69\166\x3e\15\12\x9\x9\x9\40\74\144\x69\x76\x20\163\x74\171\154\145\75\42\x63\x6f\154\157\x72\72\x20\x23\141\x39\x34\64\x34\62\73\x66\157\x6e\164\55\163\151\172\145\72\x31\x34\x70\164\73\x20\x6d\x61\162\x67\151\156\55\x62\x6f\164\164\x6f\155\x3a\62\60\x70\170\73\x22\x3e\x3c\x70\76\74\x73\x74\162\157\156\147\76\105\x72\x72\x6f\x72\72\40\74\57\163\x74\x72\x6f\x6e\147\76\x49\163\x73\x75\x65\162\40\x63\141\x6e\x6e\x6f\x74\40\142\145\40\166\145\x72\151\146\x69\145\144\x2e\x3c\57\x70\76\15\xa\11\x9\11\40\x3c\160\x3e\120\x6c\145\141\163\x65\x20\143\x6f\156\164\x61\143\x74\40\x79\157\165\x72\40\141\x64\155\151\x6e\x69\x73\164\162\141\164\x6f\162\40\141\156\144\x20\162\145\x70\x6f\162\164\40\x74\x68\145\x20\146\157\x6c\x6c\157\167\x69\x6e\147\40\145\162\x72\x6f\x72\x3a\74\x2f\x70\x3e\xd\12\x9\11\x9\40\74\160\x3e\x3c\x73\164\162\x6f\x6e\147\76\x50\x6f\163\x73\151\x62\154\145\40\103\x61\x75\x73\x65\x3a\x20\x3c\57\163\164\162\157\x6e\x67\76\111\144\120\40\x45\156\164\x69\x74\171\40\111\104\40\x63\x6f\x6e\146\151\x67\x75\x72\x65\144\40\x69\156\40\164\150\x65\40\x70\154\x75\147\x69\x6e\40\151\x73\x20\x69\156\x63\157\x72\162\x65\143\164\x3c\57\x70\x3e\15\12\x9\11\11\40\74\x70\76\x3c\163\x74\162\157\x6e\147\76\105\x6e\x74\151\164\x79\x20\111\104\40\151\156\40\x53\x41\x4d\x4c\40\122\x65\163\x70\x6f\156\x73\x65\72\x20\74\57\x73\164\162\x6f\x6e\147\x3e" . esc_html($xF) . "\74\x70\76\xd\xa\11\x9\x9\40\x3c\x70\x3e\74\x73\164\x72\x6f\x6e\x67\x3e\x45\x6e\x74\151\x74\171\x20\x49\104\40\143\157\156\146\x69\147\x75\162\145\144\40\151\156\40\164\x68\x65\40\x70\x6c\165\147\x69\156\72\40\74\x2f\163\x74\x72\x6f\156\x67\x3e" . esc_html($eX) . "\74\x2f\x70\x3e\15\xa\x9\11\x9\40\x3c\160\x3e\74\x73\164\162\157\x6e\147\x3e\123\x6f\154\x75\x74\151\157\x6e\72\74\x2f\x73\x74\x72\157\156\x67\76\74\57\160\76\xd\12\11\x9\x9\x9\74\157\x6c\x3e\15\12\x9\11\x9\x9\x9\74\154\151\x3e\103\x6f\160\x79\x20\x74\150\145\40\105\x6e\164\x69\164\171\40\x49\x44\40\x6f\x66\40\123\x41\x4d\x4c\x20\122\145\163\x70\157\x6e\x73\145\40\146\162\157\x6d\40\141\x62\x6f\166\x65\x20\x61\x6e\144\40\160\x61\x73\164\x65\x20\151\164\x20\151\156\40\x45\x6e\164\x69\164\x79\x20\111\104\x20\x6f\162\40\111\x73\x73\x75\145\x72\40\x66\151\145\154\x64\x20\165\156\144\x65\x72\40\123\145\x72\x76\x69\x63\x65\x20\120\162\157\x76\x69\x64\x65\162\x20\123\x65\x74\x75\160\40\164\x61\x62\x2e\x3c\57\154\x69\x3e\15\xa\x9\x9\11\x9\74\57\x6f\x6c\76\xd\12\x9\11\11\x20\x3c\57\x64\151\x76\x3e\xd\xa\11\x9\11\40\74\x64\151\x76\x20\x73\x74\x79\154\145\x3d\42\155\x61\x72\x67\151\x6e\72\63\x25\x3b\144\x69\163\x70\x6c\x61\x79\72\x62\x6c\157\143\x6b\73\x74\x65\170\164\55\141\154\151\x67\156\72\143\145\156\164\145\162\x3b\42\76\15\12\11\x9\11\40\x3c\144\x69\166\40\163\x74\x79\154\145\75\42\x6d\x61\162\x67\x69\156\x3a\63\45\73\144\x69\x73\x70\x6c\141\x79\x3a\x62\154\157\143\153\73\x74\145\170\x74\55\141\x6c\151\x67\156\72\x63\x65\x6e\x74\x65\162\73\42\76\74\151\156\x70\165\x74\x20\163\164\x79\x6c\x65\x3d\42\160\x61\144\x64\x69\x6e\x67\x3a\61\x25\x3b\x77\151\144\164\150\72\61\x30\x30\160\170\73\142\x61\143\153\147\x72\x6f\165\156\x64\x3a\x20\x23\x30\x30\x39\x31\103\104\x20\x6e\157\x6e\145\40\x72\145\160\145\141\164\40\x73\143\x72\157\x6c\154\x20\60\45\40\60\45\73\143\165\162\x73\157\x72\72\x20\160\x6f\x69\x6e\x74\145\162\x3b\x66\x6f\156\x74\55\163\151\172\145\x3a\x31\x35\x70\170\x3b\142\x6f\x72\144\145\162\55\167\151\144\164\x68\72\40\61\160\x78\73\x62\157\x72\x64\145\x72\55\163\164\x79\x6c\145\x3a\40\x73\157\154\x69\x64\x3b\x62\x6f\162\x64\145\162\x2d\x72\141\x64\x69\165\x73\x3a\x20\x33\160\170\x3b\167\150\x69\164\x65\55\163\x70\x61\143\145\x3a\40\156\x6f\167\x72\x61\x70\73\x62\x6f\170\x2d\x73\151\x7a\151\156\147\72\x20\x62\157\x72\x64\x65\162\55\142\x6f\x78\73\x62\x6f\x72\x64\x65\162\55\x63\x6f\x6c\157\x72\72\40\43\60\60\x37\x33\x41\x41\73\x62\157\170\x2d\x73\x68\x61\144\157\x77\72\40\x30\160\170\x20\61\x70\x78\x20\60\x70\x78\40\162\x67\x62\141\50\x31\x32\60\54\40\62\x30\x30\54\x20\x32\63\60\54\40\60\56\66\x29\40\151\x6e\163\x65\164\73\x63\x6f\154\x6f\x72\72\40\x23\x46\106\106\73\x22\164\x79\x70\145\x3d\x22\x62\x75\164\164\157\156\42\40\x76\x61\154\165\145\75\x22\x44\x6f\156\145\x22\40\157\x6e\103\154\151\x63\153\75\x22\163\145\154\x66\56\143\x6c\x6f\163\145\x28\51\x3b\42\76\x3c\57\x64\x69\166\76";
mo_saml_download_logs($W_, $FQ);
exit;
kka:
goto js8;
EoT:
if (empty($LH)) {
goto yFW;
}
if (self::mo_saml_in_array($eP, $LH, TRUE)) {
goto EyI;
}
if ($XS == "\164\145\x73\164\x56\x61\x6c\151\x64\x61\164\145" or $XS == "\x74\x65\163\164\x4e\x65\167\103\x65\x72\x74\x69\146\x69\143\x61\164\145") {
goto kPW;
}
wp_die("\127\145\40\143\x6f\165\154\x64\x20\156\157\164\40\163\151\x67\156\40\x79\x6f\165\x20\151\x6e\56\40\120\154\145\x61\163\145\x20\x63\157\x6e\x74\141\143\164\40\171\157\165\162\x20\x41\144\155\151\x6e\x69\x73\x74\162\141\x74\157\162", "\x45\162\x72\157\162\x20\x3a\111\x6e\x76\x61\x6c\x69\x64\x20\x41\x75\x64\x69\x65\x6e\x63\x65\x20\x55\122\111");
goto eOT;
kPW:
$W_ = mo_options_error_constants::Error_invalid_audience;
$FQ = mo_options_error_constants::Cause_invalid_audience;
ob_end_clean();
echo "\74\x64\151\x76\x20\x73\164\171\154\x65\x3d\42\146\157\156\x74\55\146\141\155\x69\x6c\171\x3a\103\141\x6c\151\142\x72\151\x3b\x70\141\x64\144\151\x6e\x67\72\60\x20\63\x25\x3b\x22\76";
echo "\74\x64\x69\x76\x20\x73\x74\x79\x6c\x65\x3d\42\143\x6f\154\x6f\162\x3a\40\x23\141\71\x34\x34\x34\62\x3b\142\x61\143\x6b\x67\162\x6f\x75\156\144\x2d\143\x6f\x6c\x6f\x72\72\x20\x23\146\x32\x64\145\x64\x65\x3b\x70\x61\x64\x64\x69\156\147\72\x20\x31\65\x70\170\73\155\141\x72\x67\151\156\x2d\x62\x6f\164\164\157\x6d\72\40\x32\60\x70\x78\x3b\164\145\170\x74\55\x61\154\x69\147\156\x3a\x63\145\156\164\145\162\x3b\142\157\x72\144\145\x72\x3a\61\x70\170\40\163\157\154\x69\144\40\x23\x45\66\102\x33\x42\62\x3b\x66\x6f\156\164\55\x73\151\x7a\x65\72\x31\x38\160\164\x3b\x22\x3e\x20\x45\122\x52\117\x52\74\x2f\x64\x69\x76\76\xd\xa\x20\40\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\40\x20\x20\40\40\74\144\151\x76\x20\163\x74\171\154\145\x3d\42\143\x6f\154\157\x72\72\40\43\141\x39\64\x34\x34\x32\x3b\146\157\156\x74\x2d\163\x69\172\145\x3a\x31\x34\x70\x74\73\x20\155\141\x72\147\151\156\55\142\157\x74\164\157\155\72\62\60\x70\170\73\42\76\74\160\x3e\74\x73\x74\x72\x6f\x6e\147\x3e\105\162\162\157\162\72\40\74\57\163\x74\162\x6f\156\147\76\111\156\166\x61\154\x69\144\40\x41\x75\x64\151\x65\156\143\x65\x20\125\x52\x49\56\74\57\x70\76\15\12\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\74\160\76\x50\x6c\x65\x61\163\145\40\143\157\156\x74\141\x63\x74\x20\x79\x6f\165\x72\40\x61\144\x6d\151\156\x69\163\x74\162\x61\x74\157\x72\40\x61\156\144\x20\162\x65\x70\157\x72\x74\40\164\x68\x65\40\146\x6f\154\x6c\157\x77\x69\156\x67\x20\145\x72\162\x6f\x72\x3a\x3c\57\x70\x3e\xd\xa\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\40\40\74\x70\x3e\x3c\x73\x74\x72\157\156\x67\x3e\x50\x6f\x73\x73\x69\x62\154\145\40\x43\141\165\x73\145\72\x20\74\57\163\164\162\x6f\x6e\x67\76\124\150\x65\x20\x76\141\154\x75\145\40\x6f\146\40\x27\101\x75\x64\x69\145\156\x63\145\x20\x55\122\x49\x27\x20\146\x69\x65\154\x64\x20\157\x6e\x20\111\x64\145\156\x74\x69\x74\x79\x20\120\x72\x6f\x76\x69\144\x65\x72\47\163\x20\163\151\144\145\x20\151\163\x20\x69\x6e\143\x6f\162\162\x65\x63\164\74\x2f\x70\76\xd\12\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x3c\x70\76\105\x78\160\x65\x63\164\x65\144\40\x6f\x6e\145\x20\157\x66\x20\164\x68\x65\40\x41\x75\144\x69\x65\x6e\x63\x65\x73\x20\164\x6f\x20\142\145\x3a\x20" . $eP . "\74\160\x3e\15\12\x9\x9\11\x9\11\74\x70\x3e\74\163\164\x72\x6f\156\147\76\x53\157\154\x75\164\151\157\156\x3a\x3c\x2f\x73\x74\x72\x6f\156\147\x3e\74\57\x70\76\15\xa\11\11\11\x9\x9\x3c\157\x6c\76\15\xa\11\x9\x9\11\x9\x9\74\154\151\x3e\103\157\160\171\x20\164\150\x65\40\x45\170\160\x65\x63\164\x65\144\40\101\165\x64\x69\x65\x6e\143\145\x20\x55\x52\x49\x20\146\162\x6f\155\40\141\x62\x6f\x76\x65\40\141\156\144\40\x70\141\163\164\145\x20\151\x74\x20\151\x6e\x20\x74\150\x65\40\101\165\144\151\145\x6e\143\x65\40\125\122\111\40\146\x69\145\154\x64\x20\x61\164\x20\111\x64\x65\156\x74\151\164\171\x20\x50\x72\x6f\166\x69\144\x65\162\40\163\x69\144\x65\56\x3c\x2f\x6c\151\76\xd\12\11\x9\11\x9\11\74\x2f\x6f\x6c\x3e\15\12\x9\11\11\x9\x9\x3c\57\x64\x69\x76\76\15\12\40\40\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\x3c\144\x69\x76\40\x73\x74\171\154\145\75\42\155\x61\162\x67\x69\x6e\x3a\63\x25\x3b\144\151\163\160\x6c\141\x79\x3a\142\154\x6f\143\153\x3b\164\x65\170\164\x2d\141\154\151\147\x6e\x3a\143\145\156\164\x65\x72\73\42\x3e\xd\12\40\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\40\40\40\40\40\x20\x20\x3c\x64\151\x76\40\x73\x74\x79\x6c\145\75\x22\x6d\141\x72\147\x69\x6e\72\63\45\73\x64\x69\163\160\x6c\141\171\x3a\x62\x6c\157\143\153\73\x74\145\x78\x74\55\x61\x6c\x69\x67\x6e\x3a\143\145\156\164\x65\162\73\42\x3e\74\x69\156\160\165\x74\x20\x73\164\x79\x6c\145\75\x22\x70\x61\144\144\151\x6e\147\x3a\61\45\73\x77\151\x64\x74\x68\72\61\x30\60\x70\170\73\142\141\x63\x6b\147\x72\x6f\x75\156\x64\72\x20\43\x30\60\71\x31\x43\104\40\156\x6f\156\145\x20\162\x65\160\x65\141\x74\40\x73\x63\162\x6f\154\x6c\x20\x30\x25\x20\60\45\73\x63\165\162\x73\x6f\162\72\40\x70\157\151\156\164\x65\x72\x3b\146\x6f\x6e\164\55\163\151\172\x65\72\61\x35\x70\x78\x3b\x62\x6f\162\144\145\x72\55\x77\151\144\x74\150\72\40\61\x70\170\73\142\x6f\x72\x64\145\x72\55\x73\164\x79\x6c\145\72\x20\x73\157\154\x69\x64\73\142\x6f\x72\144\x65\x72\55\x72\x61\x64\x69\x75\x73\x3a\x20\63\x70\170\x3b\167\x68\151\164\x65\55\x73\x70\x61\143\x65\72\40\x6e\x6f\x77\x72\x61\x70\x3b\142\157\170\x2d\x73\x69\172\151\x6e\147\x3a\x20\x62\x6f\x72\x64\x65\162\x2d\x62\157\170\x3b\142\157\162\x64\145\162\55\143\157\x6c\x6f\162\x3a\40\43\x30\60\x37\x33\x41\101\x3b\x62\x6f\x78\x2d\163\x68\x61\x64\157\x77\72\40\x30\x70\x78\40\x31\x70\x78\40\60\160\x78\40\x72\147\142\x61\50\61\x32\60\54\x20\x32\60\x30\54\40\62\63\x30\54\x20\60\x2e\66\x29\x20\x69\156\163\145\164\73\143\157\154\157\162\72\x20\x23\x46\x46\x46\73\x22\x74\171\x70\145\75\x22\x62\x75\164\164\x6f\156\x22\40\x76\x61\x6c\x75\x65\75\42\x44\157\x6e\x65\x22\x20\x6f\x6e\x43\x6c\x69\x63\x6b\x3d\42\x73\145\x6c\146\56\143\154\x6f\x73\x65\50\x29\73\x22\x3e\x3c\x2f\x64\151\x76\x3e";
exit;
mo_saml_download_logs($W_, $FQ);
eOT:
goto PTz;
EyI:
return TRUE;
PTz:
yFW:
js8:
}
private static function findCertificate(array $eI, array $Bg, $XS)
{
$LP = array();
foreach ($Bg as $eH) {
$Mv = strtolower(sha1(base64_decode($eH)));
if (!self::mo_saml_in_array($Mv, $eI, TRUE)) {
goto Yg4;
}
$N2 = "\x2d\x2d\55\x2d\55\x42\105\107\111\116\40\103\105\x52\x54\x49\x46\111\x43\x41\x54\105\55\55\x2d\x2d\55\12" . chunk_split($eH, 64) . "\55\55\55\55\x2d\105\x4e\104\x20\x43\x45\x52\x54\x49\x46\111\103\x41\124\105\x2d\55\55\55\x2d\12";
return $N2;
Yg4:
$LP[] = $Mv;
Ry6:
}
sie:
return false;
}
private static function doDecryptElement(DOMElement $cR, XMLSecurityKey $Xr, array &$gz)
{
$J8 = new XMLSecEnc();
$J8->setNode($cR);
$J8->type = $cR->getAttribute("\124\171\x70\x65");
$Qt = $J8->locateKey($cR);
if ($Qt) {
goto YnB;
}
echo sprintf("\103\157\165\154\144\40\156\x6f\164\40\x6c\x6f\143\141\164\x65\40\153\145\x79\40\141\154\147\157\162\151\164\150\155\40\x69\x6e\40\145\156\x63\x72\171\160\x74\145\x64\40\144\x61\x74\x61\56");
exit;
YnB:
$Tp = $J8->locateKeyInfo($Qt);
if ($Tp) {
goto r2c;
}
echo sprintf("\103\x6f\165\x6c\144\40\x6e\157\164\40\154\x6f\x63\x61\164\145\x20\x3c\x64\x73\151\x67\x3a\113\145\x79\x49\156\146\157\76\40\x66\x6f\x72\x20\x74\x68\x65\40\x65\156\143\x72\x79\x70\x74\x65\144\40\153\x65\x79\x2e");
exit;
r2c:
$Wm = $Xr->getAlgorith();
if ($Tp->isEncrypted) {
goto vfq;
}
$pa = $Qt->getAlgorith();
if (!($Wm !== $pa)) {
goto ixj;
}
echo sprintf("\101\154\147\157\162\x69\164\x68\x6d\x20\x6d\x69\163\155\141\x74\143\150\40\x62\x65\164\x77\x65\145\156\x20\x69\x6e\160\x75\164\40\x6b\x65\x79\40\x61\x6e\144\40\153\145\171\40\x69\156\x20\x6d\x65\163\163\141\147\x65\56\40" . "\113\x65\171\40\167\141\x73\x3a\x20" . var_export($Wm, TRUE) . "\x3b\x20\155\x65\x73\163\x61\147\x65\x20\x77\x61\x73\x3a\x20" . var_export($pa, TRUE));
exit;
ixj:
$Qt = $Xr;
goto T3B;
vfq:
$xT = $Tp->getAlgorith();
if (!self::mo_saml_in_array($xT, $gz, TRUE)) {
goto WtM;
}
echo sprintf("\x41\x6c\147\157\162\x69\x74\150\x6d\40\144\x69\x73\141\142\x6c\x65\x64\72\x20" . var_export($xT, TRUE));
exit;
WtM:
if (!($xT === XMLSecurityKey::RSA_OAEP_MGF1P && $Wm === XMLSecurityKey::RSA_1_5)) {
goto J9k;
}
$Wm = XMLSecurityKey::RSA_OAEP_MGF1P;
J9k:
if (!($Wm !== $xT)) {
goto qCC;
}
echo sprintf("\x41\x6c\147\157\162\151\x74\x68\155\40\155\151\163\155\141\164\143\x68\x20\142\x65\164\x77\145\145\x6e\40\151\156\x70\x75\164\x20\x6b\145\171\40\x61\156\144\x20\x6b\145\171\x20\x75\163\x65\x64\40\164\157\40\x65\x6e\x63\162\171\x70\x74\40" . "\40\x74\150\x65\40\163\171\155\155\x65\164\x72\x69\x63\x20\x6b\145\x79\40\x66\157\x72\x20\x74\150\145\40\x6d\x65\x73\x73\141\147\145\56\40\x4b\145\171\x20\167\141\x73\72\x20" . var_export($Wm, TRUE) . "\x3b\x20\x6d\x65\x73\163\x61\147\x65\x20\x77\141\x73\72\x20" . var_export($xT, TRUE));
exit;
qCC:
$hA = $Tp->encryptedCtx;
$Tp->key = $Xr->key;
$QS = $Qt->getSymmetricKeySize();
if (!($QS === NULL)) {
goto qzo;
}
echo sprintf("\x55\156\x6b\156\157\x77\x6e\40\x6b\145\x79\40\x73\151\172\145\x20\x66\x6f\x72\40\145\156\x63\162\171\160\164\x69\x6f\156\x20\x61\154\147\x6f\162\151\x74\x68\x6d\x3a\40" . var_export($Qt->type, TRUE));
exit;
qzo:
try {
$ns = $hA->decryptKey($Tp);
if (!(strlen($ns) != $QS)) {
goto eUG;
}
echo sprintf("\x55\156\145\170\160\x65\143\164\x65\144\x20\153\145\171\40\x73\x69\x7a\x65\x20\50" . strlen($ns) * 8 . "\x62\151\x74\163\x29\40\146\157\162\x20\x65\156\x63\x72\x79\160\164\151\157\156\40\141\154\147\x6f\162\151\164\150\155\72\40" . var_export($Qt->type, TRUE));
exit;
eUG:
} catch (Exception $XJ) {
$QF = $hA->getCipherValue();
$rW = openssl_pkey_get_details($Tp->key);
$rW = sha1(serialize($rW), TRUE);
$ns = sha1($QF . $rW, TRUE);
if (strlen($ns) > $QS) {
goto Pfl;
}
if (strlen($ns) < $QS) {
goto yg2;
}
goto x3q;
Pfl:
$ns = substr($ns, 0, $QS);
goto x3q;
yg2:
$ns = str_pad($ns, $QS);
x3q:
}
$Qt->loadkey($ns);
T3B:
$dC = $Qt->getAlgorith();
if (!self::mo_saml_in_array($dC, $gz, TRUE)) {
goto C5p;
}
echo sprintf("\x41\x6c\x67\x6f\162\151\x74\x68\155\x20\x64\151\163\141\142\x6c\145\144\x3a\x20" . var_export($dC, TRUE));
exit;
C5p:
$tN = $J8->decryptNode($Qt, FALSE);
$RO = "\x3c\x72\x6f\157\x74\40\170\155\x6c\x6e\163\72\x73\x61\155\154\75\x22\165\x72\x6e\x3a\157\x61\x73\x69\163\x3a\x6e\x61\155\145\163\x3a\164\143\x3a\x53\101\115\x4c\72\x32\56\60\x3a\x61\x73\x73\145\162\164\x69\x6f\156\x22\40" . "\170\155\x6c\x6e\163\72\x78\163\151\x3d\x22\150\164\164\160\72\x2f\57\x77\167\167\x2e\167\x33\56\157\x72\x67\x2f\62\x30\60\x31\57\130\x4d\x4c\x53\143\x68\145\155\x61\55\x69\156\x73\164\x61\x6e\143\145\42\76" . $tN . "\74\x2f\162\157\157\164\76";
$rc = new DOMDocument();
if (@$rc->loadXML($RO)) {
goto M9S;
}
echo sprintf("\106\x61\151\x6c\x65\144\40\x74\x6f\x20\x70\x61\x72\163\x65\x20\144\145\x63\x72\171\160\164\x65\x64\x20\x58\x4d\114\56\x20\x4d\x61\x79\142\x65\40\x74\150\x65\40\x77\x72\x6f\156\x67\40\163\x68\141\162\145\x64\x6b\145\x79\x20\167\141\163\x20\165\x73\x65\144\77");
throw new Exception("\106\x61\151\x6c\145\144\40\164\157\40\x70\141\x72\x73\x65\40\144\145\143\162\x79\x70\164\145\x64\40\130\x4d\x4c\56\x20\x4d\141\171\x62\145\x20\164\150\x65\40\167\162\157\156\147\x20\x73\150\141\x72\145\x64\153\x65\171\40\167\x61\163\40\165\163\145\144\77");
M9S:
$eV = $rc->firstChild->firstChild;
if (!($eV === NULL)) {
goto tEz;
}
echo sprintf("\115\151\x73\x73\151\156\147\x20\x65\x6e\x63\162\x79\x70\x74\x65\x64\x20\145\x6c\145\155\145\x6e\164\x2e");
throw new Exception("\115\x69\163\x73\151\156\147\x20\x65\x6e\143\x72\x79\160\x74\145\144\40\145\154\145\155\x65\156\x74\x2e");
tEz:
if ($eV instanceof DOMElement) {
goto P0K;
}
echo sprintf("\104\145\143\x72\x79\160\x74\x65\x64\40\145\x6c\145\155\x65\x6e\164\40\x77\141\163\40\156\157\164\40\x61\143\164\165\141\x6c\x6c\171\x20\x61\40\104\x4f\x4d\x45\154\145\x6d\145\156\x74\x2e");
P0K:
return $eV;
}
public static function decryptElement(DOMElement $cR, XMLSecurityKey $Xr, array $gz = array(), XMLSecurityKey $do = NULL)
{
try {
return self::doDecryptElement($cR, $Xr, $gz);
} catch (Exception $XJ) {
echo sprintf("\x46\x61\151\154\x65\x64\40\x74\x6f\40\144\x65\x63\162\171\160\x74\x20\130\115\114\x20\x65\154\145\x6d\x65\x6e\x74\56");
exit;
}
}
public static function get_mapped_groups($f1, $Xe)
{
$Sx = array();
if (empty($Xe)) {
goto tX2;
}
$Ph = array();
$zL = 1;
XA4:
if (!($zL < 10)) {
goto Zma;
}
$gF = $f1->get("\147\162\157\x75\160" . $zL . "\137\x6d\141\160");
$Ph[$zL] = explode("\x3b", $gF);
$zL++;
goto XA4;
Zma:
tX2:
foreach ($Xe as $Tw) {
if (empty($Tw)) {
goto OZp;
}
$zL = 0;
$MN = false;
jvm:
if (!($zL < 9 && !$MN)) {
goto Vh5;
}
if (!(!empty($Ph[$zL]) && in_array($Tw, $Ph[$zL]))) {
goto VHV;
}
$Sx[] = $f1->get("\x67\x72\x6f\165\160" . $zL);
$MN = true;
VHV:
$zL++;
goto jvm;
Vh5:
OZp:
TXv:
}
gam:
return array_unique($Sx);
}
public static function getEncryptionAlgorithm($xW)
{
switch ($xW) {
case "\150\x74\x74\x70\72\57\x2f\167\x77\167\x2e\x77\63\56\x6f\x72\147\57\x32\60\60\61\x2f\60\64\x2f\x78\x6d\154\x65\x6e\x63\x23\164\x72\151\160\154\x65\x64\x65\x73\x2d\143\142\143":
return XMLSecurityKey::TRIPLEDES_CBC;
goto ArX;
case "\150\x74\x74\x70\72\x2f\x2f\x77\x77\167\56\x77\x33\56\157\162\x67\x2f\x32\60\60\61\x2f\60\x34\57\x78\x6d\154\145\156\143\43\x61\145\x73\x31\x32\x38\55\143\x62\143":
return XMLSecurityKey::AES128_CBC;
case "\x68\164\164\x70\x3a\x2f\x2f\167\167\x77\x2e\x77\63\56\157\162\x67\x2f\62\60\60\61\x2f\x30\x34\x2f\170\155\x6c\145\x6e\x63\x23\x61\145\163\x31\71\62\55\x63\142\x63":
return XMLSecurityKey::AES192_CBC;
goto ArX;
case "\150\x74\x74\160\72\57\57\167\167\x77\56\167\x33\x2e\x6f\x72\147\57\62\x30\x30\61\57\x30\x34\x2f\x78\155\154\145\x6e\x63\x23\141\x65\x73\x32\x35\66\55\143\x62\143":
return XMLSecurityKey::AES256_CBC;
goto ArX;
case "\150\x74\x74\x70\72\57\x2f\167\167\167\x2e\x77\63\56\x6f\x72\x67\57\62\60\60\x31\x2f\x30\64\x2f\170\155\x6c\145\x6e\x63\x23\162\x73\141\55\61\x5f\x35":
return XMLSecurityKey::RSA_1_5;
goto ArX;
case "\x68\164\x74\160\x3a\x2f\x2f\167\x77\167\x2e\167\x33\x2e\157\x72\147\57\x32\60\60\61\57\x30\64\57\x78\x6d\x6c\x65\x6e\143\43\x72\x73\141\x2d\157\141\x65\x70\x2d\x6d\x67\x66\61\160":
return XMLSecurityKey::RSA_OAEP_MGF1P;
goto ArX;
case "\150\164\164\160\72\x2f\x2f\x77\x77\x77\x2e\x77\63\56\157\x72\x67\x2f\62\x30\x30\x30\x2f\x30\71\x2f\x78\155\154\x64\x73\151\147\43\144\163\141\x2d\x73\x68\141\x31":
return XMLSecurityKey::DSA_SHA1;
goto ArX;
case "\150\x74\164\160\72\x2f\57\167\x77\x77\x2e\167\63\x2e\157\162\x67\57\62\x30\x30\x30\57\x30\x39\57\170\155\x6c\x64\x73\x69\147\43\162\163\x61\55\163\x68\x61\61":
return XMLSecurityKey::RSA_SHA1;
goto ArX;
case "\x68\x74\x74\160\72\57\x2f\x77\167\167\x2e\x77\63\56\x6f\162\x67\x2f\62\x30\x30\x31\x2f\60\64\57\x78\x6d\x6c\144\163\x69\147\x2d\x6d\x6f\x72\145\43\x72\163\x61\55\163\x68\x61\x32\65\66":
return XMLSecurityKey::RSA_SHA256;
goto ArX;
case "\x68\x74\x74\160\72\57\x2f\167\167\x77\x2e\167\x33\56\157\162\147\x2f\x32\60\x30\61\x2f\x30\x34\x2f\x78\x6d\x6c\x64\163\x69\x67\x2d\155\x6f\x72\x65\43\x72\163\x61\x2d\x73\150\141\x33\70\x34":
return XMLSecurityKey::RSA_SHA384;
goto ArX;
case "\150\x74\x74\160\x3a\57\57\x77\x77\167\x2e\167\x33\x2e\x6f\162\147\57\62\60\x30\61\57\60\x34\57\x78\155\x6c\x64\163\151\147\x2d\x6d\x6f\x72\145\43\162\163\x61\55\163\150\x61\x35\x31\x32":
return XMLSecurityKey::RSA_SHA512;
goto ArX;
default:
echo sprintf("\111\156\x76\x61\x6c\x69\144\x20\x45\156\x63\x72\171\x70\164\151\x6f\x6e\40\x4d\145\164\x68\157\x64\72\x20" . $xW);
exit;
goto ArX;
}
Fx4:
ArX:
}
public static function insertSignature(XMLSecurityKey $ns, array $Bg, DOMElement $Bs, DOMNode $HB = NULL)
{
$Dk = new XMLSecurityDSig();
$Dk->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
switch ($ns->type) {
case XMLSecurityKey::RSA_SHA256:
$CL = XMLSecurityDSig::SHA256;
goto kco;
case XMLSecurityKey::RSA_SHA384:
$CL = XMLSecurityDSig::SHA384;
goto kco;
case XMLSecurityKey::RSA_SHA512:
$CL = XMLSecurityDSig::SHA512;
goto kco;
default:
$CL = XMLSecurityDSig::SHA1;
}
H5g:
kco:
$Dk->addReferenceList(array($Bs), $CL, array("\x68\x74\x74\x70\x3a\x2f\57\167\167\167\x2e\167\63\56\157\x72\147\57\x32\x30\x30\x30\x2f\60\x39\x2f\170\155\x6c\144\163\151\x67\x23\145\156\166\145\x6c\x6f\x70\145\x64\55\x73\x69\x67\156\141\164\165\162\145", XMLSecurityDSig::EXC_C14N), array("\x69\144\137\x6e\x61\155\145" => "\111\x44", "\157\166\x65\x72\x77\162\151\164\145" => FALSE));
$Dk->sign($ns);
foreach ($Bg as $RV) {
$Dk->add509Cert($RV, TRUE);
n1M:
}
ZXI:
$Dk->insertSignature($Bs, $HB);
}
public static function getRemainingDaysOfCurrentCertificate()
{
$RV = get_site_option("\x6d\157\x5f\163\141\155\154\137\143\165\162\162\x65\x6e\164\x5f\143\145\x72\x74");
$jR = openssl_x509_parse($RV);
$fY = $jR["\x76\141\154\x69\144\124\x6f\137\x74\151\x6d\145\137\164"];
$zV = $fY - time();
return round($zV / (60 * 60 * 24));
}
public static function getExpiryDateOfCurrentCertificate()
{
$RV = get_site_option("\155\157\x5f\163\x61\x6d\x6c\137\143\x75\162\162\145\156\164\x5f\x63\145\x72\164");
$jR = openssl_x509_parse($RV);
return $jR["\166\141\154\x69\144\x54\157\137\164\x69\x6d\x65\137\x74"];
}
public static function getValidUntilDateFromCert($RV)
{
$jR = openssl_x509_parse($RV);
$fY = $jR["\166\x61\154\151\x64\124\x6f\x5f\164\x69\x6d\x65\x5f\x74"];
$nn = date("\x59\55\155\55\144", $fY);
$AG = $nn . "\124\x32\x33\72\x35\71\x3a\65\71\132";
return $AG;
}
public static function signXML($RO, $Zp = '', $Yk = false)
{
$HH = array("\164\x79\160\x65" => "\160\x72\x69\166\141\x74\x65");
$ns = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $HH);
if ($Yk) {
goto DYE;
}
$at = get_site_option("\155\x6f\137\x73\x61\155\154\137\x63\x75\162\x72\145\x6e\164\137\143\x65\162\x74\x5f\160\x72\x69\166\141\164\145\137\x6b\x65\171");
$a4 = get_site_option("\x6d\x6f\x5f\x73\141\x6d\154\137\x63\x75\162\x72\x65\156\x74\137\143\x65\162\164");
goto EL7;
DYE:
$at = file_get_contents(plugin_dir_path(__FILE__) . "\162\x65\163\157\165\x72\x63\145\163" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Private_Key);
$a4 = file_get_contents(plugin_dir_path(__FILE__) . "\162\x65\163\x6f\165\x72\143\x65\163" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Public_Certificate);
EL7:
$ns->loadKey($at, FALSE);
$G7 = new DOMDocument();
$G7->loadXML($RO);
$Nd = $G7->firstChild;
if (!empty($Zp)) {
goto loa;
}
self::insertSignature($ns, array($a4), $Nd);
goto rJf;
loa:
$ji = $G7->getElementsByTagName($Zp)->item(0);
self::insertSignature($ns, array($a4), $Nd, $ji);
rJf:
$MZ = $Nd->ownerDocument->saveXML($Nd);
$E2 = base64_encode($MZ);
return $E2;
}
public static function postSAMLRequest($qp, $D5, $XS)
{
echo "\x3c\150\164\x6d\x6c\x3e\x3c\142\157\144\x79\x3e\x50\x6c\145\141\x73\x65\x20\167\x61\x69\164\x2e\x2e\x2e\74\x66\x6f\x72\155\x20\141\x63\164\x69\x6f\x6e\75\x22" . $qp . "\42\40\155\145\164\150\x6f\144\x3d\42\160\157\163\x74\x22\40\151\x64\75\x22\x73\x61\155\x6c\x2d\162\145\x71\x75\145\x73\164\x2d\x66\x6f\162\155\42\x3e\74\151\156\x70\165\164\40\x74\x79\160\x65\75\42\150\x69\144\x64\x65\x6e\42\x20\156\x61\155\x65\75\x22\x53\x41\115\x4c\x52\145\x71\x75\x65\x73\x74\42\40\x76\x61\x6c\165\x65\x3d\42" . $D5 . "\42\40\x2f\76\74\151\156\x70\x75\164\x20\164\171\x70\145\x3d\x22\x68\x69\144\x64\x65\156\42\40\156\141\x6d\x65\x3d\42\122\x65\x6c\x61\171\123\x74\141\164\145\x22\40\x76\141\x6c\165\145\x3d\x22" . htmlentities($XS) . "\42\40\x2f\76\74\x2f\146\x6f\162\x6d\76\74\163\x63\x72\x69\160\164\76\144\157\x63\x75\x6d\145\x6e\164\56\x67\x65\x74\x45\154\x65\x6d\145\x6e\x74\102\x79\111\144\50\x27\x73\x61\x6d\154\55\x72\x65\x71\165\x65\163\x74\55\x66\x6f\162\x6d\47\51\x2e\x73\x75\142\x6d\151\164\x28\x29\x3b\74\57\163\x63\x72\151\160\x74\76\74\57\x62\x6f\144\171\x3e\74\x2f\x68\164\155\x6c\76";
exit;
}
public static function postSAMLResponse($qp, $s4, $XS)
{
echo "\74\150\x74\155\154\76\x3c\142\157\x64\x79\x3e\120\154\145\141\x73\x65\x20\x77\x61\151\x74\56\x2e\56\x3c\x66\157\x72\x6d\x20\x61\x63\x74\151\x6f\x6e\x3d\x22" . $qp . "\42\40\155\145\x74\x68\x6f\144\x3d\x22\160\x6f\x73\164\42\40\151\x64\75\x22\163\x61\x6d\154\x2d\162\145\x73\x70\157\x6e\x73\x65\55\x66\x6f\x72\x6d\42\x3e\74\151\156\160\165\x74\40\164\171\160\x65\x3d\x22\150\x69\x64\x64\145\156\x22\x20\x6e\141\155\145\75\42\123\x41\x4d\114\x52\145\163\x70\157\156\x73\x65\x22\40\166\x61\154\165\145\75\42" . $s4 . "\42\x20\x2f\76\x3c\x69\156\x70\x75\x74\x20\x74\171\x70\145\75\42\150\x69\x64\144\x65\156\x22\x20\156\141\155\x65\75\x22\122\145\154\x61\171\123\164\x61\x74\145\42\x20\x76\141\154\x75\x65\75\42" . htmlentities($XS) . "\42\40\57\76\x3c\x2f\146\157\162\x6d\76\74\163\143\x72\151\x70\x74\x3e\x64\x6f\143\165\155\x65\x6e\x74\x2e\x67\145\164\x45\154\145\155\145\156\x74\102\171\111\144\x28\x27\163\x61\x6d\154\x2d\162\145\163\x70\157\156\163\145\x2d\x66\157\162\x6d\x27\51\x2e\163\x75\x62\155\x69\x74\x28\51\73\74\x2f\163\x63\x72\151\160\164\76\74\x2f\142\157\x64\171\76\x3c\x2f\x68\164\155\x6c\x3e";
exit;
}
public static function sanitize_certificate($RV)
{
$RV = preg_replace("\x2f\133\15\12\135\x2b\x2f", '', $RV);
$RV = str_replace("\55", '', $RV);
$RV = str_replace("\102\x45\107\x49\116\x20\x43\105\x52\124\111\x46\x49\x43\101\124\x45", '', $RV);
$RV = str_replace("\105\x4e\x44\40\x43\105\x52\x54\111\x46\x49\x43\x41\124\105", '', $RV);
$RV = str_replace("\x20", '', $RV);
$RV = chunk_split($RV, 64, "\xd\xa");
$RV = "\x2d\x2d\55\55\55\x42\x45\x47\x49\116\40\103\x45\122\x54\111\x46\x49\x43\101\x54\105\55\x2d\x2d\x2d\55\xd\12" . $RV . "\55\x2d\x2d\55\55\x45\x4e\104\x20\103\105\x52\124\111\106\x49\x43\x41\124\105\x2d\55\55\x2d\55";
return $RV;
}
public static function desanitize_certificate($RV)
{
$RV = preg_replace("\x2f\x5b\15\xa\x5d\53\x2f", '', $RV);
$RV = str_replace("\x2d\55\55\55\x2d\102\x45\x47\111\x4e\x20\103\x45\122\124\x49\x46\111\103\x41\x54\105\x2d\55\x2d\55\55", '', $RV);
$RV = str_replace("\x2d\x2d\x2d\x2d\55\105\x4e\x44\x20\103\105\x52\x54\x49\x46\x49\x43\101\124\x45\x2d\x2d\x2d\x2d\x2d", '', $RV);
$RV = str_replace("\40", '', $RV);
return $RV;
}
public static function get_sites()
{
$u5 = array("\156\145\164\167\157\x72\x6b\x5f\x69\144" => null, "\x70\x75\x62\154\x69\143" => null, "\x61\162\143\150\x69\x76\x65\x64" => 0, "\x6d\x61\x74\165\x72\145" => null, "\163\x70\141\155" => 0, "\x64\145\x6c\x65\164\x65\x64" => 0, "\x6e\x75\x6d\x62\x65\162" => 0, "\x6f\146\x66\163\145\x74" => 0);
if (function_exists("\x67\145\164\137\x73\151\x74\x65\x73") && class_exists("\x57\x50\x5f\x53\x69\x74\x65\x5f\x51\165\x65\x72\171")) {
goto iIg;
}
if (!function_exists("\x77\160\137\x67\145\x74\x5f\163\x69\164\145\163")) {
goto L4v;
}
$aX = wp_get_sites($u5);
L4v:
goto Uu5;
iIg:
$aX = get_sites($u5);
Uu5:
return $aX;
}
public static function get_active_sites()
{
$EK = maybe_unserialize(get_site_option("\155\157\x5f\x65\156\141\142\154\145\137\163\x73\157\x5f\163\x69\164\145\x73"));
if (!empty($EK)) {
goto a0U;
}
$EK = array();
$aX = self::get_sites();
foreach ($aX as $GW) {
array_push($EK, $GW->blog_id);
b5A:
}
hSK:
a0U:
$r3 = self::get_main_subsite_id();
if (self::mo_saml_in_array($r3, $EK)) {
goto vBs;
}
array_push($EK, $r3);
vBs:
return $EK;
}
public static function get_all_roles()
{
$aX = self::get_sites();
$XW = array();
foreach ($aX as $GW) {
$mw = new WP_Roles($GW->blog_id);
$tw = $mw->get_names();
$XW = array_merge($XW, $tw);
ml8:
}
KpT:
return $XW;
}
public static function get_main_subsite_id()
{
$aX = self::get_sites();
$fs = get_site_option("\155\157\x5f\x73\141\x6d\x6c\x5f\163\160\137\x62\141\x73\x65\137\165\162\x6c");
if (!empty($fs)) {
goto M1C;
}
$fs = get_network_site_url();
M1C:
$lR = $fs . "\57";
$n1 = parse_url($fs, PHP_URL_SCHEME);
$lR = str_replace($n1 . "\x3a\57\57", '', $lR);
$Rf = 1;
foreach ($aX as $GW) {
$YD = $GW->domain . $GW->path;
if (!($YD == $lR)) {
goto YI1;
}
$Rf = $GW->blog_id;
YI1:
ZK1:
}
aID:
return $Rf;
}
public static function mo_saml_wp_remote_call($qp, $Ak, $u5 = array(), $Vl = false)
{
if (!$Vl) {
goto T0C;
}
$uk = wp_remote_get($qp, $u5);
goto HUb;
T0C:
$uk = wp_remote_post($qp, $u5);
HUb:
if (!is_wp_error($uk)) {
goto emv;
}
$z_ = $Ak;
update_option("\x6d\157\x5f\163\141\155\154\137\x6d\x65\163\163\x61\147\x65", "\x55\x6e\141\142\x6c\x65\40\164\x6f\x20\x63\x6f\x6e\156\145\143\164\x20\164\157\40\164\x68\x65\x20\111\x6e\x74\x65\x72\156\145\x74\56\40\120\x6c\x65\141\163\145\40\x74\x72\171\x20\141\147\x61\x69\156\56");
$z_->mo_saml_show_error_message();
return false;
goto nFV;
emv:
return $uk["\142\x6f\x64\171"];
nFV:
}
public static function mo_saml_in_array($ns, $w6, $Ud = false)
{
if (!(is_array($w6) and in_array($ns, $w6, $Ud))) {
goto Dhd;
}
return true;
Dhd:
return false;
}
public static function get_box_expiry_notice_heading($wf)
{
$zW = '';
$ax = Mo_License_Service::is_license_expired();
if (true === $ax["\x53\x54\x41\124\125\x53"]) {
goto Vss;
}
if (false === $ax["\x53\x54\x41\x54\125\x53"] && "\114\111\x43\105\116\x53\x45\x5f\111\116\137\107\122\101\x43\x45" === $ax["\x43\x4f\104\105"]) {
goto Wd9;
}
if ($wf["\43\43\x72\145\x6d\x61\x69\156\x69\156\x67\137\x64\141\171\x73\43\x23"] <= 60) {
goto iUj;
}
goto LXp;
Vss:
$zW = "\x57\x61\162\x6e\151\x6e\x67\x20\72\x20\131\x6f\x75\162\40\x53\x53\x4f\40\150\141\163\40\163\164\157\160\160\x65\x64\x20\x77\157\162\x6b\x69\156\147\x2e\40\122\x65\156\x65\x77\x20\171\157\x75\x72\40\154\151\x63\x65\156\x73\x65\40\x6e\157\167\x21";
goto LXp;
Wd9:
$zW = "\x59\x6f\165\162\40\x70\x6c\165\147\x69\x6e\40\x68\x61\163\x20\145\x78\160\151\162\145\144\x20\141\x6e\x64\x20\123\123\117\40\167\x69\x6c\154\40\163\x74\x6f\160\40\x77\157\162\153\151\156\x67\40\151\156\x20\x3c\x73\x70\141\x6e\x20\151\x64\x3d\42\155\157\x5f\x73\x61\x6d\x6c\x5f\160\x72\x6f\x66\x69\x6c\x65\137\x62\157\170\137\143\x6f\165\156\164\x65\x72\42\x3e" . esc_html($wf["\43\43\x67\162\x61\143\145\137\144\141\x79\x73\x5f\154\145\x66\x74\x23\43"]) . "\74\57\163\160\141\x6e\76\x20\x64\141\171\x73\56\40\x52\x65\x6e\145\167\x20\171\x6f\x75\x72\40\x6c\x69\143\x65\x6e\x73\145\x20\x6e\157\x77\40\x74\x6f\x20\x61\x76\x6f\x69\x64\40\x64\x69\163\x72\x75\x70\x74\151\x6f\156\x2e";
goto LXp;
iUj:
$zW = "\114\x69\x63\145\x6e\x73\145\x20\x45\x78\160\x69\162\171\40\x4e\x6f\x74\x69\143\145\x20\72\x20\x50\x6c\165\x67\151\156\40\114\x69\143\x65\156\163\145\40\147\145\x74\x74\151\156\x67\x20\145\170\160\151\x72\145\x64\x20\151\156\x20\x3c\163\x70\x61\156\x20\151\x64\75\x22\x6d\x6f\137\163\141\x6d\154\137\x70\x72\157\146\151\x6c\x65\x5f\x62\x6f\170\x5f\143\x6f\165\156\164\x65\162\42\x3e\x20" . esc_html($wf["\43\x23\x72\145\155\141\151\x6e\x69\156\x67\137\144\x61\x79\163\43\43"]) . "\40\74\57\163\160\141\x6e\76\40\x64\x61\171\x73";
LXp:
return $zW;
}
public static function get_expiry_notice_class($Yg)
{
if ($Yg < 60 && $Yg > 0) {
goto n3n;
}
if ($Yg <= 0 && $Yg > -15) {
goto Acm;
}
if ($Yg <= -15) {
goto Gf2;
}
goto q0u;
n3n:
return "\155\157\55\x73\141\155\154\55\167\x61\x72\156\151\x6e\147\55\x79\145\x6c\x6c\157\x77";
goto q0u;
Acm:
return "\155\157\55\163\x61\155\154\x2d\167\x61\162\x6e\151\156\x67\x2d\x6f\162\141\156\147\145";
goto q0u;
Gf2:
return "\x6d\157\x2d\x73\x61\155\x6c\x2d\x77\141\162\156\x69\156\147\55\x72\x65\144";
q0u:
return '';
}
public static function mo_saml_display_end_user_error_message_with_code($T3)
{
wp_die("\x3c\142\76" . "\133" . esc_attr($T3) . "\x5d" . "\x3c\x2f\x62\x3e\40\x57\145\x20\x63\157\165\154\x64\x20\x6e\157\x74\40\x73\x69\147\x6e\40\171\x6f\x75\40\x69\156\x2e\40\120\x6c\x65\x61\163\145\40\143\157\156\x74\141\143\164\x20\x79\157\x75\x72\40\x61\x64\155\151\156\x69\x73\x74\162\x61\x74\x6f\162\x20\167\x69\x74\150\x20\x74\150\x65\40\155\145\156\164\x69\x6f\156\145\144\40\143\157\144\145\56", "\114\151\x63\145\x6e\163\x65\x20\151\x73\x20\145\x78\x70\x69\162\145\x64");
}
}
Function Calls
None |
Stats
MD5 | 57818b2f66b3209c138443620a1b5948 |
Eval Count | 0 |
Decode Time | 115 ms |