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 'Utilities.php';
include_once 'xmlseclibs.php';
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
class SAML2_LogoutRequest
{
private $tagName;
private $id;
private $issuer;
private $destination;
private $issueInstant;
private $certificates;
private $validators;
private $notOnOrAfter;
private $encryptedNameId;
private $nameId;
private $sessionIndexes;
public function __construct(DOMElement $RO = NULL)
{
$this->tagName = "LogoutRequest";
$this->id = Utilities::generateID();
$this->issueInstant = time();
$this->certificates = array();
$this->validators = array();
if (!($RO === NULL)) {
goto ZNN;
}
return;
ZNN:
if ($RO->hasAttribute("ID")) {
goto iil;
}
throw new Exception("Missing ID attribute on SAML message.");
iil:
$this->id = $RO->getAttribute("ID");
if (!($RO->getAttribute("Version") !== "2.0")) {
goto c6f;
}
throw new Exception("Unsupported version: " . $RO->getAttribute("Version"));
c6f:
$this->issueInstant = Utilities::xsDateTimeToTimestamp($RO->getAttribute("IssueInstant"));
if (!$RO->hasAttribute("Destination")) {
goto ERr;
}
$this->destination = $RO->getAttribute("Destination");
ERr:
$xF = Utilities::xpQuery($RO, "./saml_assertion:Issuer");
if (empty($xF)) {
goto Xgv;
}
$this->issuer = trim($xF[0]->textContent);
Xgv:
try {
$oK = Utilities::validateElement($RO);
if (!($oK !== FALSE)) {
goto lkY;
}
$this->certificates = $oK["Certificates"];
$this->validators[] = array("Function" => array("Utilities", "validateSignature"), "Data" => $oK);
lkY:
} catch (Exception $XJ) {
}
$this->sessionIndexes = array();
if (!$RO->hasAttribute("NotOnOrAfter")) {
goto tJ0;
}
$this->notOnOrAfter = Utilities::xsDateTimeToTimestamp($RO->getAttribute("NotOnOrAfter"));
tJ0:
$DV = Utilities::xpQuery($RO, "./saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData");
if (empty($DV)) {
goto FvC;
}
if (count($DV) > 1) {
goto t5f;
}
goto mjA;
FvC:
throw new Exception("Missing <saml:NameID> or <saml:EncryptedID> in <samlp:LogoutRequest>.");
goto mjA;
t5f:
throw new Exception("More than one <saml:NameID> or <saml:EncryptedD> in <samlp:LogoutRequest>.");
mjA:
$DV = $DV[0];
if ($DV->localName === "EncryptedData") {
goto oPc;
}
$this->nameId = Utilities::parseNameId($DV);
goto lHK;
oPc:
$this->encryptedNameId = $DV;
lHK:
$dD = Utilities::xpQuery($RO, "./saml_protocol:SessionIndex");
foreach ($dD as $x5) {
$this->sessionIndexes[] = trim($x5->textContent);
A2x:
}
OBu:
}
public function getNotOnOrAfter()
{
return $this->notOnOrAfter;
}
public function setNotOnOrAfter($BX)
{
$this->notOnOrAfter = $BX;
}
public function isNameIdEncrypted()
{
if (!($this->encryptedNameId !== NULL)) {
goto MN5;
}
return TRUE;
MN5:
return FALSE;
}
public function encryptNameId(XMLSecurityKey $ns)
{
$Hy = new DOMDocument();
$Bs = $Hy->createElement("root");
$Hy->appendChild($Bs);
SAML2_Utils::addNameId($Bs, $this->nameId);
$DV = $Bs->firstChild;
SAML2_Utils::getContainer()->debugMessage($DV, "encrypt");
$J8 = new XMLSecEnc();
$J8->setNode($DV);
$J8->type = XMLSecEnc::Element;
$Qt = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
$Qt->generateSessionKey();
$J8->encryptKey($ns, $Qt);
$this->encryptedNameId = $J8->encryptNode($Qt);
$this->nameId = NULL;
}
public function decryptNameId(XMLSecurityKey $ns, array $gz = array())
{
if (!($this->encryptedNameId === NULL)) {
goto Kyi;
}
return;
Kyi:
$DV = SAML2_Utils::decryptElement($this->encryptedNameId, $ns, $gz);
SAML2_Utils::getContainer()->debugMessage($DV, "decrypt");
$this->nameId = SAML2_Utils::parseNameId($DV);
$this->encryptedNameId = NULL;
}
public function getNameId()
{
if (!($this->encryptedNameId !== NULL)) {
goto Ucl;
}
throw new Exception("Attempted to retrieve encrypted NameID without decrypting it first.");
Ucl:
return $this->nameId;
}
public function setNameId($DV)
{
$this->nameId = $DV;
}
public function getSessionIndexes()
{
return $this->sessionIndexes;
}
public function setSessionIndexes(array $dD)
{
$this->sessionIndexes = $dD;
}
public function getSessionIndex()
{
if (!empty($this->sessionIndexes)) {
goto AXZ;
}
return NULL;
AXZ:
return $this->sessionIndexes[0];
}
public function setSessionIndex($x5)
{
if (is_null($x5)) {
goto fKU;
}
$this->sessionIndexes = array($x5);
goto Tmc;
fKU:
$this->sessionIndexes = array();
Tmc:
}
public function getId()
{
return $this->id;
}
public function setId($Cv)
{
$this->id = $Cv;
}
public function getIssueInstant()
{
return $this->issueInstant;
}
public function setIssueInstant($AV)
{
$this->issueInstant = $AV;
}
public function getDestination()
{
return $this->destination;
}
public function setDestination($TB)
{
$this->destination = $TB;
}
public function getIssuer()
{
return $this->issuer;
}
public function setIssuer($xF)
{
$this->issuer = $xF;
}
}
?>
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 'Utilities.php';
include_once 'xmlseclibs.php';
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
class SAML2_LogoutRequest
{
private $tagName;
private $id;
private $issuer;
private $destination;
private $issueInstant;
private $certificates;
private $validators;
private $notOnOrAfter;
private $encryptedNameId;
private $nameId;
private $sessionIndexes;
public function __construct(DOMElement $RO = NULL)
{
$this->tagName = "\114\x6f\x67\157\x75\164\x52\145\x71\x75\x65\163\164";
$this->id = Utilities::generateID();
$this->issueInstant = time();
$this->certificates = array();
$this->validators = array();
if (!($RO === NULL)) {
goto ZNN;
}
return;
ZNN:
if ($RO->hasAttribute("\x49\x44")) {
goto iil;
}
throw new Exception("\x4d\x69\163\163\x69\156\x67\40\x49\104\x20\x61\164\x74\x72\151\x62\x75\x74\145\40\157\156\x20\x53\101\x4d\114\40\155\x65\163\x73\141\x67\145\56");
iil:
$this->id = $RO->getAttribute("\111\x44");
if (!($RO->getAttribute("\x56\x65\x72\x73\151\157\156") !== "\62\x2e\60")) {
goto c6f;
}
throw new Exception("\125\156\x73\x75\160\x70\x6f\162\x74\x65\144\40\x76\145\162\163\151\157\x6e\72\x20" . $RO->getAttribute("\126\x65\x72\163\151\x6f\156"));
c6f:
$this->issueInstant = Utilities::xsDateTimeToTimestamp($RO->getAttribute("\111\163\x73\165\x65\111\156\x73\164\141\x6e\164"));
if (!$RO->hasAttribute("\104\145\x73\x74\151\x6e\x61\x74\x69\157\156")) {
goto ERr;
}
$this->destination = $RO->getAttribute("\x44\x65\x73\164\151\156\x61\x74\151\157\156");
ERr:
$xF = Utilities::xpQuery($RO, "\56\57\163\141\x6d\x6c\x5f\141\163\163\145\x72\x74\x69\157\156\72\111\163\163\165\x65\162");
if (empty($xF)) {
goto Xgv;
}
$this->issuer = trim($xF[0]->textContent);
Xgv:
try {
$oK = Utilities::validateElement($RO);
if (!($oK !== FALSE)) {
goto lkY;
}
$this->certificates = $oK["\x43\145\162\x74\151\146\151\143\141\164\x65\x73"];
$this->validators[] = array("\106\165\156\143\x74\x69\x6f\x6e" => array("\125\164\x69\x6c\151\164\x69\x65\x73", "\x76\x61\154\151\x64\141\164\145\123\151\147\156\141\164\x75\x72\x65"), "\104\x61\164\x61" => $oK);
lkY:
} catch (Exception $XJ) {
}
$this->sessionIndexes = array();
if (!$RO->hasAttribute("\116\x6f\x74\x4f\156\117\x72\101\x66\x74\145\162")) {
goto tJ0;
}
$this->notOnOrAfter = Utilities::xsDateTimeToTimestamp($RO->getAttribute("\116\x6f\x74\x4f\x6e\x4f\x72\101\146\x74\145\x72"));
tJ0:
$DV = Utilities::xpQuery($RO, "\56\x2f\163\141\155\154\137\141\x73\x73\x65\162\164\151\x6f\x6e\72\116\x61\155\x65\111\x44\x20\174\x20\56\x2f\163\x61\x6d\154\x5f\x61\x73\163\145\162\x74\x69\157\156\72\105\x6e\143\x72\x79\160\164\x65\x64\x49\104\x2f\170\x65\x6e\143\x3a\x45\156\143\x72\x79\160\164\x65\x64\104\x61\x74\141");
if (empty($DV)) {
goto FvC;
}
if (count($DV) > 1) {
goto t5f;
}
goto mjA;
FvC:
throw new Exception("\115\151\163\x73\x69\156\147\40\74\x73\141\x6d\154\x3a\x4e\x61\x6d\x65\x49\104\x3e\40\157\162\x20\x3c\x73\x61\x6d\x6c\x3a\x45\x6e\143\162\171\160\x74\x65\x64\x49\104\76\x20\151\x6e\40\74\163\141\x6d\x6c\x70\x3a\x4c\x6f\147\x6f\x75\164\122\145\161\165\145\x73\x74\76\x2e");
goto mjA;
t5f:
throw new Exception("\115\x6f\162\x65\40\x74\x68\x61\x6e\40\157\x6e\x65\x20\x3c\x73\x61\x6d\154\x3a\116\x61\155\145\111\x44\x3e\40\157\162\x20\x3c\163\141\155\x6c\x3a\105\156\x63\162\171\160\164\145\144\104\76\x20\151\156\40\x3c\163\141\155\x6c\x70\x3a\x4c\157\147\x6f\165\164\x52\145\x71\165\145\x73\164\76\x2e");
mjA:
$DV = $DV[0];
if ($DV->localName === "\105\156\x63\162\171\160\x74\145\144\104\x61\164\x61") {
goto oPc;
}
$this->nameId = Utilities::parseNameId($DV);
goto lHK;
oPc:
$this->encryptedNameId = $DV;
lHK:
$dD = Utilities::xpQuery($RO, "\x2e\x2f\163\141\x6d\154\137\160\162\157\x74\157\x63\x6f\154\72\123\x65\x73\163\x69\x6f\156\111\156\144\x65\170");
foreach ($dD as $x5) {
$this->sessionIndexes[] = trim($x5->textContent);
A2x:
}
OBu:
}
public function getNotOnOrAfter()
{
return $this->notOnOrAfter;
}
public function setNotOnOrAfter($BX)
{
$this->notOnOrAfter = $BX;
}
public function isNameIdEncrypted()
{
if (!($this->encryptedNameId !== NULL)) {
goto MN5;
}
return TRUE;
MN5:
return FALSE;
}
public function encryptNameId(XMLSecurityKey $ns)
{
$Hy = new DOMDocument();
$Bs = $Hy->createElement("\162\157\157\164");
$Hy->appendChild($Bs);
SAML2_Utils::addNameId($Bs, $this->nameId);
$DV = $Bs->firstChild;
SAML2_Utils::getContainer()->debugMessage($DV, "\x65\156\x63\162\x79\x70\164");
$J8 = new XMLSecEnc();
$J8->setNode($DV);
$J8->type = XMLSecEnc::Element;
$Qt = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
$Qt->generateSessionKey();
$J8->encryptKey($ns, $Qt);
$this->encryptedNameId = $J8->encryptNode($Qt);
$this->nameId = NULL;
}
public function decryptNameId(XMLSecurityKey $ns, array $gz = array())
{
if (!($this->encryptedNameId === NULL)) {
goto Kyi;
}
return;
Kyi:
$DV = SAML2_Utils::decryptElement($this->encryptedNameId, $ns, $gz);
SAML2_Utils::getContainer()->debugMessage($DV, "\x64\145\143\x72\x79\160\x74");
$this->nameId = SAML2_Utils::parseNameId($DV);
$this->encryptedNameId = NULL;
}
public function getNameId()
{
if (!($this->encryptedNameId !== NULL)) {
goto Ucl;
}
throw new Exception("\101\x74\x74\145\x6d\160\164\145\x64\40\164\x6f\40\x72\145\164\x72\x69\x65\166\x65\40\145\x6e\x63\x72\x79\160\164\145\x64\40\116\141\x6d\x65\111\104\x20\167\x69\x74\x68\157\x75\x74\x20\x64\145\x63\x72\x79\x70\x74\151\x6e\x67\x20\151\x74\x20\x66\151\162\x73\164\56");
Ucl:
return $this->nameId;
}
public function setNameId($DV)
{
$this->nameId = $DV;
}
public function getSessionIndexes()
{
return $this->sessionIndexes;
}
public function setSessionIndexes(array $dD)
{
$this->sessionIndexes = $dD;
}
public function getSessionIndex()
{
if (!empty($this->sessionIndexes)) {
goto AXZ;
}
return NULL;
AXZ:
return $this->sessionIndexes[0];
}
public function setSessionIndex($x5)
{
if (is_null($x5)) {
goto fKU;
}
$this->sessionIndexes = array($x5);
goto Tmc;
fKU:
$this->sessionIndexes = array();
Tmc:
}
public function getId()
{
return $this->id;
}
public function setId($Cv)
{
$this->id = $Cv;
}
public function getIssueInstant()
{
return $this->issueInstant;
}
public function setIssueInstant($AV)
{
$this->issueInstant = $AV;
}
public function getDestination()
{
return $this->destination;
}
public function setDestination($TB)
{
$this->destination = $TB;
}
public function getIssuer()
{
return $this->issuer;
}
public function setIssuer($xF)
{
$this->issuer = $xF;
}
}
Function Calls
None |
Stats
MD5 | 4f934712743a8f735c81c2e2926990ae |
Eval Count | 0 |
Decode Time | 106 ms |