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
*/
require_once Mo_Saml_Plugin_Files::MO_SAML_XML_SEC_LIBS;
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
class SAMLSPUtilities
{
public static function generateID()
{
return "_" . self::stringToHex(self::generateRandomBytes(21));
}
public static function stringToHex($MX)
{
$GP = '';
$YE = 0;
Fy_:
if (!($YE < strlen($MX))) {
goto QdK;
}
$GP .= sprintf("%02x", ord($MX[$YE]));
gsQ:
$YE++;
goto Fy_;
QdK:
return $GP;
}
public static function generateRandomBytes($f6, $ir = TRUE)
{
return openssl_random_pseudo_bytes($f6);
}
public static function createAuthnRequest($f4, $Nl, $Ax, $S7 = "false", $Iy = "HttpRedirect", $q2 = '')
{
$q2 = "urn:oasis:names:tc:SAML:" . $q2;
$jT = "<?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 (!($S7 == "true")) {
goto el3;
}
$jT .= " ForceAuthn="true"";
el3:
$jT .= " ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" . $f4 . "" Destination="" . $Ax . ""><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $Nl . "</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="" . $q2 . ""
/></samlp:AuthnRequest>";
if (empty($Iy) || $Iy == "HttpRedirect") {
goto Bki;
}
$vF = gzdeflate($jT);
$VK = base64_encode($vF);
goto Ucg;
Bki:
$vF = gzdeflate($jT);
$VK = base64_encode($vF);
$Ue = urlencode($VK);
$jT = $Ue;
Ucg:
update_option("MO_SAML_REQUEST", $VK);
return $jT;
}
public static function generateTimestamp($Ab = NULL)
{
if (!($Ab === NULL)) {
goto vbI;
}
$Ab = time();
vbI:
return gmdate("Y-m-d\TH:i:s\Z", $Ab);
}
public static function xpQuery(DOMNode $vJ, $wy)
{
static $dF = NULL;
if ($vJ instanceof DOMDocument) {
goto Ty0;
}
$PU = $vJ->ownerDocument;
goto Tle;
Ty0:
$PU = $vJ;
Tle:
if (!($dF === NULL || !$dF->document->isSameNode($PU))) {
goto FQ2;
}
$dF = new DOMXPath($PU);
$dF->registerNamespace("soap-env", "http://schemas.xmlsoap.org/soap/envelope/");
$dF->registerNamespace("saml_protocol", "urn:oasis:names:tc:SAML:2.0:protocol");
$dF->registerNamespace("saml_assertion", "urn:oasis:names:tc:SAML:2.0:assertion");
$dF->registerNamespace("saml_metadata", "urn:oasis:names:tc:SAML:2.0:metadata");
$dF->registerNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
$dF->registerNamespace("xenc", "http://www.w3.org/2001/04/xmlenc#");
FQ2:
$ZH = $dF->query($wy, $vJ);
$GP = array();
$YE = 0;
tyE:
if (!($YE < $ZH->length)) {
goto WPM;
}
$GP[$YE] = $ZH->item($YE);
TDQ:
$YE++;
goto tyE;
WPM:
return $GP;
}
public static function parseNameId(DOMElement $C2)
{
$GP = array("Value" => trim($C2->textContent));
foreach (array("NameQualifier", "SPNameQualifier", "Format") as $YT) {
if (!$C2->hasAttribute($YT)) {
goto Fvl;
}
$GP[$YT] = $C2->getAttribute($YT);
Fvl:
hme:
}
DmW:
return $GP;
}
public static function xsDateTimeToTimestamp($Tv)
{
$yZ = array();
$uc = "/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.\d+)?Z$/D";
if (!(preg_match($uc, $Tv, $yZ) == 0)) {
goto F0Z;
}
echo sprintf("Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: " . esc_html($Tv));
exit;
F0Z:
$SE = intval($yZ[1]);
$xn = intval($yZ[2]);
$qG = intval($yZ[3]);
$dy = intval($yZ[4]);
$MS = intval($yZ[5]);
$gw = intval($yZ[6]);
$rK = gmmktime($dy, $MS, $gw, $xn, $qG, $SE);
return $rK;
}
public static function extractStrings(DOMElement $ns, $F0, $M9)
{
$GP = array();
$vJ = $ns->firstChild;
Z0M:
if (!($vJ !== NULL)) {
goto GfL;
}
if (!($vJ->namespaceURI !== $F0 || $vJ->localName !== $M9)) {
goto Jad;
}
goto iTw;
Jad:
$GP[] = trim($vJ->textContent);
iTw:
$vJ = $vJ->nextSibling;
goto Z0M;
GfL:
return $GP;
}
public static function validateElement(DOMElement $ei)
{
$gp = new XMLSecurityDSig();
$gp->idKeys[] = "ID";
$hh = self::xpQuery($ei, "./ds:Signature");
if (count($hh) === 0) {
goto iiY;
}
if (!(count($hh) > 1)) {
goto q4A;
}
echo sprintf("XMLSec: more than one signature element in root.");
exit;
q4A:
goto iUZ;
iiY:
return FALSE;
iUZ:
$hh = $hh[0];
$gp->sigNode = $hh;
$gp->canonicalizeSignedInfo();
if ($gp->validateReference()) {
goto SLr;
}
echo sprintf("XMLsec: digest validation failed");
exit;
SLr:
$HP = FALSE;
foreach ($gp->getValidatedNodes() as $zS) {
if ($zS->isSameNode($ei)) {
goto hGj;
}
if (!($ei->parentNode instanceof DOMDocument && $zS->isSameNode($ei->ownerDocument))) {
goto CLJ;
}
$HP = TRUE;
goto dKK;
CLJ:
goto PJj;
hGj:
$HP = TRUE;
goto dKK;
PJj:
AIk:
}
dKK:
if ($HP) {
goto wqF;
}
echo sprintf("XMLSec: The root element is not signed.");
exit;
wqF:
$KA = array();
foreach (self::xpQuery($hh, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate") as $k7) {
$wR = trim($k7->textContent);
$wR = str_replace(array("
", "
", " ", " "), '', $wR);
$KA[] = $wR;
eTe:
}
yp9:
$GP = array("Signature" => $gp, "Certificates" => $KA);
return $GP;
}
public static function validateSignature(array $qE, XMLSecurityKey $Jp)
{
$gp = $qE["Signature"];
$GC = self::xpQuery($gp->sigNode, "./ds:SignedInfo/ds:SignatureMethod");
if (!empty($GC)) {
goto Nof;
}
echo sprintf("Missing SignatureMethod element");
exit;
Nof:
$GC = $GC[0];
if ($GC->hasAttribute("Algorithm")) {
goto tOO;
}
echo sprintf("Missing Algorithm-attribute on SignatureMethod element.");
exit;
tOO:
$qA = $GC->getAttribute("Algorithm");
if (!($Jp->type === XMLSecurityKey::RSA_SHA1 && $qA !== $Jp->type)) {
goto j3t;
}
$Jp = self::castKey($Jp, $qA);
j3t:
if ($gp->verify($Jp)) {
goto fib;
}
echo sprintf("Unable to validate Signature");
exit;
fib:
}
public static function castKey(XMLSecurityKey $Jp, $ng, $bI = "public")
{
if (!($Jp->type === $ng)) {
goto JR9;
}
return $Jp;
JR9:
$DS = openssl_pkey_get_details($Jp->key);
if (!($DS === FALSE)) {
goto VAo;
}
echo sprintf("Unable to get key details from XMLSecurityKey.");
exit;
VAo:
if (isset($DS["key"])) {
goto Q4I;
}
echo sprintf("Missing key in public key details.");
exit;
Q4I:
$hE = new XMLSecurityKey($ng, array("type" => $bI));
$hE->loadKey($DS["key"]);
return $hE;
}
public static function processResponse($dW, $RE, $mo, SAML2SPResponse $HS, $Hy, $ia)
{
$zC = current($HS->getAssertions());
$QG = $zC->getNotBefore();
if (!($QG !== NULL && $QG > time() + 60)) {
goto iXv;
}
wp_die("Received an assertion that is valid in the future. Check clock synchronization on IdP and SP.");
iXv:
$Je = $zC->getNotOnOrAfter();
if (!($Je !== NULL && $Je <= time() - 60)) {
goto fXk;
}
wp_die("Received an assertion that has expired. Check clock synchronization on IdP and SP.");
fXk:
$GZ = $zC->getSessionNotOnOrAfter();
if (!($GZ !== NULL && $GZ <= time() - 60)) {
goto YXF;
}
wp_die("Received an assertion with a session that has expired. Check clock synchronization on IdP and SP.");
YXF:
$Ux = $HS->getDestination();
if (!(substr($Ux, -1) == "/")) {
goto UXS;
}
$Ux = substr($Ux, 0, -1);
UXS:
if (!(substr($dW, -1) == "/")) {
goto l1Z;
}
$dW = substr($dW, 0, -1);
l1Z:
if (!($Ux !== NULL && $Ux !== $dW)) {
goto TUc;
}
echo "Destination in response doesn't match the current URL. Destination is "" . esc_html(htmlspecialchars($Ux)) . "", current URL is "" . esc_html(htmlspecialchars($dW)) . "".";
exit;
TUc:
$RO = self::checkSign($RE, $mo, $Hy, $ia);
return $RO;
}
public static function checkSign($RE, $mo, $Hy, $ia)
{
$KA = $mo["Certificates"];
if (count($KA) === 0) {
goto A7l;
}
$r2 = array();
$r2[] = $RE;
$pV = self::findCertificate($r2, $KA, $ia);
if (!($pV == false)) {
goto hIG;
}
return false;
hIG:
goto J06;
A7l:
$cw = maybe_unserialize(get_option("saml_x509_certificate"));
$pV = $cw[$Hy];
J06:
$a3 = NULL;
$Jp = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array("type" => "public"));
$Jp->loadKey($pV);
try {
self::validateSignature($mo, $Jp);
return TRUE;
} catch (Exception $AM) {
$a3 = $AM;
}
if ($a3 !== NULL) {
goto e2_;
}
return FALSE;
goto mTv;
e2_:
throw $a3;
mTv:
}
public static function mo_saml_add_query_arg($EL, $Q7)
{
return self::mo_saml_sanitize_url(add_query_arg($EL, $Q7));
}
public static function mo_saml_kses_esc_message($gc)
{
$Rc = array("a" => array("style" => array(), "href" => array(), "class" => array()));
return wp_kses($gc, $Rc);
}
public static function mo_saml_sanitize_url($Ug, $yd = null)
{
return esc_url($Ug, $yd, "db");
}
public static function validateIssuerAndAudience($wh, $ym, $nr, $ia)
{
$Nl = current($wh->getAssertions())->getIssuer();
$zC = current($wh->getAssertions());
$vq = $zC->getValidAudiences();
if (strcmp($nr, $Nl) === 0) {
goto spv;
}
if ($ia == "testValidate" or $ia == "testNewCertificate") {
goto fRR;
}
wp_die("We could not sign you in. Please contact your Administrator", "Error :Issuer cannot be verified");
goto rhS;
fRR:
$Aq = mo_options_error_constants::Error_issuer_not_verfied;
$Rg = 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>
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;text-align: justify"><p><strong>Error:" . esc_html($Aq) . " </strong></p>
<p><strong>Possible Cause:" . esc_html($Rg) . " </strong></p>\xa <p><strong>Entity ID in SAML Response: </strong>" . esc_html($Nl) . "<p>\xa <p><strong>Entity ID Configured in the plugin: </strong>" . esc_html($nr) . "</p>\xa\x9 <p><strong>Solution:</strong></p>
\x9\x9\x9<ol>
\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>
\x9\x9\x9</ol>
\x9 \x9\x9</div>
</div>";
mo_saml_download_logs($Aq, $Rg);
exit;
rhS:
goto v3q;
spv:
if (empty($vq)) {
goto kCG;
}
if (mo_saml_in_array($ym, $vq, TRUE)) {
goto k6P;
}
if ($ia == "testValidate" or $ia == "testNewCertificate") {
goto L79;
}
wp_die("We could not sign you in. Please contact your Administrator", "Error :Invalid Audience URI");
goto RNY;
L79:
$Aq = mo_options_error_constants::Error_invalid_audience;
$Rg = mo_options_error_constants::Cause_invalid_audience;
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>\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>" . esc_html($Aq) . "</p>
<p><strong>Possible Cause: </strong>" . esc_html($Rg) . "</p>\xa <p>Expected one of the Audiences to be: " . esc_html($ym) . "<p>
\x9<p><strong>Solution:</strong></p>\xa \x9 \x9<ol>\xa \x9 <li>Copy the Expected Audience URI from above and paste it in the Audience URI field at Identity Provider side.</li>\xa\x9\x9\x9 \x9</ol>\xa \x9</div>";
mo_saml_download_logs($Aq, $Rg);
exit;
RNY:
goto NG7;
k6P:
return TRUE;
NG7:
kCG:
v3q:
}
private static function findCertificate(array $q7, array $KA, $ia)
{
$GH = array();
foreach ($KA as $kK) {
$sq = strtolower(sha1(base64_decode($kK)));
if (mo_saml_in_array($sq, $q7, TRUE)) {
goto UfU;
}
$GH[] = $sq;
return false;
UfU:
$RT = "-----BEGIN CERTIFICATE-----
" . chunk_split($kK, 64) . "-----END CERTIFICATE-----\xa";
return $RT;
DEi:
}
M7A:
if ($ia == "testValidate" or $ia == "testNewCertificate") {
goto wgj;
}
wp_die("We could not sign you in. Please contact your Administrator", "Error :Certificate not found");
goto sI8;
wgj:
$RT = "-----BEGIN CERTIFICATE-----<br>" . chunk_split($kK, 64) . "<br>-----END CERTIFICATE-----";
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>
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Unable to find a certificate matching the configured fingerprint.</p>\xa\x9\x9 <p>Please contact your administrator and report the following error:</p>
\x9\x9<p><strong>Possible Cause: </strong>'X.509 Certificate' field in plugin does not match the certificate found in SAML Response.</p>\xa\x9\x9\x9<p><strong>Certificate found in SAML Response: </strong><br><br>" . wp_kses($RT, array("br" => array())) . "</p>
\x9 \x9</div>
\x9\x9\x9 \x9<div style="margin:3%;display:block;text-align:center;">\xa\xa\x9 \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>";
exit;
sI8:
}
private static function doDecryptElement(DOMElement $pP, XMLSecurityKey $TO, array &$Jg)
{
$BJ = new XMLSecEnc();
$BJ->setNode($pP);
$BJ->type = $pP->getAttribute("Type");
$jo = $BJ->locateKey($pP);
if ($jo) {
goto LEs;
}
echo sprintf("Could not locate key algorithm in encrypted data.");
exit;
LEs:
$As = $BJ->locateKeyInfo($jo);
if ($As) {
goto ozC;
}
echo sprintf("Could not locate <dsig:KeyInfo> for the encrypted key.");
exit;
ozC:
$rB = $TO->getAlgorith();
if ($As->isEncrypted) {
goto Btx;
}
$Nc = $jo->getAlgorith();
if (!($rB !== $Nc)) {
goto Yxl;
}
echo sprintf("Algorithm mismatch between input key and key in message. " . "Key was: " . esc_html(var_export($rB, TRUE)) . "; message was: " . esc_html(var_export($Nc, TRUE)));
exit;
Yxl:
$jo = $TO;
goto csy;
Btx:
$R0 = $As->getAlgorith();
if (!mo_saml_in_array($R0, $Jg, TRUE)) {
goto CRG;
}
echo sprintf("Algorithm disabled: " . esc_html(var_export($R0, TRUE)));
exit;
CRG:
if (!($R0 === XMLSecurityKey::RSA_OAEP_MGF1P && $rB === XMLSecurityKey::RSA_1_5)) {
goto POq;
}
$rB = XMLSecurityKey::RSA_OAEP_MGF1P;
POq:
if (!($rB !== $R0)) {
goto s5w;
}
echo sprintf("Algorithm mismatch between input key and key used to encrypt " . " the symmetric key for the message. Key was: " . esc_html(var_export($rB, TRUE)) . "; message was: " . esc_html(var_export($R0, TRUE)));
exit;
s5w:
$YN = $As->encryptedCtx;
$As->key = $TO->key;
$lU = $jo->getSymmetricKeySize();
if (!($lU === NULL)) {
goto PNS;
}
echo sprintf("Unknown key size for encryption algorithm: " . esc_html(var_export($jo->type, TRUE)));
exit;
PNS:
try {
$Jp = $YN->decryptKey($As);
if (!(strlen($Jp) != $lU)) {
goto t1R;
}
echo sprintf("Unexpected key size (" . esc_html(strlen($Jp) * 8) . "bits) for encryption algorithm: " . esc_html(var_export($jo->type, TRUE)));
exit;
t1R:
} catch (Exception $AM) {
$oF = $YN->getCipherValue();
$eI = openssl_pkey_get_details($As->key);
$eI = sha1(serialize($eI), TRUE);
$Jp = sha1($oF . $eI, TRUE);
if (strlen($Jp) > $lU) {
goto Wl1;
}
if (!(strlen($Jp) < $lU)) {
goto Ujb;
}
$Jp = str_pad($Jp, $lU);
Ujb:
goto aFx;
Wl1:
$Jp = substr($Jp, 0, $lU);
aFx:
}
$jo->loadkey($Jp);
csy:
$ng = $jo->getAlgorith();
if (!mo_saml_in_array($ng, $Jg, TRUE)) {
goto PIk;
}
echo sprintf("Algorithm disabled: " . esc_html(var_export($ng, TRUE)));
exit;
PIk:
$Gs = $BJ->decryptNode($jo, FALSE);
$C2 = "<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" " . "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">" . $Gs . "</root>";
$Cj = new DOMDocument();
if (@$Cj->loadXML($C2)) {
goto V7O;
}
throw new Exception("Failed to parse decrypted XML. Maybe the wrong sharedkey was used?");
V7O:
$UG = $Cj->firstChild->firstChild;
if (!($UG === NULL)) {
goto Tj4;
}
echo sprintf("Missing encrypted element.");
throw new Exception("Missing encrypted element.");
Tj4:
if ($UG instanceof DOMElement) {
goto xuq;
}
echo sprintf("Decrypted element was not actually a DOMElement.");
xuq:
return $UG;
}
public static function decryptElement(DOMElement $pP, XMLSecurityKey $TO, array $Jg = array(), XMLSecurityKey $dB = NULL)
{
try {
return self::doDecryptElement($pP, $TO, $Jg);
} catch (Exception $AM) {
try {
} catch (Exception $ok) {
}
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>\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Invalid Audience URI.</p>\xa <p>Please contact your administrator and report the following error:</p>
<p><strong>Possible Cause: </strong>Incorrect certificate added on the Identity Provider for Encryption</p>\xa\x9 \x9\x9 <p><strong>Solution:</strong> Please check if the certificate added in Identity Provider is same as the certificate provided in the Plugin</p>\xa \x9\x9\x9</div>
<div style="margin:3%;display:block;text-align:center;">
<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;
exit;
}
}
public static function getEncryptionAlgorithm($qm)
{
switch ($qm) {
case "http://www.w3.org/2001/04/xmlenc#tripledes-cbc":
return XMLSecurityKey::TRIPLEDES_CBC;
goto eQj;
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 eQj;
case "http://www.w3.org/2001/04/xmlenc#aes256-cbc":
return XMLSecurityKey::AES256_CBC;
goto eQj;
case "http://www.w3.org/2001/04/xmlenc#rsa-1_5":
return XMLSecurityKey::RSA_1_5;
goto eQj;
case "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p":
return XMLSecurityKey::RSA_OAEP_MGF1P;
goto eQj;
case "http://www.w3.org/2000/09/xmldsig#dsa-sha1":
return XMLSecurityKey::DSA_SHA1;
goto eQj;
case "http://www.w3.org/2000/09/xmldsig#rsa-sha1":
return XMLSecurityKey::RSA_SHA1;
goto eQj;
case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":
return XMLSecurityKey::RSA_SHA256;
goto eQj;
case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384":
return XMLSecurityKey::RSA_SHA384;
goto eQj;
case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":
return XMLSecurityKey::RSA_SHA512;
goto eQj;
default:
echo sprintf("Invalid Encryption Method: " . esc_html($qm));
exit;
goto eQj;
}
rZ2:
eQj:
}
public static function insertSignature(XMLSecurityKey $Jp, array $KA, DOMElement $ei, DOMNode $qg = NULL)
{
$gp = new XMLSecurityDSig();
$gp->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
switch ($Jp->type) {
case XMLSecurityKey::RSA_SHA256:
$bI = XMLSecurityDSig::SHA256;
goto Axk;
case XMLSecurityKey::RSA_SHA384:
$bI = XMLSecurityDSig::SHA384;
goto Axk;
case XMLSecurityKey::RSA_SHA512:
$bI = XMLSecurityDSig::SHA512;
goto Axk;
default:
$bI = XMLSecurityDSig::SHA1;
}
o8Q:
Axk:
$gp->addReferenceList(array($ei), $bI, array("http://www.w3.org/2000/09/xmldsig#enveloped-signature", XMLSecurityDSig::EXC_C14N), array("id_name" => "ID", "overwrite" => FALSE));
$gp->sign($Jp);
foreach ($KA as $aB) {
$gp->add509Cert($aB, TRUE);
sWW:
}
uQr:
$gp->insertSignature($ei, $qg);
}
public static function getRemainingDaysOfCurrentCertificate()
{
$aB = get_option("mo_saml_current_cert");
$uJ = openssl_x509_parse($aB);
$XN = $uJ["validTo_time_t"];
$iU = $XN - time();
return round($iU / (60 * 60 * 24));
}
public static function getExpiryDateOfCurrentCertificate()
{
$aB = get_option("mo_saml_current_cert");
$uJ = openssl_x509_parse($aB);
return $uJ["validTo_time_t"];
}
public static function getValidUntilDateFromCert($aB)
{
$uJ = openssl_x509_parse($aB);
$XN = $uJ["validTo_time_t"];
$EO = date("Y-m-d", $XN);
$fi = $EO . "T23:59:59Z";
return $fi;
}
public static function signXML($C2, $ZK = '', $TM = false)
{
$AP = array("type" => "private");
$Jp = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $AP);
if ($TM) {
goto z9U;
}
$mC = get_option("mo_saml_current_cert_private_key");
$pT = get_option("mo_saml_current_cert");
goto sHx;
z9U:
$mC = file_get_contents(plugin_dir_path(__FILE__) . "resources" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Private_Key);
$pT = file_get_contents(plugin_dir_path(__FILE__) . "resources" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Public_Certificate);
sHx:
$Jp->loadKey($mC, FALSE);
$cp = new DOMDocument();
$cp->loadXML($C2);
$mn = $cp->firstChild;
if (!empty($ZK)) {
goto TJa;
}
self::insertSignature($Jp, array($pT), $mn);
goto Iqt;
TJa:
$RY = $cp->getElementsByTagName($ZK)->item(0);
self::insertSignature($Jp, array($pT), $mn, $RY);
Iqt:
$jI = $mn->ownerDocument->saveXML($mn);
$Is = base64_encode($jI);
return $Is;
}
public static function postSAMLRequest($Ug, $ms, $ia)
{
echo "
\x9 <html>\xa \x9 <body>Please wait...
\x9\x9 \x9<form action="" . esc_url($Ug) . "" method="post" id="saml-request-form">\xa\x9 \x9<input type="hidden" name="SAMLRequest" value="" . esc_attr($ms) . "" />
\x9 \x9\x9<input type="hidden" name="RelayState" value="" . esc_attr($ia) . "" />";
echo "
\x9\x9\x9 </form>\xa \x9\x9 <script>document.getElementById('saml-request-form').submit();</script>\xa\x9 </body>\xa \x9</html>";
exit;
}
public static function postSAMLResponse($Ug, $MY, $ia)
{
echo "
\x9<html>\xa\x9\x9 <body>Please wait...\xa\x9\x9\x9 \x9<form action="" . esc_url($Ug) . "" method="post" id="saml-response-form">
\x9 <input type="hidden" name="SAMLResponse" value="" . esc_attr($MY) . "" />\xa\x9\x9\x9 \x9 <input type="hidden" name="RelayState" value="" . esc_attr($ia) . "" />\xa\x9 \x9 \x9</form>\xa \x9 <script>document.getElementById('saml-response-form').submit();</script>\xa\x9\x9 \x9</body>
\x9</html>";
exit;
}
public static function sanitize_certificate($aB)
{
$aB = trim($aB);
$aB = preg_replace("/[\xd\xa]+/", '', $aB);
$aB = str_replace("-", '', $aB);
$aB = str_replace("BEGIN CERTIFICATE", '', $aB);
$aB = str_replace("END CERTIFICATE", '', $aB);
$aB = str_replace(" ", '', $aB);
$aB = chunk_split($aB, 64, "
\xa");
$aB = "-----BEGIN CERTIFICATE-----
\xa" . $aB . "-----END CERTIFICATE-----";
return $aB;
}
public static function desanitize_certificate($aB)
{
$aB = preg_replace("/[\xd\xa]+/", '', $aB);
$aB = str_replace("-----BEGIN CERTIFICATE-----", '', $aB);
$aB = str_replace("-----END CERTIFICATE-----", '', $aB);
$aB = str_replace(" ", '', $aB);
return $aB;
}
public static function mo_saml_wp_remote_call($Ug, $WT = array(), $Zj = false)
{
if (!$Zj) {
goto yKi;
}
$HS = wp_remote_get($Ug, $WT);
goto mYk;
yKi:
$HS = wp_remote_post($Ug, $WT);
mYk:
if (!is_wp_error($HS)) {
goto bab;
}
update_option("mo_saml_message", "Unable to connect to the Internet. Please try again.");
self::mo_saml_show_error_message();
return false;
goto mb0;
bab:
return $HS["body"];
mb0:
}
public static function get_expiry_notice_class($f0)
{
if ($f0 < 60 && $f0 > 0) {
goto y7O;
}
if ($f0 <= 0 && $f0 > -15) {
goto fJd;
}
if ($f0 <= -15) {
goto emZ;
}
goto Wmr;
y7O:
return "mo-saml-warning-yellow";
goto Wmr;
fJd:
return "mo-saml-warning-orange";
goto Wmr;
emZ:
return "mo-saml-warning-red";
Wmr:
return '';
}
public static function get_box_expiry_notice_heading($sY, $f0, $Lf)
{
$vW = '';
if ($f0 < 60 && $f0 >= 0) {
goto a9W;
}
if ($f0 < 0 && $f0 > -15) {
goto NY0;
}
if ($f0 <= -15) {
goto idL;
}
goto dM_;
a9W:
$vW = "License Expiry Notice : Plugin License getting expired in <span id="mo_saml_profile_box_counter">" . ($f0 + 1) . "</span> days";
goto dM_;
NY0:
$vW = "Your plugin has expired and SSO will stop working on " . $Lf . ". Renew your license now to avoid disruption.";
goto dM_;
idL:
$vW = "Warning : Your SSO has stopped working. Renew your license now!";
dM_:
return $vW;
}
public static function mo_saml_get_plugin_dir_url()
{
return plugin_dir_url(__FILE__);
}
public static function mo_saml_show_success_message()
{
remove_action("admin_notices", array("SAMLSPUtilities", "mo_saml_success_message"));
add_action("admin_notices", array("SAMLSPUtilities", "mo_saml_error_message"));
}
public static function mo_saml_show_error_message()
{
remove_action("admin_notices", array("SAMLSPUtilities", "mo_saml_error_message"));
add_action("admin_notices", array("SAMLSPUtilities", "mo_saml_success_message"));
}
public static function mo_saml_success_message()
{
$jW = "error";
$dq = get_option("mo_saml_message");
echo wp_kses("<div class='" . esc_attr($jW) . "'> <p>" . self::mo_saml_kses_esc_message($dq) . "</p></div>", array("div" => array("class" => array()), "p" => array()));
}
public static function mo_saml_error_message()
{
$jW = "updated";
$dq = get_option("mo_saml_message");
echo wp_kses("<div class='" . esc_attr($jW) . "'> <p>" . self::mo_saml_kses_esc_message($dq) . "</p></div>", array("div" => array("class" => array()), "p" => array()));
}
}
?>
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
*/
require_once Mo_Saml_Plugin_Files::MO_SAML_XML_SEC_LIBS;
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
class SAMLSPUtilities
{
public static function generateID()
{
return "\x5f" . self::stringToHex(self::generateRandomBytes(21));
}
public static function stringToHex($MX)
{
$GP = '';
$YE = 0;
Fy_:
if (!($YE < strlen($MX))) {
goto QdK;
}
$GP .= sprintf("\45\x30\x32\170", ord($MX[$YE]));
gsQ:
$YE++;
goto Fy_;
QdK:
return $GP;
}
public static function generateRandomBytes($f6, $ir = TRUE)
{
return openssl_random_pseudo_bytes($f6);
}
public static function createAuthnRequest($f4, $Nl, $Ax, $S7 = "\146\141\154\x73\x65", $Iy = "\110\164\x74\160\x52\145\144\151\162\x65\x63\x74", $q2 = '')
{
$q2 = "\x75\162\x6e\72\x6f\x61\x73\151\x73\x3a\156\141\x6d\x65\163\72\164\143\x3a\x53\101\115\114\x3a" . $q2;
$jT = "\74\x3f\170\x6d\154\x20\166\145\162\163\x69\x6f\x6e\x3d\42\x31\x2e\60\x22\40\x65\x6e\x63\157\144\151\156\x67\x3d\x22\x55\124\x46\x2d\x38\x22\77\x3e" . "\74\163\x61\x6d\x6c\160\72\101\x75\x74\x68\x6e\x52\145\x71\165\145\163\164\x20\x78\155\x6c\x6e\163\72\x73\x61\155\154\x70\75\42\165\x72\156\72\x6f\x61\x73\151\x73\72\x6e\141\155\145\163\72\164\x63\x3a\123\x41\115\x4c\x3a\62\56\x30\72\x70\x72\x6f\164\x6f\143\157\154\x22\x20\x78\155\154\x6e\x73\75\x22\165\x72\x6e\x3a\157\x61\163\151\163\x3a\156\141\x6d\x65\163\72\x74\143\x3a\123\101\x4d\114\72\62\56\60\x3a\141\163\x73\145\162\x74\151\157\x6e\x22\x20\x49\x44\x3d\42" . self::generateID() . "\x22\40\126\x65\162\x73\x69\x6f\156\75\x22\62\56\60\x22\x20\x49\x73\163\x75\145\111\x6e\163\164\x61\156\x74\x3d\42" . self::generateTimestamp() . "\42";
if (!($S7 == "\164\x72\x75\x65")) {
goto el3;
}
$jT .= "\x20\106\157\x72\x63\145\101\x75\x74\x68\156\x3d\x22\x74\162\165\145\x22";
el3:
$jT .= "\40\x50\x72\x6f\x74\157\143\157\154\x42\x69\156\144\x69\x6e\147\75\42\x75\x72\156\72\x6f\141\163\x69\163\72\156\141\155\145\x73\x3a\164\x63\x3a\123\x41\115\x4c\x3a\62\56\x30\72\x62\151\156\x64\x69\x6e\x67\x73\72\x48\x54\x54\x50\x2d\x50\x4f\123\124\x22\x20\101\163\163\x65\x72\x74\151\157\156\103\157\x6e\x73\165\155\x65\x72\x53\x65\162\x76\x69\143\145\125\122\x4c\75\x22" . $f4 . "\42\x20\104\145\x73\x74\151\x6e\141\164\151\x6f\x6e\75\x22" . $Ax . "\x22\76\x3c\x73\x61\155\154\72\x49\x73\x73\165\145\x72\x20\x78\x6d\x6c\156\163\72\163\141\x6d\154\x3d\x22\165\x72\x6e\72\x6f\141\x73\x69\x73\72\156\x61\x6d\x65\x73\x3a\164\x63\72\x53\101\x4d\x4c\x3a\x32\56\x30\x3a\x61\163\x73\x65\x72\164\151\x6f\156\42\76" . $Nl . "\74\x2f\x73\x61\x6d\154\72\x49\x73\x73\165\x65\162\x3e\74\163\141\155\154\x70\72\116\141\155\x65\111\104\x50\x6f\x6c\151\143\171\x20\101\154\x6c\157\x77\x43\162\145\141\x74\x65\x3d\x22\x74\162\165\145\42\x20\x46\157\x72\155\141\164\x3d\42" . $q2 . "\42\12\40\x20\x20\40\x20\x20\x20\40\40\40\40\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\57\x3e\x3c\57\x73\141\x6d\x6c\x70\72\101\x75\x74\150\156\x52\145\161\x75\145\163\164\76";
if (empty($Iy) || $Iy == "\x48\164\x74\x70\122\145\x64\151\162\x65\x63\x74") {
goto Bki;
}
$vF = gzdeflate($jT);
$VK = base64_encode($vF);
goto Ucg;
Bki:
$vF = gzdeflate($jT);
$VK = base64_encode($vF);
$Ue = urlencode($VK);
$jT = $Ue;
Ucg:
update_option("\115\117\x5f\123\101\x4d\x4c\137\x52\105\121\125\105\123\124", $VK);
return $jT;
}
public static function generateTimestamp($Ab = NULL)
{
if (!($Ab === NULL)) {
goto vbI;
}
$Ab = time();
vbI:
return gmdate("\x59\55\155\55\x64\134\124\110\72\151\72\163\134\x5a", $Ab);
}
public static function xpQuery(DOMNode $vJ, $wy)
{
static $dF = NULL;
if ($vJ instanceof DOMDocument) {
goto Ty0;
}
$PU = $vJ->ownerDocument;
goto Tle;
Ty0:
$PU = $vJ;
Tle:
if (!($dF === NULL || !$dF->document->isSameNode($PU))) {
goto FQ2;
}
$dF = new DOMXPath($PU);
$dF->registerNamespace("\x73\157\x61\x70\55\x65\156\x76", "\x68\x74\164\x70\72\x2f\57\x73\x63\150\145\x6d\141\x73\56\170\155\x6c\x73\157\141\x70\x2e\x6f\162\147\x2f\163\x6f\x61\x70\x2f\x65\156\166\x65\x6c\x6f\x70\x65\57");
$dF->registerNamespace("\x73\141\155\x6c\137\x70\x72\x6f\164\x6f\143\157\x6c", "\165\162\x6e\72\157\x61\163\151\163\72\156\141\155\x65\163\x3a\164\143\72\x53\x41\115\114\x3a\x32\x2e\60\72\x70\162\157\164\x6f\143\157\154");
$dF->registerNamespace("\x73\141\155\154\137\141\163\x73\x65\x72\x74\151\x6f\156", "\x75\162\x6e\72\x6f\141\x73\151\163\72\x6e\x61\x6d\x65\x73\72\x74\x63\72\123\101\115\114\72\x32\x2e\x30\x3a\x61\163\x73\145\162\x74\151\157\x6e");
$dF->registerNamespace("\x73\x61\155\x6c\137\155\x65\164\141\x64\x61\x74\141", "\x75\x72\156\72\157\141\x73\151\163\x3a\156\141\155\x65\163\x3a\x74\x63\72\123\101\x4d\x4c\x3a\x32\56\60\72\155\x65\164\x61\x64\141\x74\141");
$dF->registerNamespace("\144\x73", "\x68\164\x74\160\x3a\x2f\x2f\x77\x77\167\56\x77\x33\x2e\x6f\x72\147\57\62\x30\x30\x30\57\60\x39\57\x78\155\154\144\x73\151\x67\43");
$dF->registerNamespace("\x78\145\156\143", "\x68\x74\x74\160\x3a\x2f\57\167\x77\x77\x2e\167\63\x2e\x6f\162\x67\57\62\x30\60\x31\x2f\x30\x34\x2f\x78\x6d\x6c\145\x6e\143\x23");
FQ2:
$ZH = $dF->query($wy, $vJ);
$GP = array();
$YE = 0;
tyE:
if (!($YE < $ZH->length)) {
goto WPM;
}
$GP[$YE] = $ZH->item($YE);
TDQ:
$YE++;
goto tyE;
WPM:
return $GP;
}
public static function parseNameId(DOMElement $C2)
{
$GP = array("\x56\141\x6c\165\x65" => trim($C2->textContent));
foreach (array("\116\141\155\x65\x51\x75\x61\154\x69\x66\151\145\x72", "\123\x50\116\141\155\145\121\x75\x61\154\x69\x66\x69\145\162", "\106\x6f\162\x6d\141\x74") as $YT) {
if (!$C2->hasAttribute($YT)) {
goto Fvl;
}
$GP[$YT] = $C2->getAttribute($YT);
Fvl:
hme:
}
DmW:
return $GP;
}
public static function xsDateTimeToTimestamp($Tv)
{
$yZ = array();
$uc = "\57\x5e\50\134\144\134\x64\x5c\144\x5c\144\x29\x2d\x28\134\144\134\144\51\55\50\x5c\x64\x5c\x64\x29\x54\50\134\x64\x5c\144\x29\72\50\134\x64\134\144\x29\x3a\x28\x5c\144\x5c\x64\51\50\77\72\134\56\x5c\144\x2b\x29\77\x5a\x24\x2f\x44";
if (!(preg_match($uc, $Tv, $yZ) == 0)) {
goto F0Z;
}
echo sprintf("\111\156\x76\141\x6c\151\x64\40\x53\x41\x4d\114\x32\40\x74\x69\155\145\x73\164\x61\155\x70\40\160\x61\x73\163\145\144\40\164\157\x20\x78\x73\x44\141\164\145\124\151\155\x65\x54\157\x54\x69\x6d\x65\x73\164\x61\x6d\x70\x3a\40" . esc_html($Tv));
exit;
F0Z:
$SE = intval($yZ[1]);
$xn = intval($yZ[2]);
$qG = intval($yZ[3]);
$dy = intval($yZ[4]);
$MS = intval($yZ[5]);
$gw = intval($yZ[6]);
$rK = gmmktime($dy, $MS, $gw, $xn, $qG, $SE);
return $rK;
}
public static function extractStrings(DOMElement $ns, $F0, $M9)
{
$GP = array();
$vJ = $ns->firstChild;
Z0M:
if (!($vJ !== NULL)) {
goto GfL;
}
if (!($vJ->namespaceURI !== $F0 || $vJ->localName !== $M9)) {
goto Jad;
}
goto iTw;
Jad:
$GP[] = trim($vJ->textContent);
iTw:
$vJ = $vJ->nextSibling;
goto Z0M;
GfL:
return $GP;
}
public static function validateElement(DOMElement $ei)
{
$gp = new XMLSecurityDSig();
$gp->idKeys[] = "\111\104";
$hh = self::xpQuery($ei, "\56\x2f\144\163\72\123\x69\x67\x6e\141\x74\x75\162\145");
if (count($hh) === 0) {
goto iiY;
}
if (!(count($hh) > 1)) {
goto q4A;
}
echo sprintf("\x58\115\114\123\145\x63\x3a\40\x6d\x6f\162\x65\x20\164\x68\x61\156\40\x6f\x6e\x65\x20\163\x69\147\156\141\x74\165\x72\x65\40\x65\154\145\155\145\x6e\x74\40\151\156\x20\x72\x6f\157\x74\56");
exit;
q4A:
goto iUZ;
iiY:
return FALSE;
iUZ:
$hh = $hh[0];
$gp->sigNode = $hh;
$gp->canonicalizeSignedInfo();
if ($gp->validateReference()) {
goto SLr;
}
echo sprintf("\130\x4d\x4c\x73\145\143\x3a\40\144\151\147\145\163\164\x20\166\141\x6c\151\x64\x61\164\151\157\156\40\x66\x61\x69\x6c\x65\x64");
exit;
SLr:
$HP = FALSE;
foreach ($gp->getValidatedNodes() as $zS) {
if ($zS->isSameNode($ei)) {
goto hGj;
}
if (!($ei->parentNode instanceof DOMDocument && $zS->isSameNode($ei->ownerDocument))) {
goto CLJ;
}
$HP = TRUE;
goto dKK;
CLJ:
goto PJj;
hGj:
$HP = TRUE;
goto dKK;
PJj:
AIk:
}
dKK:
if ($HP) {
goto wqF;
}
echo sprintf("\130\x4d\x4c\x53\145\x63\x3a\40\x54\x68\x65\x20\162\157\157\164\x20\145\x6c\145\155\x65\156\x74\x20\x69\163\40\156\157\x74\x20\x73\x69\x67\x6e\145\144\x2e");
exit;
wqF:
$KA = array();
foreach (self::xpQuery($hh, "\x2e\57\x64\163\72\113\x65\171\x49\x6e\146\157\57\x64\x73\72\x58\x35\60\x39\104\141\164\x61\57\x64\163\72\x58\x35\60\x39\x43\145\162\164\151\146\151\x63\x61\164\145") as $k7) {
$wR = trim($k7->textContent);
$wR = str_replace(array("\15", "\12", "\11", "\x20"), '', $wR);
$KA[] = $wR;
eTe:
}
yp9:
$GP = array("\x53\151\147\x6e\141\164\165\162\x65" => $gp, "\x43\145\x72\x74\x69\x66\151\x63\141\164\145\163" => $KA);
return $GP;
}
public static function validateSignature(array $qE, XMLSecurityKey $Jp)
{
$gp = $qE["\x53\151\x67\156\141\164\x75\162\x65"];
$GC = self::xpQuery($gp->sigNode, "\x2e\57\144\163\72\123\x69\x67\x6e\145\144\x49\156\x66\157\x2f\144\x73\x3a\123\x69\147\156\x61\164\x75\162\145\115\145\x74\x68\157\144");
if (!empty($GC)) {
goto Nof;
}
echo sprintf("\115\151\163\x73\x69\156\x67\40\123\x69\147\156\x61\x74\x75\162\x65\x4d\145\x74\150\x6f\144\x20\x65\154\x65\x6d\x65\156\164");
exit;
Nof:
$GC = $GC[0];
if ($GC->hasAttribute("\x41\x6c\147\157\162\151\x74\150\155")) {
goto tOO;
}
echo sprintf("\x4d\x69\x73\x73\x69\156\x67\40\x41\154\x67\x6f\x72\x69\164\150\x6d\x2d\141\164\x74\162\x69\142\165\x74\145\x20\157\x6e\x20\123\151\147\x6e\141\x74\x75\x72\x65\115\x65\164\150\x6f\144\40\145\x6c\145\155\145\x6e\164\56");
exit;
tOO:
$qA = $GC->getAttribute("\101\154\x67\x6f\162\x69\164\x68\x6d");
if (!($Jp->type === XMLSecurityKey::RSA_SHA1 && $qA !== $Jp->type)) {
goto j3t;
}
$Jp = self::castKey($Jp, $qA);
j3t:
if ($gp->verify($Jp)) {
goto fib;
}
echo sprintf("\x55\156\x61\142\x6c\145\40\164\x6f\x20\x76\x61\154\151\x64\141\164\x65\40\x53\x69\147\x6e\141\x74\x75\162\x65");
exit;
fib:
}
public static function castKey(XMLSecurityKey $Jp, $ng, $bI = "\x70\x75\x62\x6c\x69\x63")
{
if (!($Jp->type === $ng)) {
goto JR9;
}
return $Jp;
JR9:
$DS = openssl_pkey_get_details($Jp->key);
if (!($DS === FALSE)) {
goto VAo;
}
echo sprintf("\125\x6e\x61\x62\x6c\x65\x20\164\x6f\40\x67\145\x74\x20\153\x65\171\40\144\x65\x74\x61\151\154\x73\40\x66\x72\157\x6d\x20\x58\115\x4c\x53\x65\143\165\162\x69\164\x79\113\145\x79\x2e");
exit;
VAo:
if (isset($DS["\x6b\x65\x79"])) {
goto Q4I;
}
echo sprintf("\115\x69\x73\x73\x69\156\147\40\153\x65\x79\x20\151\x6e\x20\x70\165\142\154\151\143\40\153\145\x79\40\144\145\x74\141\151\x6c\x73\x2e");
exit;
Q4I:
$hE = new XMLSecurityKey($ng, array("\x74\171\160\145" => $bI));
$hE->loadKey($DS["\x6b\145\x79"]);
return $hE;
}
public static function processResponse($dW, $RE, $mo, SAML2SPResponse $HS, $Hy, $ia)
{
$zC = current($HS->getAssertions());
$QG = $zC->getNotBefore();
if (!($QG !== NULL && $QG > time() + 60)) {
goto iXv;
}
wp_die("\x52\x65\x63\145\x69\x76\x65\x64\x20\x61\156\x20\x61\x73\x73\x65\x72\164\x69\x6f\x6e\40\164\x68\x61\x74\x20\151\163\40\x76\x61\x6c\151\x64\40\151\156\x20\x74\x68\145\x20\x66\165\x74\165\162\x65\56\40\x43\x68\145\x63\x6b\40\143\154\x6f\x63\x6b\x20\163\x79\x6e\x63\150\162\157\x6e\151\x7a\x61\164\x69\x6f\156\x20\157\156\x20\x49\x64\x50\x20\141\156\144\40\x53\120\x2e");
iXv:
$Je = $zC->getNotOnOrAfter();
if (!($Je !== NULL && $Je <= time() - 60)) {
goto fXk;
}
wp_die("\122\x65\143\x65\151\x76\145\x64\x20\x61\156\x20\x61\x73\x73\145\x72\164\151\157\x6e\x20\164\150\141\x74\40\150\x61\163\40\x65\x78\160\151\162\145\x64\56\x20\x43\x68\145\x63\x6b\40\x63\154\x6f\143\x6b\40\x73\171\156\x63\x68\162\x6f\x6e\x69\x7a\141\x74\x69\x6f\156\x20\157\x6e\x20\111\x64\x50\x20\x61\x6e\144\40\x53\120\x2e");
fXk:
$GZ = $zC->getSessionNotOnOrAfter();
if (!($GZ !== NULL && $GZ <= time() - 60)) {
goto YXF;
}
wp_die("\x52\x65\x63\x65\151\x76\x65\144\x20\141\156\x20\x61\163\163\x65\162\x74\151\157\x6e\x20\167\x69\x74\x68\40\141\40\x73\145\163\x73\151\x6f\156\40\164\x68\141\x74\x20\x68\141\x73\40\x65\x78\160\x69\162\145\x64\56\x20\103\150\x65\143\153\40\x63\x6c\x6f\143\153\x20\163\171\x6e\143\150\162\157\x6e\151\x7a\x61\x74\151\x6f\x6e\40\157\156\x20\x49\x64\120\x20\141\x6e\x64\40\x53\120\x2e");
YXF:
$Ux = $HS->getDestination();
if (!(substr($Ux, -1) == "\x2f")) {
goto UXS;
}
$Ux = substr($Ux, 0, -1);
UXS:
if (!(substr($dW, -1) == "\57")) {
goto l1Z;
}
$dW = substr($dW, 0, -1);
l1Z:
if (!($Ux !== NULL && $Ux !== $dW)) {
goto TUc;
}
echo "\x44\x65\163\x74\x69\x6e\141\x74\151\157\x6e\40\x69\x6e\x20\162\145\163\160\157\x6e\x73\x65\x20\x64\157\145\x73\156\47\x74\40\155\141\164\x63\150\x20\164\150\x65\x20\143\x75\162\x72\x65\156\164\40\x55\122\114\56\40\104\145\x73\164\x69\x6e\x61\x74\x69\x6f\156\x20\151\163\x20\x22" . esc_html(htmlspecialchars($Ux)) . "\42\x2c\40\x63\x75\162\x72\145\156\164\x20\125\x52\114\40\x69\x73\40\42" . esc_html(htmlspecialchars($dW)) . "\x22\56";
exit;
TUc:
$RO = self::checkSign($RE, $mo, $Hy, $ia);
return $RO;
}
public static function checkSign($RE, $mo, $Hy, $ia)
{
$KA = $mo["\103\145\162\x74\x69\x66\151\143\141\164\145\x73"];
if (count($KA) === 0) {
goto A7l;
}
$r2 = array();
$r2[] = $RE;
$pV = self::findCertificate($r2, $KA, $ia);
if (!($pV == false)) {
goto hIG;
}
return false;
hIG:
goto J06;
A7l:
$cw = maybe_unserialize(get_option("\163\141\x6d\x6c\137\x78\x35\x30\71\137\143\145\162\x74\x69\x66\151\143\x61\164\145"));
$pV = $cw[$Hy];
J06:
$a3 = NULL;
$Jp = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array("\x74\171\160\145" => "\160\x75\142\154\151\x63"));
$Jp->loadKey($pV);
try {
self::validateSignature($mo, $Jp);
return TRUE;
} catch (Exception $AM) {
$a3 = $AM;
}
if ($a3 !== NULL) {
goto e2_;
}
return FALSE;
goto mTv;
e2_:
throw $a3;
mTv:
}
public static function mo_saml_add_query_arg($EL, $Q7)
{
return self::mo_saml_sanitize_url(add_query_arg($EL, $Q7));
}
public static function mo_saml_kses_esc_message($gc)
{
$Rc = array("\x61" => array("\163\x74\171\154\145" => array(), "\150\x72\x65\x66" => array(), "\x63\154\141\x73\x73" => array()));
return wp_kses($gc, $Rc);
}
public static function mo_saml_sanitize_url($Ug, $yd = null)
{
return esc_url($Ug, $yd, "\144\142");
}
public static function validateIssuerAndAudience($wh, $ym, $nr, $ia)
{
$Nl = current($wh->getAssertions())->getIssuer();
$zC = current($wh->getAssertions());
$vq = $zC->getValidAudiences();
if (strcmp($nr, $Nl) === 0) {
goto spv;
}
if ($ia == "\x74\x65\163\x74\x56\141\154\x69\144\x61\x74\x65" or $ia == "\164\x65\x73\164\x4e\145\x77\x43\x65\x72\164\151\x66\x69\x63\141\x74\145") {
goto fRR;
}
wp_die("\127\x65\40\143\x6f\x75\154\x64\x20\156\157\x74\x20\163\151\x67\156\x20\x79\x6f\165\x20\151\x6e\x2e\40\x50\x6c\145\x61\x73\x65\40\143\157\156\164\141\143\164\x20\171\157\x75\x72\40\101\x64\x6d\x69\156\151\163\x74\162\x61\164\x6f\162", "\105\162\x72\x6f\162\x20\x3a\111\163\x73\165\145\x72\x20\x63\141\156\156\157\x74\x20\142\x65\40\166\145\x72\151\146\151\x65\x64");
goto rhS;
fRR:
$Aq = mo_options_error_constants::Error_issuer_not_verfied;
$Rg = mo_options_error_constants::Cause_issuer_not_verfied;
echo "\x3c\144\151\x76\40\x73\164\x79\154\145\x3d\x22\x66\157\156\164\x2d\146\141\155\151\x6c\171\72\103\x61\x6c\x69\142\x72\151\73\x70\x61\144\x64\151\x6e\147\x3a\60\40\63\45\73\42\x3e";
echo "\74\x64\x69\166\x20\163\x74\171\x6c\145\75\42\x63\x6f\x6c\x6f\162\72\x20\x23\141\71\64\x34\x34\x32\73\142\x61\x63\153\147\x72\157\165\156\x64\55\x63\157\x6c\x6f\162\x3a\40\43\146\x32\x64\x65\144\x65\x3b\x70\141\144\x64\151\x6e\x67\x3a\40\x31\65\x70\170\x3b\x6d\x61\x72\147\x69\x6e\55\x62\157\x74\164\x6f\x6d\72\40\62\60\x70\170\73\x74\x65\x78\x74\55\x61\154\x69\x67\x6e\x3a\143\145\156\x74\x65\162\73\142\157\162\144\x65\162\72\x31\160\x78\40\x73\x6f\154\151\x64\40\43\x45\66\x42\x33\x42\62\x3b\146\x6f\x6e\x74\55\x73\151\172\x65\x3a\x31\70\x70\164\x3b\x22\76\x20\105\x52\122\x4f\122\x3c\x2f\x64\x69\x76\x3e\12\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\74\144\x69\166\x20\x73\x74\x79\x6c\x65\75\42\143\157\x6c\157\x72\72\x20\x23\x61\71\x34\x34\x34\62\73\146\x6f\156\164\55\x73\151\x7a\145\72\x31\x34\x70\164\73\x20\x6d\x61\x72\x67\151\156\x2d\x62\157\164\164\157\x6d\72\62\x30\160\170\x3b\164\145\x78\164\55\x61\x6c\151\x67\156\x3a\x20\152\165\163\164\151\146\171\42\76\74\x70\x3e\x3c\163\x74\162\x6f\156\147\76\105\x72\162\x6f\162\x3a" . esc_html($Aq) . "\x20\x3c\x2f\163\x74\162\157\156\147\76\74\x2f\x70\x3e\12\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\12\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\74\160\76\74\x73\x74\162\157\x6e\x67\x3e\120\x6f\163\163\151\142\154\x65\x20\103\x61\165\x73\x65\72" . esc_html($Rg) . "\40\x3c\x2f\163\x74\x72\157\x6e\147\76\x3c\x2f\160\x3e\xa\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\x20\74\160\x3e\x3c\x73\164\x72\157\x6e\147\x3e\105\x6e\164\x69\x74\x79\40\x49\x44\40\151\156\40\123\101\115\114\40\122\x65\x73\160\x6f\x6e\163\145\x3a\40\x3c\x2f\163\x74\x72\157\156\147\x3e" . esc_html($Nl) . "\x3c\160\x3e\xa\40\40\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x3c\160\x3e\x3c\x73\x74\x72\157\x6e\x67\x3e\x45\x6e\164\x69\164\171\x20\x49\104\40\x43\x6f\x6e\x66\151\147\x75\162\145\144\x20\x69\156\x20\x74\150\x65\x20\160\x6c\165\147\151\x6e\x3a\x20\x3c\x2f\x73\164\x72\157\x6e\x67\x3e" . esc_html($nr) . "\74\57\x70\x3e\xa\x9\11\11\11\74\x70\76\74\x73\x74\x72\x6f\x6e\147\x3e\x53\157\154\x75\x74\151\157\156\72\74\57\x73\x74\162\157\156\x67\x3e\x3c\57\160\76\12\11\x9\x9\x9\x3c\x6f\154\76\12\x9\11\x9\11\11\74\x6c\x69\x3e\x43\x6f\160\171\40\x74\150\x65\x20\x45\156\x74\x69\164\x79\40\111\x44\x20\157\146\40\123\101\115\x4c\40\x52\x65\163\x70\x6f\x6e\163\x65\40\x66\162\x6f\155\x20\x61\142\x6f\166\x65\x20\x61\x6e\x64\40\160\x61\163\x74\145\x20\x69\x74\x20\x69\156\40\105\x6e\164\x69\x74\x79\40\x49\x44\x20\x6f\x72\40\111\163\163\x75\x65\162\40\146\151\x65\x6c\x64\x20\x75\x6e\144\x65\162\x20\x53\x65\162\166\x69\143\145\40\120\x72\157\x76\x69\144\145\162\40\123\x65\164\x75\x70\x20\164\x61\142\x2e\74\57\154\x69\76\12\11\x9\x9\x9\74\x2f\157\x6c\x3e\12\x9\11\x9\x9\74\x2f\x64\x69\166\76\12\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\74\57\x64\x69\166\76";
mo_saml_download_logs($Aq, $Rg);
exit;
rhS:
goto v3q;
spv:
if (empty($vq)) {
goto kCG;
}
if (mo_saml_in_array($ym, $vq, TRUE)) {
goto k6P;
}
if ($ia == "\164\x65\163\x74\x56\x61\154\151\144\141\164\145" or $ia == "\x74\x65\163\x74\116\x65\167\x43\145\162\x74\151\x66\x69\x63\141\164\x65") {
goto L79;
}
wp_die("\127\x65\x20\x63\157\165\x6c\144\x20\156\157\164\x20\x73\151\147\156\x20\x79\157\x75\40\151\156\x2e\40\x50\x6c\145\x61\x73\x65\40\x63\x6f\x6e\x74\x61\143\x74\40\171\157\165\x72\x20\x41\144\155\151\x6e\x69\x73\x74\162\141\x74\x6f\162", "\105\162\162\157\162\40\72\x49\156\166\x61\154\x69\144\x20\101\x75\144\x69\x65\156\x63\145\40\125\122\x49");
goto RNY;
L79:
$Aq = mo_options_error_constants::Error_invalid_audience;
$Rg = mo_options_error_constants::Cause_invalid_audience;
echo "\74\144\x69\x76\x20\163\x74\171\x6c\145\75\42\x66\x6f\156\x74\x2d\x66\141\x6d\x69\x6c\171\x3a\103\x61\x6c\151\x62\x72\151\x3b\x70\x61\144\x64\151\x6e\x67\72\x30\x20\63\45\73\42\76";
echo "\74\144\151\x76\40\163\x74\x79\x6c\145\x3d\x22\x63\157\x6c\x6f\x72\72\x20\43\141\x39\64\x34\64\62\x3b\x62\141\143\153\147\162\157\x75\156\144\55\x63\157\x6c\157\x72\72\40\x23\146\x32\144\x65\144\145\x3b\160\141\144\x64\151\x6e\147\72\x20\61\65\160\170\73\155\x61\162\147\x69\x6e\x2d\142\x6f\x74\164\157\x6d\x3a\x20\x32\60\160\170\73\164\145\x78\x74\55\x61\x6c\151\147\156\x3a\143\145\x6e\164\145\x72\x3b\x62\x6f\x72\144\145\162\x3a\61\160\170\40\x73\157\x6c\151\x64\40\43\105\x36\102\63\x42\62\73\x66\157\156\x74\x2d\x73\151\172\145\x3a\x31\x38\x70\x74\x3b\x22\76\40\105\x52\122\117\122\x3c\57\144\x69\166\76\xa\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\74\x64\151\x76\x20\163\x74\171\x6c\145\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\43\141\71\64\x34\64\62\x3b\x66\157\156\164\x2d\x73\151\172\145\x3a\61\64\160\164\x3b\40\x6d\141\162\147\151\x6e\55\x62\x6f\164\x74\x6f\155\72\x32\60\x70\x78\x3b\x22\x3e\74\x70\x3e\x3c\163\x74\x72\157\x6e\x67\x3e\105\162\x72\x6f\162\x3a\x20\74\x2f\163\164\x72\157\156\x67\x3e" . esc_html($Aq) . "\x3c\57\160\x3e\12\x20\40\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\12\x20\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x3c\x70\x3e\74\163\164\162\157\x6e\x67\76\x50\157\163\163\151\142\154\x65\x20\103\x61\165\x73\145\72\x20\74\x2f\x73\164\x72\x6f\156\x67\x3e" . esc_html($Rg) . "\74\x2f\160\x3e\xa\40\40\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\74\160\76\105\170\x70\x65\143\x74\x65\144\x20\x6f\156\x65\40\x6f\146\x20\164\x68\145\x20\x41\165\144\x69\x65\x6e\143\x65\x73\x20\164\x6f\40\x62\x65\72\40" . esc_html($ym) . "\x3c\x70\76\12\11\11\11\11\x9\74\x70\76\x3c\163\164\162\157\156\147\76\x53\157\154\x75\164\x69\157\x6e\72\x3c\x2f\163\164\x72\x6f\x6e\147\x3e\x3c\57\x70\x3e\xa\11\x9\11\11\x9\x3c\157\x6c\x3e\xa\11\11\11\x9\11\11\74\x6c\x69\76\x43\x6f\x70\x79\x20\x74\150\145\40\105\x78\x70\145\x63\164\x65\144\x20\x41\x75\144\x69\145\156\143\x65\40\125\122\x49\x20\146\x72\x6f\x6d\40\141\142\157\166\x65\x20\x61\156\x64\40\x70\141\163\x74\x65\x20\151\x74\x20\x69\x6e\x20\x74\150\145\40\x41\165\x64\x69\x65\x6e\x63\x65\x20\x55\x52\111\x20\x66\151\145\x6c\x64\40\141\x74\40\111\x64\145\x6e\164\x69\x74\171\40\120\162\x6f\x76\x69\x64\145\x72\x20\163\x69\x64\x65\x2e\74\57\x6c\151\76\xa\x9\x9\x9\11\x9\x3c\x2f\x6f\154\x3e\xa\11\11\11\11\x9\74\57\144\x69\x76\x3e";
mo_saml_download_logs($Aq, $Rg);
exit;
RNY:
goto NG7;
k6P:
return TRUE;
NG7:
kCG:
v3q:
}
private static function findCertificate(array $q7, array $KA, $ia)
{
$GH = array();
foreach ($KA as $kK) {
$sq = strtolower(sha1(base64_decode($kK)));
if (mo_saml_in_array($sq, $q7, TRUE)) {
goto UfU;
}
$GH[] = $sq;
return false;
UfU:
$RT = "\x2d\x2d\x2d\55\x2d\x42\x45\107\111\116\40\x43\x45\x52\124\111\x46\111\103\x41\x54\x45\x2d\x2d\x2d\55\55\12" . chunk_split($kK, 64) . "\x2d\x2d\x2d\x2d\55\x45\116\x44\x20\x43\x45\122\124\x49\x46\111\103\101\124\105\x2d\x2d\x2d\x2d\x2d\xa";
return $RT;
DEi:
}
M7A:
if ($ia == "\164\145\163\164\x56\x61\154\x69\144\141\x74\x65" or $ia == "\164\x65\x73\164\116\145\x77\x43\x65\x72\x74\151\146\151\x63\141\164\x65") {
goto wgj;
}
wp_die("\127\x65\x20\x63\157\165\x6c\x64\x20\x6e\157\164\40\163\x69\x67\x6e\40\x79\157\x75\40\x69\156\56\x20\120\x6c\145\141\x73\x65\40\x63\157\156\x74\141\x63\164\40\171\157\x75\162\x20\x41\x64\x6d\151\x6e\x69\x73\164\x72\x61\164\157\x72", "\105\162\162\x6f\x72\40\72\x43\145\x72\164\151\146\151\x63\141\x74\x65\x20\156\x6f\x74\x20\x66\157\165\156\144");
goto sI8;
wgj:
$RT = "\x2d\55\x2d\x2d\55\102\105\107\111\116\40\103\105\122\x54\111\x46\x49\103\101\x54\105\55\55\x2d\55\55\74\142\162\x3e" . chunk_split($kK, 64) . "\74\x62\x72\76\55\55\55\x2d\x2d\105\x4e\x44\x20\x43\x45\x52\x54\111\x46\x49\x43\x41\x54\x45\x2d\x2d\x2d\x2d\55";
echo "\74\x64\151\x76\40\163\164\171\x6c\x65\x3d\42\x66\157\156\164\x2d\x66\141\155\x69\x6c\x79\x3a\103\x61\154\x69\142\162\151\x3b\160\141\144\144\x69\x6e\147\72\60\x20\63\x25\x3b\x22\76";
echo "\x3c\x64\151\x76\40\163\164\x79\154\145\x3d\x22\143\157\x6c\x6f\162\72\40\43\141\71\64\x34\64\x32\73\142\x61\143\x6b\147\x72\x6f\x75\x6e\144\x2d\143\x6f\x6c\157\162\x3a\x20\x23\x66\x32\x64\145\144\x65\73\x70\x61\144\144\151\156\x67\72\40\x31\x35\x70\x78\73\155\141\162\x67\x69\156\55\142\157\164\164\157\155\72\x20\62\x30\160\170\73\x74\x65\170\164\x2d\141\x6c\x69\147\156\72\x63\145\156\x74\x65\x72\x3b\x62\157\x72\x64\145\x72\72\61\160\x78\40\x73\157\154\151\x64\40\43\x45\66\x42\x33\102\x32\73\x66\x6f\x6e\x74\55\x73\x69\172\145\x3a\x31\x38\160\164\x3b\x22\76\40\x45\122\x52\x4f\x52\x3c\x2f\144\151\x76\x3e\12\11\11\11\x3c\x64\x69\166\x20\163\164\x79\x6c\x65\75\x22\x63\x6f\154\x6f\x72\x3a\x20\43\141\71\x34\x34\x34\x32\x3b\146\157\x6e\164\55\163\151\x7a\145\x3a\x31\64\x70\164\73\x20\155\141\162\147\x69\x6e\55\x62\157\164\x74\x6f\x6d\x3a\62\60\160\x78\73\x22\76\x3c\160\x3e\x3c\163\x74\162\x6f\156\147\76\105\x72\x72\x6f\x72\72\x20\x3c\57\163\x74\x72\x6f\156\147\x3e\x55\x6e\x61\142\154\x65\x20\164\x6f\40\146\x69\x6e\x64\40\x61\40\143\x65\162\164\x69\x66\151\143\141\x74\x65\40\x6d\x61\164\x63\150\151\156\x67\x20\x74\150\x65\x20\x63\157\x6e\146\x69\147\165\162\x65\x64\x20\x66\151\x6e\147\x65\x72\160\x72\x69\x6e\x74\56\x3c\57\x70\76\xa\x9\x9\11\74\x70\76\120\154\145\141\x73\145\40\x63\157\156\164\141\x63\164\x20\171\157\165\x72\40\x61\144\x6d\x69\156\151\x73\x74\x72\x61\164\x6f\162\40\x61\x6e\144\x20\x72\x65\160\x6f\x72\164\40\164\150\145\40\146\157\x6c\x6c\157\x77\x69\156\x67\x20\x65\x72\x72\157\162\x3a\74\x2f\x70\76\12\11\x9\x9\74\160\76\x3c\x73\x74\x72\157\156\147\x3e\120\157\x73\163\151\x62\154\145\40\x43\x61\165\163\145\x3a\x20\74\57\163\164\162\x6f\156\147\x3e\47\130\56\65\x30\x39\x20\103\x65\x72\164\151\146\151\x63\141\164\145\x27\x20\x66\151\145\154\x64\x20\151\156\40\x70\154\x75\147\151\156\40\x64\157\145\x73\40\x6e\x6f\164\40\x6d\x61\x74\x63\150\40\164\150\x65\x20\143\145\162\164\x69\146\151\143\x61\x74\145\x20\146\x6f\165\x6e\x64\40\151\x6e\40\123\101\x4d\x4c\40\x52\145\x73\160\x6f\156\163\x65\56\x3c\57\x70\76\xa\x9\x9\x9\74\160\76\74\163\x74\x72\x6f\x6e\147\76\103\x65\x72\164\151\x66\x69\143\x61\164\x65\x20\x66\x6f\165\156\x64\40\x69\x6e\x20\123\101\x4d\x4c\x20\122\x65\163\160\x6f\156\x73\x65\72\x20\74\x2f\x73\164\162\157\156\147\76\74\x62\x72\x3e\74\x62\x72\x3e" . wp_kses($RT, array("\x62\162" => array())) . "\x3c\57\160\76\12\11\11\x9\11\x9\x3c\57\144\x69\166\x3e\12\x9\x9\x9\11\x9\x3c\x64\x69\166\x20\x73\164\171\x6c\x65\x3d\42\x6d\141\162\147\151\x6e\x3a\x33\x25\73\144\151\x73\x70\154\141\171\72\142\154\x6f\x63\153\x3b\x74\x65\170\x74\55\x61\154\x69\x67\x6e\x3a\x63\145\x6e\164\145\x72\73\x22\x3e\xa\xa\x9\11\11\x9\11\74\144\151\166\40\163\164\x79\154\145\75\42\x6d\141\162\x67\151\156\72\x33\x25\x3b\x64\x69\163\x70\154\x61\x79\x3a\x62\154\157\x63\x6b\73\164\145\x78\164\x2d\141\154\151\x67\156\72\143\x65\156\x74\145\162\x3b\x22\76\74\x69\x6e\160\165\164\x20\x73\164\171\x6c\x65\75\x22\x70\x61\144\x64\151\x6e\x67\72\61\45\73\x77\151\x64\164\150\x3a\x31\x30\x30\x70\x78\x3b\x62\141\x63\153\147\x72\x6f\x75\x6e\144\72\40\x23\x30\60\x39\x31\103\x44\40\x6e\157\156\x65\40\x72\x65\x70\x65\141\x74\40\163\143\162\x6f\x6c\154\40\x30\45\40\x30\x25\73\143\165\x72\x73\157\162\x3a\x20\x70\157\151\x6e\x74\x65\x72\73\146\x6f\x6e\x74\55\163\151\x7a\x65\72\x31\65\x70\x78\73\x62\157\162\144\x65\x72\55\x77\x69\144\164\150\72\x20\61\160\x78\73\x62\157\x72\x64\145\162\x2d\163\x74\x79\x6c\x65\72\40\163\x6f\x6c\x69\x64\73\x62\x6f\162\x64\145\x72\x2d\162\x61\x64\x69\x75\163\72\40\63\160\170\x3b\x77\x68\151\164\x65\55\163\160\141\x63\x65\72\40\156\x6f\167\162\141\160\x3b\142\157\170\x2d\163\x69\x7a\151\x6e\x67\x3a\x20\x62\x6f\162\x64\145\162\55\142\157\170\73\x62\157\x72\x64\x65\x72\x2d\143\x6f\x6c\157\162\72\x20\x23\60\60\67\x33\x41\101\x3b\x62\x6f\170\55\163\x68\141\144\157\x77\x3a\x20\60\160\x78\40\61\x70\x78\x20\x30\x70\170\40\x72\x67\142\141\50\x31\62\60\x2c\x20\62\x30\60\54\x20\x32\63\x30\x2c\x20\x30\56\66\x29\40\151\156\x73\145\x74\73\x63\157\154\x6f\162\x3a\x20\43\106\x46\106\x3b\42\x74\x79\160\x65\75\x22\x62\x75\164\x74\157\156\x22\40\x76\141\x6c\x75\145\75\x22\104\157\156\x65\x22\40\157\x6e\103\154\151\143\x6b\75\42\163\145\154\x66\56\x63\154\x6f\163\x65\50\51\73\x22\x3e\74\57\144\x69\x76\76";
exit;
sI8:
}
private static function doDecryptElement(DOMElement $pP, XMLSecurityKey $TO, array &$Jg)
{
$BJ = new XMLSecEnc();
$BJ->setNode($pP);
$BJ->type = $pP->getAttribute("\x54\171\x70\145");
$jo = $BJ->locateKey($pP);
if ($jo) {
goto LEs;
}
echo sprintf("\x43\x6f\165\x6c\144\x20\156\157\164\x20\x6c\x6f\x63\x61\164\x65\x20\153\145\x79\40\141\x6c\147\157\162\151\x74\x68\x6d\x20\151\x6e\x20\145\156\143\162\171\160\164\x65\144\40\144\141\164\141\x2e");
exit;
LEs:
$As = $BJ->locateKeyInfo($jo);
if ($As) {
goto ozC;
}
echo sprintf("\103\157\x75\x6c\x64\40\x6e\x6f\164\x20\154\157\143\x61\x74\x65\40\74\144\x73\151\x67\x3a\113\x65\x79\x49\156\x66\157\x3e\40\146\157\x72\40\164\150\145\x20\x65\156\x63\162\x79\160\x74\x65\144\40\x6b\145\171\x2e");
exit;
ozC:
$rB = $TO->getAlgorith();
if ($As->isEncrypted) {
goto Btx;
}
$Nc = $jo->getAlgorith();
if (!($rB !== $Nc)) {
goto Yxl;
}
echo sprintf("\x41\154\147\x6f\x72\151\x74\x68\155\x20\x6d\151\x73\155\141\x74\x63\x68\40\142\x65\x74\167\145\x65\x6e\40\151\x6e\160\165\x74\40\x6b\x65\171\40\x61\156\x64\40\153\145\171\x20\x69\156\x20\155\x65\163\163\x61\x67\145\x2e\40" . "\113\x65\171\x20\x77\x61\x73\x3a\40" . esc_html(var_export($rB, TRUE)) . "\73\x20\155\x65\163\x73\x61\147\x65\40\167\141\163\x3a\x20" . esc_html(var_export($Nc, TRUE)));
exit;
Yxl:
$jo = $TO;
goto csy;
Btx:
$R0 = $As->getAlgorith();
if (!mo_saml_in_array($R0, $Jg, TRUE)) {
goto CRG;
}
echo sprintf("\x41\154\147\x6f\162\151\164\x68\155\x20\x64\151\163\141\x62\154\x65\144\x3a\x20" . esc_html(var_export($R0, TRUE)));
exit;
CRG:
if (!($R0 === XMLSecurityKey::RSA_OAEP_MGF1P && $rB === XMLSecurityKey::RSA_1_5)) {
goto POq;
}
$rB = XMLSecurityKey::RSA_OAEP_MGF1P;
POq:
if (!($rB !== $R0)) {
goto s5w;
}
echo sprintf("\x41\x6c\x67\157\162\x69\x74\150\155\40\155\x69\163\155\x61\x74\143\150\40\142\145\164\x77\x65\x65\x6e\40\151\x6e\160\x75\164\40\153\145\171\x20\141\156\x64\40\x6b\x65\x79\x20\x75\163\145\x64\40\164\157\40\x65\x6e\143\162\171\x70\x74\40" . "\40\x74\x68\x65\x20\x73\171\155\x6d\145\164\x72\151\143\x20\x6b\x65\x79\40\146\157\162\x20\164\x68\145\40\155\x65\x73\163\x61\x67\x65\x2e\x20\113\x65\171\x20\167\141\x73\72\40" . esc_html(var_export($rB, TRUE)) . "\x3b\40\x6d\x65\163\163\141\x67\x65\40\167\141\x73\x3a\x20" . esc_html(var_export($R0, TRUE)));
exit;
s5w:
$YN = $As->encryptedCtx;
$As->key = $TO->key;
$lU = $jo->getSymmetricKeySize();
if (!($lU === NULL)) {
goto PNS;
}
echo sprintf("\x55\156\x6b\x6e\157\x77\156\40\x6b\x65\x79\x20\163\x69\172\145\x20\x66\x6f\x72\40\x65\x6e\x63\162\x79\x70\x74\151\157\156\x20\141\x6c\x67\x6f\162\151\164\x68\x6d\x3a\40" . esc_html(var_export($jo->type, TRUE)));
exit;
PNS:
try {
$Jp = $YN->decryptKey($As);
if (!(strlen($Jp) != $lU)) {
goto t1R;
}
echo sprintf("\125\156\145\x78\x70\x65\143\x74\145\144\x20\153\x65\171\40\163\x69\172\145\40\50" . esc_html(strlen($Jp) * 8) . "\x62\151\x74\x73\x29\40\x66\157\162\40\145\156\x63\x72\x79\160\x74\151\157\x6e\x20\x61\154\147\157\162\x69\x74\150\x6d\72\40" . esc_html(var_export($jo->type, TRUE)));
exit;
t1R:
} catch (Exception $AM) {
$oF = $YN->getCipherValue();
$eI = openssl_pkey_get_details($As->key);
$eI = sha1(serialize($eI), TRUE);
$Jp = sha1($oF . $eI, TRUE);
if (strlen($Jp) > $lU) {
goto Wl1;
}
if (!(strlen($Jp) < $lU)) {
goto Ujb;
}
$Jp = str_pad($Jp, $lU);
Ujb:
goto aFx;
Wl1:
$Jp = substr($Jp, 0, $lU);
aFx:
}
$jo->loadkey($Jp);
csy:
$ng = $jo->getAlgorith();
if (!mo_saml_in_array($ng, $Jg, TRUE)) {
goto PIk;
}
echo sprintf("\101\x6c\147\157\x72\x69\x74\150\155\x20\144\x69\x73\141\x62\154\145\144\72\x20" . esc_html(var_export($ng, TRUE)));
exit;
PIk:
$Gs = $BJ->decryptNode($jo, FALSE);
$C2 = "\x3c\x72\x6f\157\164\40\x78\x6d\x6c\x6e\x73\72\163\x61\x6d\154\x3d\x22\x75\x72\x6e\72\157\141\163\x69\x73\x3a\156\141\155\x65\163\x3a\x74\x63\72\x53\x41\115\114\x3a\62\56\60\x3a\x61\x73\x73\145\x72\x74\x69\157\x6e\42\x20" . "\170\x6d\x6c\156\163\x3a\170\163\151\x3d\42\150\x74\164\x70\72\57\57\167\167\167\56\x77\x33\x2e\157\x72\x67\57\62\x30\x30\x31\x2f\x58\x4d\114\123\143\150\145\x6d\x61\x2d\151\156\x73\164\141\156\x63\x65\42\76" . $Gs . "\x3c\x2f\162\x6f\157\164\76";
$Cj = new DOMDocument();
if (@$Cj->loadXML($C2)) {
goto V7O;
}
throw new Exception("\106\x61\x69\154\x65\x64\x20\x74\x6f\x20\x70\141\162\163\145\40\144\145\143\162\x79\x70\164\145\144\40\x58\x4d\x4c\56\40\x4d\x61\171\x62\145\40\x74\x68\145\x20\x77\x72\x6f\x6e\147\40\x73\150\x61\162\x65\x64\x6b\x65\x79\40\x77\x61\163\x20\165\x73\x65\x64\77");
V7O:
$UG = $Cj->firstChild->firstChild;
if (!($UG === NULL)) {
goto Tj4;
}
echo sprintf("\115\x69\x73\x73\x69\x6e\x67\x20\145\x6e\143\162\x79\x70\164\145\144\40\145\x6c\145\155\x65\156\164\56");
throw new Exception("\x4d\151\163\x73\x69\156\x67\40\145\156\143\x72\x79\160\x74\145\x64\40\x65\154\145\155\x65\x6e\164\x2e");
Tj4:
if ($UG instanceof DOMElement) {
goto xuq;
}
echo sprintf("\104\x65\x63\162\x79\x70\x74\145\x64\x20\x65\154\145\155\145\156\164\x20\x77\x61\x73\x20\x6e\157\x74\40\141\x63\x74\x75\141\154\x6c\171\40\141\40\104\x4f\115\105\x6c\x65\x6d\x65\x6e\x74\56");
xuq:
return $UG;
}
public static function decryptElement(DOMElement $pP, XMLSecurityKey $TO, array $Jg = array(), XMLSecurityKey $dB = NULL)
{
try {
return self::doDecryptElement($pP, $TO, $Jg);
} catch (Exception $AM) {
try {
} catch (Exception $ok) {
}
echo "\x3c\x64\151\x76\x20\163\x74\x79\x6c\x65\x3d\42\146\x6f\x6e\x74\x2d\146\141\x6d\151\154\171\x3a\x43\x61\154\151\142\162\151\x3b\160\141\x64\x64\x69\156\147\72\60\x20\x33\45\73\x22\76";
echo "\74\144\x69\166\x20\x73\x74\171\154\145\75\42\x63\157\154\x6f\x72\x3a\40\x23\141\71\64\64\x34\x32\73\x62\x61\143\x6b\147\162\157\x75\x6e\x64\x2d\143\x6f\154\157\162\x3a\40\x23\x66\x32\x64\x65\144\145\73\x70\x61\x64\144\151\x6e\x67\72\x20\x31\65\x70\x78\73\x6d\141\162\147\151\x6e\x2d\x62\x6f\164\x74\x6f\x6d\72\x20\x32\60\160\170\x3b\x74\x65\x78\x74\x2d\x61\154\x69\x67\x6e\x3a\143\145\x6e\164\145\162\x3b\142\x6f\162\144\145\x72\72\x31\160\170\40\x73\x6f\x6c\x69\x64\x20\x23\105\66\x42\x33\x42\62\73\x66\x6f\x6e\x74\55\x73\151\172\x65\72\61\70\160\164\x3b\x22\76\40\x45\x52\122\117\122\74\x2f\144\151\x76\x3e\xa\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\40\x20\x20\74\x64\151\x76\40\x73\x74\x79\x6c\145\75\x22\143\157\154\x6f\x72\x3a\x20\x23\x61\71\64\x34\x34\x32\x3b\x66\x6f\x6e\164\x2d\x73\x69\x7a\145\x3a\61\64\160\164\x3b\x20\155\141\162\x67\x69\x6e\55\142\157\164\164\x6f\155\x3a\62\60\160\170\x3b\42\76\x3c\160\76\74\163\x74\162\157\156\x67\x3e\105\162\x72\x6f\x72\72\x20\74\x2f\163\164\162\157\156\147\76\x49\156\166\x61\x6c\151\x64\x20\101\x75\144\x69\x65\x6e\143\145\40\x55\122\x49\56\x3c\x2f\160\x3e\xa\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x3c\x70\x3e\x50\x6c\145\x61\x73\145\40\x63\x6f\x6e\164\x61\x63\x74\x20\171\x6f\165\162\x20\141\144\x6d\x69\156\151\163\164\162\x61\164\x6f\162\x20\141\156\x64\40\x72\x65\160\x6f\x72\164\x20\164\150\x65\x20\146\x6f\154\154\157\167\x69\156\147\x20\x65\x72\162\x6f\162\72\x3c\x2f\160\x3e\12\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\x20\74\x70\x3e\74\x73\164\162\x6f\x6e\147\76\x50\x6f\163\x73\151\142\154\x65\x20\x43\x61\165\x73\145\x3a\x20\x3c\x2f\x73\x74\x72\157\x6e\147\x3e\111\156\143\x6f\x72\162\x65\143\164\40\x63\x65\x72\164\151\146\151\143\x61\x74\x65\x20\x61\x64\144\145\x64\x20\x6f\156\x20\164\150\145\40\x49\144\145\156\164\x69\x74\x79\x20\x50\162\x6f\x76\151\144\x65\162\x20\x66\x6f\162\x20\105\156\x63\x72\x79\x70\x74\x69\157\x6e\74\57\160\76\xa\x9\11\x9\x9\11\x3c\x70\x3e\x3c\x73\x74\x72\x6f\156\147\76\x53\x6f\154\165\164\151\157\x6e\x3a\x3c\57\x73\x74\162\157\156\147\76\40\120\x6c\x65\141\x73\145\x20\143\x68\x65\x63\x6b\40\x69\146\40\x74\150\x65\40\x63\145\162\x74\151\x66\151\x63\141\164\x65\40\x61\x64\144\x65\x64\40\151\156\40\x49\x64\x65\156\164\x69\x74\x79\40\120\162\157\166\x69\x64\x65\x72\x20\151\163\40\x73\141\x6d\x65\40\x61\x73\40\164\x68\145\x20\x63\145\162\x74\151\x66\x69\x63\141\x74\x65\40\x70\x72\157\x76\151\x64\145\144\40\x69\x6e\40\x74\150\x65\x20\x50\154\x75\x67\151\x6e\74\x2f\x70\x3e\xa\11\11\x9\x9\x9\x3c\x2f\x64\x69\166\76\12\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\x3c\144\x69\x76\40\163\164\171\154\x65\75\42\x6d\x61\162\x67\x69\x6e\x3a\63\x25\x3b\x64\151\x73\x70\154\141\171\x3a\142\154\x6f\x63\153\x3b\x74\145\170\164\x2d\141\154\x69\147\x6e\72\x63\x65\x6e\164\x65\x72\x3b\x22\x3e\12\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\74\x64\151\166\x20\x73\164\x79\154\145\x3d\x22\x6d\141\x72\x67\x69\x6e\x3a\x33\x25\x3b\x64\151\163\160\154\141\171\x3a\142\x6c\x6f\x63\153\x3b\x74\x65\170\x74\x2d\x61\x6c\x69\x67\x6e\72\x63\x65\156\x74\145\162\73\x22\x3e\x3c\151\156\x70\x75\x74\40\x73\164\x79\x6c\145\x3d\42\x70\x61\144\x64\151\156\x67\x3a\61\x25\x3b\x77\x69\144\164\x68\x3a\x31\x30\60\x70\170\x3b\x62\x61\143\x6b\x67\162\157\165\156\x64\x3a\40\x23\x30\x30\71\61\103\104\40\156\x6f\x6e\x65\40\x72\145\160\145\x61\164\x20\x73\x63\x72\x6f\154\154\40\x30\45\x20\60\45\73\x63\165\162\x73\157\x72\x3a\40\160\x6f\151\x6e\164\x65\162\73\146\157\156\164\55\x73\x69\x7a\145\x3a\61\65\160\x78\x3b\142\x6f\x72\144\145\x72\55\167\x69\144\x74\x68\72\x20\61\x70\x78\x3b\x62\157\162\144\x65\162\55\x73\x74\171\154\x65\72\x20\163\157\154\151\x64\x3b\142\157\162\x64\145\162\x2d\x72\141\x64\151\165\163\x3a\40\63\x70\170\x3b\x77\x68\151\x74\x65\55\163\160\141\x63\x65\x3a\x20\156\x6f\x77\162\x61\x70\x3b\x62\x6f\x78\55\x73\x69\x7a\x69\x6e\147\x3a\40\x62\157\162\x64\x65\x72\x2d\x62\157\170\x3b\142\x6f\162\144\x65\x72\x2d\x63\x6f\154\x6f\x72\x3a\40\43\60\x30\x37\63\x41\101\73\142\x6f\x78\55\163\150\x61\144\157\167\72\40\60\x70\170\40\61\160\170\x20\x30\160\170\x20\162\x67\142\141\x28\61\x32\60\54\x20\62\60\x30\x2c\x20\x32\x33\60\54\40\x30\x2e\66\x29\40\151\x6e\163\145\x74\x3b\x63\157\x6c\x6f\x72\72\40\x23\106\106\x46\x3b\42\164\x79\160\x65\x3d\42\x62\x75\x74\x74\x6f\156\x22\40\x76\x61\x6c\x75\145\75\42\104\157\156\145\42\40\157\156\103\x6c\151\x63\153\75\x22\x73\145\154\x66\x2e\x63\x6c\157\163\x65\50\x29\x3b\42\76\74\57\x64\151\166\76";
exit;
exit;
}
}
public static function getEncryptionAlgorithm($qm)
{
switch ($qm) {
case "\150\164\164\160\72\x2f\57\167\167\x77\x2e\167\63\x2e\157\x72\x67\57\x32\60\x30\61\x2f\60\x34\57\170\x6d\154\x65\x6e\x63\43\164\x72\x69\x70\154\145\144\x65\x73\55\143\x62\143":
return XMLSecurityKey::TRIPLEDES_CBC;
goto eQj;
case "\x68\x74\x74\160\72\57\x2f\167\x77\x77\56\x77\x33\x2e\x6f\x72\x67\x2f\x32\60\60\61\57\60\64\57\x78\155\154\145\156\x63\x23\x61\x65\163\x31\62\x38\55\x63\x62\x63":
return XMLSecurityKey::AES128_CBC;
case "\x68\164\x74\160\x3a\x2f\57\x77\x77\167\56\x77\x33\x2e\x6f\x72\147\57\x32\60\60\61\57\60\64\57\170\155\x6c\145\156\x63\43\x61\x65\163\61\71\62\x2d\143\x62\x63":
return XMLSecurityKey::AES192_CBC;
goto eQj;
case "\150\164\164\x70\x3a\x2f\57\167\167\x77\x2e\167\x33\x2e\157\162\x67\x2f\x32\60\x30\x31\57\x30\64\57\x78\155\154\x65\156\143\43\141\x65\x73\x32\x35\x36\x2d\x63\x62\143":
return XMLSecurityKey::AES256_CBC;
goto eQj;
case "\150\164\x74\160\72\x2f\57\167\167\167\56\167\63\x2e\157\x72\147\x2f\x32\60\60\61\x2f\x30\x34\57\x78\x6d\154\x65\x6e\143\43\x72\x73\141\55\x31\137\65":
return XMLSecurityKey::RSA_1_5;
goto eQj;
case "\x68\x74\164\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\157\x72\x67\57\x32\60\x30\x31\57\x30\x34\x2f\x78\x6d\154\145\156\x63\43\x72\x73\141\x2d\157\141\145\160\55\x6d\147\x66\61\160":
return XMLSecurityKey::RSA_OAEP_MGF1P;
goto eQj;
case "\x68\x74\164\160\x3a\57\x2f\167\167\x77\56\167\63\x2e\x6f\x72\147\x2f\62\x30\60\60\x2f\60\x39\x2f\x78\x6d\x6c\x64\163\151\147\43\144\x73\x61\55\163\x68\x61\61":
return XMLSecurityKey::DSA_SHA1;
goto eQj;
case "\x68\164\x74\160\x3a\x2f\57\x77\x77\167\x2e\x77\63\56\x6f\162\x67\x2f\62\x30\x30\x30\57\60\71\57\170\155\154\x64\163\x69\147\43\162\x73\x61\x2d\163\150\x61\61":
return XMLSecurityKey::RSA_SHA1;
goto eQj;
case "\x68\x74\164\x70\72\x2f\x2f\x77\x77\167\x2e\167\x33\56\157\162\147\57\x32\x30\x30\x31\x2f\60\x34\x2f\x78\x6d\x6c\x64\x73\x69\147\x2d\x6d\x6f\x72\x65\x23\x72\x73\x61\55\x73\150\141\62\x35\66":
return XMLSecurityKey::RSA_SHA256;
goto eQj;
case "\150\x74\x74\x70\x3a\x2f\x2f\167\x77\x77\56\x77\x33\x2e\x6f\162\x67\x2f\62\x30\x30\61\x2f\60\x34\57\170\155\x6c\x64\163\151\x67\x2d\155\157\162\145\43\162\x73\141\x2d\163\x68\141\63\x38\64":
return XMLSecurityKey::RSA_SHA384;
goto eQj;
case "\150\x74\164\x70\x3a\x2f\57\167\167\167\x2e\167\63\x2e\x6f\162\x67\57\x32\60\x30\61\57\60\x34\57\x78\155\154\144\163\x69\x67\55\155\157\x72\145\x23\x72\x73\x61\x2d\163\x68\141\65\61\x32":
return XMLSecurityKey::RSA_SHA512;
goto eQj;
default:
echo sprintf("\x49\156\166\141\154\x69\144\40\105\156\x63\x72\171\x70\x74\151\x6f\156\x20\115\x65\x74\150\157\x64\72\40" . esc_html($qm));
exit;
goto eQj;
}
rZ2:
eQj:
}
public static function insertSignature(XMLSecurityKey $Jp, array $KA, DOMElement $ei, DOMNode $qg = NULL)
{
$gp = new XMLSecurityDSig();
$gp->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
switch ($Jp->type) {
case XMLSecurityKey::RSA_SHA256:
$bI = XMLSecurityDSig::SHA256;
goto Axk;
case XMLSecurityKey::RSA_SHA384:
$bI = XMLSecurityDSig::SHA384;
goto Axk;
case XMLSecurityKey::RSA_SHA512:
$bI = XMLSecurityDSig::SHA512;
goto Axk;
default:
$bI = XMLSecurityDSig::SHA1;
}
o8Q:
Axk:
$gp->addReferenceList(array($ei), $bI, array("\x68\x74\164\x70\72\x2f\x2f\x77\x77\x77\x2e\167\x33\56\x6f\162\x67\x2f\62\x30\60\60\x2f\60\x39\57\170\155\x6c\144\x73\151\x67\43\145\x6e\166\145\x6c\157\x70\145\144\x2d\x73\x69\147\x6e\141\x74\165\162\145", XMLSecurityDSig::EXC_C14N), array("\x69\144\x5f\156\141\155\x65" => "\x49\x44", "\157\x76\145\x72\167\x72\x69\x74\x65" => FALSE));
$gp->sign($Jp);
foreach ($KA as $aB) {
$gp->add509Cert($aB, TRUE);
sWW:
}
uQr:
$gp->insertSignature($ei, $qg);
}
public static function getRemainingDaysOfCurrentCertificate()
{
$aB = get_option("\155\157\x5f\x73\141\155\x6c\137\143\x75\x72\x72\x65\x6e\164\137\x63\x65\x72\x74");
$uJ = openssl_x509_parse($aB);
$XN = $uJ["\166\141\154\151\144\124\x6f\x5f\164\151\155\145\x5f\164"];
$iU = $XN - time();
return round($iU / (60 * 60 * 24));
}
public static function getExpiryDateOfCurrentCertificate()
{
$aB = get_option("\x6d\157\137\x73\x61\x6d\154\137\143\x75\x72\162\x65\156\x74\137\x63\x65\x72\164");
$uJ = openssl_x509_parse($aB);
return $uJ["\x76\x61\154\151\144\124\x6f\x5f\x74\x69\155\x65\x5f\164"];
}
public static function getValidUntilDateFromCert($aB)
{
$uJ = openssl_x509_parse($aB);
$XN = $uJ["\x76\x61\154\151\144\124\x6f\137\164\x69\155\145\137\164"];
$EO = date("\x59\55\x6d\55\x64", $XN);
$fi = $EO . "\x54\x32\x33\x3a\65\71\x3a\x35\71\132";
return $fi;
}
public static function signXML($C2, $ZK = '', $TM = false)
{
$AP = array("\x74\x79\x70\145" => "\160\x72\151\166\x61\164\x65");
$Jp = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $AP);
if ($TM) {
goto z9U;
}
$mC = get_option("\155\157\137\x73\141\x6d\x6c\x5f\143\165\162\x72\145\156\164\x5f\143\145\x72\x74\137\x70\162\151\166\141\x74\x65\137\153\x65\171");
$pT = get_option("\155\x6f\x5f\163\141\155\154\x5f\143\x75\x72\x72\x65\156\164\x5f\x63\x65\162\x74");
goto sHx;
z9U:
$mC = file_get_contents(plugin_dir_path(__FILE__) . "\162\x65\x73\157\165\x72\x63\x65\163" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Private_Key);
$pT = file_get_contents(plugin_dir_path(__FILE__) . "\x72\x65\x73\x6f\x75\162\x63\x65\x73" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_Public_Certificate);
sHx:
$Jp->loadKey($mC, FALSE);
$cp = new DOMDocument();
$cp->loadXML($C2);
$mn = $cp->firstChild;
if (!empty($ZK)) {
goto TJa;
}
self::insertSignature($Jp, array($pT), $mn);
goto Iqt;
TJa:
$RY = $cp->getElementsByTagName($ZK)->item(0);
self::insertSignature($Jp, array($pT), $mn, $RY);
Iqt:
$jI = $mn->ownerDocument->saveXML($mn);
$Is = base64_encode($jI);
return $Is;
}
public static function postSAMLRequest($Ug, $ms, $ia)
{
echo "\12\x9\11\x3c\150\x74\x6d\x6c\x3e\xa\11\x9\11\x3c\142\x6f\x64\171\x3e\x50\x6c\145\x61\163\x65\40\x77\x61\151\x74\x2e\x2e\x2e\12\x9\x9\11\x9\74\x66\157\x72\155\40\141\143\x74\x69\157\x6e\75\42" . esc_url($Ug) . "\x22\40\x6d\145\164\x68\157\144\x3d\x22\x70\x6f\163\164\42\40\151\144\x3d\x22\x73\x61\x6d\154\x2d\x72\x65\x71\x75\x65\x73\164\x2d\146\x6f\162\155\42\76\xa\x9\11\11\11\x9\x3c\x69\156\160\165\164\40\x74\x79\x70\145\75\x22\x68\x69\144\144\x65\x6e\x22\40\156\x61\x6d\145\x3d\42\123\x41\115\114\x52\145\x71\x75\145\163\x74\42\x20\x76\x61\x6c\165\x65\x3d\x22" . esc_attr($ms) . "\x22\40\57\x3e\12\11\x9\11\x9\x9\74\x69\x6e\x70\165\x74\x20\164\x79\x70\145\75\42\150\151\x64\144\145\156\42\x20\156\x61\x6d\x65\75\42\x52\145\x6c\141\x79\x53\164\x61\164\x65\x22\40\x76\x61\x6c\165\x65\75\x22" . esc_attr($ia) . "\42\x20\57\x3e";
echo "\12\x9\x9\x9\11\74\57\x66\157\x72\x6d\x3e\xa\11\x9\x9\11\74\163\x63\162\x69\160\x74\76\x64\x6f\x63\x75\x6d\145\x6e\164\x2e\x67\x65\x74\x45\x6c\x65\x6d\145\x6e\x74\102\x79\x49\144\50\x27\163\x61\x6d\x6c\x2d\x72\145\x71\x75\145\163\164\x2d\146\x6f\162\155\x27\x29\56\163\x75\142\155\151\164\50\x29\x3b\x3c\x2f\163\x63\162\151\160\164\76\xa\x9\11\11\74\x2f\142\157\x64\171\x3e\xa\11\x9\x3c\57\x68\x74\155\154\76";
exit;
}
public static function postSAMLResponse($Ug, $MY, $ia)
{
echo "\12\11\11\x9\74\x68\x74\155\154\76\xa\x9\x9\11\11\74\x62\157\x64\x79\76\x50\154\x65\141\x73\145\x20\x77\141\151\164\x2e\56\56\xa\x9\x9\x9\11\x9\x3c\x66\157\x72\155\40\141\x63\x74\151\x6f\x6e\75\x22" . esc_url($Ug) . "\x22\40\155\145\164\x68\x6f\144\75\x22\x70\157\163\x74\42\40\151\x64\75\42\163\141\155\x6c\55\x72\145\x73\160\157\156\x73\145\x2d\x66\157\162\x6d\x22\76\12\11\11\11\11\x9\11\x3c\151\156\x70\x75\164\x20\164\x79\x70\145\75\42\x68\151\144\x64\145\x6e\x22\x20\156\x61\155\x65\x3d\42\x53\x41\115\114\x52\x65\x73\160\x6f\156\163\x65\42\x20\166\x61\154\x75\x65\x3d\x22" . esc_attr($MY) . "\42\40\57\76\xa\x9\x9\x9\11\x9\11\x3c\x69\156\x70\165\x74\x20\x74\171\x70\x65\75\42\x68\x69\x64\x64\x65\x6e\x22\x20\156\141\x6d\145\x3d\42\122\x65\154\141\x79\123\164\141\x74\145\x22\40\x76\x61\154\165\x65\x3d\42" . esc_attr($ia) . "\42\40\x2f\76\xa\x9\11\x9\11\x9\x3c\x2f\146\x6f\x72\155\x3e\xa\11\11\x9\11\11\74\x73\x63\162\151\x70\164\x3e\x64\157\x63\165\155\x65\x6e\x74\56\147\145\164\x45\154\x65\155\145\x6e\164\102\x79\111\x64\x28\x27\x73\141\x6d\154\x2d\x72\145\x73\x70\x6f\156\x73\145\x2d\146\x6f\162\155\47\51\56\163\165\142\155\x69\x74\50\51\73\74\57\163\x63\162\151\x70\x74\76\xa\x9\x9\11\x9\x3c\57\142\157\x64\171\x3e\12\11\11\x9\x3c\x2f\x68\164\155\154\76";
exit;
}
public static function sanitize_certificate($aB)
{
$aB = trim($aB);
$aB = preg_replace("\x2f\x5b\xd\xa\135\53\x2f", '', $aB);
$aB = str_replace("\x2d", '', $aB);
$aB = str_replace("\102\105\x47\x49\x4e\x20\103\105\x52\x54\111\106\x49\x43\101\x54\x45", '', $aB);
$aB = str_replace("\x45\x4e\104\40\103\105\122\x54\x49\106\x49\103\x41\124\x45", '', $aB);
$aB = str_replace("\40", '', $aB);
$aB = chunk_split($aB, 64, "\15\xa");
$aB = "\55\x2d\x2d\x2d\55\x42\x45\107\x49\116\x20\103\x45\122\124\x49\x46\111\103\101\124\x45\55\x2d\x2d\55\x2d\15\xa" . $aB . "\x2d\55\x2d\x2d\x2d\x45\x4e\104\x20\x43\105\x52\124\x49\106\111\103\101\124\105\x2d\55\x2d\x2d\55";
return $aB;
}
public static function desanitize_certificate($aB)
{
$aB = preg_replace("\57\x5b\xd\xa\135\53\57", '', $aB);
$aB = str_replace("\x2d\x2d\55\55\55\x42\x45\107\x49\x4e\x20\103\105\x52\124\111\x46\111\x43\x41\124\x45\x2d\55\55\55\x2d", '', $aB);
$aB = str_replace("\x2d\55\x2d\55\55\x45\x4e\104\x20\x43\105\122\x54\x49\106\x49\x43\101\x54\x45\55\55\x2d\55\55", '', $aB);
$aB = str_replace("\40", '', $aB);
return $aB;
}
public static function mo_saml_wp_remote_call($Ug, $WT = array(), $Zj = false)
{
if (!$Zj) {
goto yKi;
}
$HS = wp_remote_get($Ug, $WT);
goto mYk;
yKi:
$HS = wp_remote_post($Ug, $WT);
mYk:
if (!is_wp_error($HS)) {
goto bab;
}
update_option("\155\157\137\163\141\x6d\154\137\x6d\145\163\163\141\x67\145", "\125\156\141\142\154\x65\40\164\x6f\x20\x63\157\156\x6e\x65\143\x74\x20\164\157\x20\164\x68\145\x20\x49\156\x74\145\162\156\145\164\x2e\40\x50\x6c\145\141\x73\145\x20\x74\162\x79\x20\x61\x67\x61\x69\x6e\x2e");
self::mo_saml_show_error_message();
return false;
goto mb0;
bab:
return $HS["\142\157\144\x79"];
mb0:
}
public static function get_expiry_notice_class($f0)
{
if ($f0 < 60 && $f0 > 0) {
goto y7O;
}
if ($f0 <= 0 && $f0 > -15) {
goto fJd;
}
if ($f0 <= -15) {
goto emZ;
}
goto Wmr;
y7O:
return "\155\157\55\163\141\155\x6c\x2d\x77\x61\162\x6e\151\156\147\55\171\145\x6c\x6c\157\167";
goto Wmr;
fJd:
return "\x6d\x6f\x2d\163\x61\x6d\154\55\x77\141\x72\x6e\151\156\x67\x2d\157\x72\141\x6e\x67\x65";
goto Wmr;
emZ:
return "\x6d\157\x2d\163\141\155\154\x2d\167\141\162\156\x69\x6e\x67\x2d\162\145\x64";
Wmr:
return '';
}
public static function get_box_expiry_notice_heading($sY, $f0, $Lf)
{
$vW = '';
if ($f0 < 60 && $f0 >= 0) {
goto a9W;
}
if ($f0 < 0 && $f0 > -15) {
goto NY0;
}
if ($f0 <= -15) {
goto idL;
}
goto dM_;
a9W:
$vW = "\x4c\151\143\x65\x6e\x73\x65\40\x45\x78\x70\151\162\x79\40\x4e\157\164\151\143\x65\x20\x3a\40\x50\154\165\147\x69\156\40\x4c\x69\x63\145\156\163\145\40\147\145\x74\x74\151\x6e\147\x20\x65\170\x70\151\162\145\x64\40\x69\x6e\40\x3c\163\x70\x61\156\40\x69\x64\75\x22\x6d\157\137\163\x61\155\154\x5f\160\x72\157\146\x69\x6c\x65\137\142\157\170\137\x63\157\165\156\x74\x65\x72\x22\76" . ($f0 + 1) . "\x3c\57\163\160\141\x6e\76\40\x64\141\171\x73";
goto dM_;
NY0:
$vW = "\x59\157\x75\162\x20\160\154\x75\147\151\156\40\150\141\x73\40\145\170\160\151\x72\145\144\40\x61\156\144\40\123\123\x4f\40\x77\x69\x6c\x6c\x20\163\x74\157\x70\40\167\x6f\x72\x6b\151\156\x67\x20\x6f\x6e\40" . $Lf . "\x2e\x20\122\145\x6e\x65\167\x20\171\x6f\x75\x72\x20\154\x69\x63\145\x6e\163\x65\40\x6e\x6f\167\40\x74\x6f\x20\141\166\x6f\151\x64\40\x64\151\x73\x72\x75\160\x74\151\x6f\156\x2e";
goto dM_;
idL:
$vW = "\x57\141\162\x6e\151\156\x67\40\x3a\40\x59\157\165\162\x20\x53\x53\x4f\x20\x68\141\x73\x20\x73\164\157\160\160\145\x64\x20\167\x6f\162\153\x69\x6e\x67\56\40\122\x65\156\145\x77\x20\171\157\x75\162\40\154\151\143\x65\x6e\x73\145\40\156\157\167\41";
dM_:
return $vW;
}
public static function mo_saml_get_plugin_dir_url()
{
return plugin_dir_url(__FILE__);
}
public static function mo_saml_show_success_message()
{
remove_action("\x61\144\x6d\x69\x6e\137\x6e\157\x74\x69\x63\x65\x73", array("\x53\x41\115\x4c\123\120\x55\164\x69\154\x69\x74\x69\145\x73", "\155\x6f\x5f\x73\x61\x6d\154\137\x73\x75\x63\143\145\163\163\137\155\145\163\163\x61\147\x65"));
add_action("\141\144\x6d\151\156\x5f\156\x6f\164\151\x63\145\x73", array("\123\101\115\x4c\123\x50\x55\164\x69\x6c\151\x74\151\x65\163", "\x6d\x6f\137\163\141\x6d\154\x5f\145\x72\x72\157\x72\x5f\155\x65\163\x73\141\x67\145"));
}
public static function mo_saml_show_error_message()
{
remove_action("\x61\x64\x6d\151\x6e\137\156\157\164\151\x63\145\x73", array("\x53\101\x4d\114\123\120\x55\x74\151\x6c\x69\164\151\x65\163", "\x6d\x6f\x5f\163\x61\155\x6c\137\145\162\162\157\162\x5f\155\145\163\x73\141\x67\x65"));
add_action("\x61\x64\155\x69\156\137\156\x6f\164\x69\x63\145\163", array("\123\x41\x4d\x4c\123\x50\x55\164\x69\154\x69\x74\x69\x65\163", "\x6d\157\137\163\141\155\154\x5f\x73\165\x63\143\145\x73\x73\x5f\155\145\163\x73\141\147\145"));
}
public static function mo_saml_success_message()
{
$jW = "\145\162\x72\x6f\162";
$dq = get_option("\155\x6f\137\x73\141\155\x6c\137\x6d\145\x73\x73\141\147\145");
echo wp_kses("\x3c\144\x69\x76\40\143\154\141\163\163\75\47" . esc_attr($jW) . "\x27\x3e\x20\x3c\x70\76" . self::mo_saml_kses_esc_message($dq) . "\x3c\x2f\x70\76\x3c\57\x64\151\166\76", array("\x64\151\x76" => array("\x63\x6c\x61\163\x73" => array()), "\160" => array()));
}
public static function mo_saml_error_message()
{
$jW = "\x75\160\x64\141\164\145\144";
$dq = get_option("\155\157\137\163\141\x6d\x6c\x5f\155\145\163\x73\x61\x67\145");
echo wp_kses("\x3c\144\151\x76\x20\143\x6c\x61\x73\163\x3d\47" . esc_attr($jW) . "\x27\76\40\x3c\x70\76" . self::mo_saml_kses_esc_message($dq) . "\74\x2f\160\76\74\57\x64\x69\x76\76", array("\144\151\166" => array("\143\x6c\141\x73\x73" => array()), "\x70" => array()));
}
}
Function Calls
None |
Stats
MD5 | 9bb4281aac3b0e8dee0c16fb415f90bf |
Eval Count | 0 |
Decode Time | 93 ms |