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 class SAML2_Assertion { private $id; private $issueInstant; pri..
Decoded Output download
<?php
class SAML2_Assertion
{
private $id;
private $issueInstant;
private $issuer;
private $nameId;
private $encryptedNameId;
private $encryptedAttribute;
private $encryptionKey;
private $notBefore;
private $notOnOrAfter;
private $validAudiences;
private $sessionNotOnOrAfter;
private $sessionIndex;
private $authnInstant;
private $authnContextClassRef;
private $authnContextDecl;
private $authnContextDeclRef;
private $AuthenticatingAuthority;
private $attributes;
private $nameFormat;
private $signatureKey;
private $certificates;
private $signatureData;
private $requiredEncAttributes;
private $SubjectConfirmation;
protected $wasSignedAtConstruction = FALSE;
public function __construct(DOMElement $cg = NULL)
{
$this->id = UtilitiesSAML::generateId();
$this->issueInstant = UtilitiesSAML::generateTimestamp();
$this->issuer = '';
$this->authnInstant = UtilitiesSAML::generateTimestamp();
$this->attributes = array();
$this->nameFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
$this->certificates = array();
$this->AuthenticatingAuthority = array();
$this->SubjectConfirmation = array();
if (!($cg === NULL)) {
goto TM;
}
return;
TM:
if (!($cg->localName === "EncryptedAssertion")) {
goto RR;
}
$PQ = UtilitiesSAML::xpQuery($cg, "./xenc:EncryptedData");
$Ox = UtilitiesSAML::xpQuery($cg, "./xenc:EncryptedData/ds:KeyInfo/xenc:EncryptedKey");
$Cu = '';
if (empty($Ox)) {
goto Zo;
}
$Cu = $Ox[0]->firstChild->getAttribute("Algorithm");
goto z3;
Zo:
$Ox = UtilitiesSAML::xpQuery($cg, "./xenc:EncryptedKey/xenc:EncryptionMethod");
$Cu = $Ox[0]->getAttribute("Algorithm");
z3:
$jC = UtilitiesSAML::getEncryptionAlgorithm($Cu);
if (count($PQ) === 0) {
goto W1;
}
if (count($PQ) > 1) {
goto RU;
}
goto ui;
W1:
throw new Exception("Missing encrypted data in <saml:EncryptedAssertion>.");
goto ui;
RU:
throw new Exception("More than one encrypted data element in <saml:EncryptedAssertion>.");
ui:
$lv = new XMLSecurityKeySAML($jC, array("type" => "private"));
$zJ = UtilitiesSAML::getCustomerDetails();
$A8 = '';
if (!isset($zJ["sp_base_url"])) {
goto O0;
}
$A8 = $zJ["sp_base_url"];
O0:
$SR = JURI::base();
if (empty($A8)) {
goto Z3;
}
$SR = $A8;
Z3:
$zJ = UtilitiesSAML::getSAMLConfiguration();
$hD = UtilitiesSAML::get_public_private_certificate($zJ, "private_certificate");
if ($hD == null || $hD == '') {
goto oF;
}
$gH = UtilitiesSAML::getCustom_CertificatePath("CustomPrivateCertificate.key");
goto jY;
oF:
$gH = dirname(__FILE__) . DIRECTORY_SEPARATOR . "cert" . DIRECTORY_SEPARATOR . "sp-key.key";
jY:
$lv->loadKey($gH, TRUE);
try {
$cg = UtilitiesSAML::decryptElement($PQ[0], $lv);
} catch (Exception $tU) {
echo "Caught exception: ", $tU->getMessage(), "\xa";
}
RR:
if ($cg->hasAttribute("ID")) {
goto Lp;
}
throw new Exception("Missing ID attribute on SAML assertion.");
Lp:
$this->id = $cg->getAttribute("ID");
if (!($cg->getAttribute("Version") !== "2.0")) {
goto v2;
}
throw new Exception("Unsupported version: " . $cg->getAttribute("Version"));
v2:
$this->issueInstant = UtilitiesSAML::xsDateTimeToTimestamp($cg->getAttribute("IssueInstant"));
$yB = UtilitiesSAML::xpQuery($cg, "./saml_assertion:Issuer");
if (!empty($yB)) {
goto Em;
}
throw new Exception("Missing <saml:Issuer> in assertion.");
Em:
$this->issuer = trim($yB[0]->textContent);
$this->parseConditions($cg);
$this->parseAuthnStatement($cg);
$this->parseAttributes($cg);
$this->parseEncryptedAttributes($cg);
$this->parseSignature($cg);
$this->parseSubject($cg);
}
private function parseSubject(DOMElement $cg)
{
$AW = UtilitiesSAML::xpQuery($cg, "./saml_assertion:Subject");
if (empty($AW)) {
goto lO;
}
if (count($AW) > 1) {
goto h9;
}
goto On;
lO:
return;
goto On;
h9:
throw new Exception("More than one <saml:Subject> in <saml:Assertion>.");
On:
$AW = $AW[0];
$uj = UtilitiesSAML::xpQuery($AW, "./saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData");
if (empty($uj)) {
goto ni;
}
if (count($uj) > 1) {
goto k7;
}
goto EE;
ni:
throw new Exception("Missing <saml:NameID> or <saml:EncryptedID> in <saml:Subject>.");
goto EE;
k7:
throw new Exception("More than one <saml:NameID> or <saml:EncryptedD> in <saml:Subject>.");
EE:
$uj = $uj[0];
if ($uj->localName === "EncryptedData") {
goto xu;
}
$this->nameId = UtilitiesSAML::parseNameId($uj);
goto Kg;
xu:
$this->encryptedNameId = $uj;
Kg:
}
private function parseConditions(DOMElement $cg)
{
$Zb = UtilitiesSAML::xpQuery($cg, "./saml_assertion:Conditions");
if (empty($Zb)) {
goto Ct;
}
if (count($Zb) > 1) {
goto Hu;
}
goto r5;
Ct:
return;
goto r5;
Hu:
throw new Exception("More than one <saml:Conditions> in <saml:Assertion>.");
r5:
$Zb = $Zb[0];
if (!$Zb->hasAttribute("NotBefore")) {
goto lG;
}
$oC = UtilitiesSAML::xsDateTimeToTimestamp($Zb->getAttribute("NotBefore"));
if (!($this->notBefore === NULL || $this->notBefore < $oC)) {
goto Jp;
}
$this->notBefore = $oC;
Jp:
lG:
if (!$Zb->hasAttribute("NotOnOrAfter")) {
goto bL;
}
$bu = UtilitiesSAML::xsDateTimeToTimestamp($Zb->getAttribute("NotOnOrAfter"));
if (!($this->notOnOrAfter === NULL || $this->notOnOrAfter > $bu)) {
goto Gm;
}
$this->notOnOrAfter = $bu;
Gm:
bL:
$Uo = $Zb->firstChild;
HC:
if (!($Uo !== NULL)) {
goto jy;
}
if (!$Uo instanceof DOMText) {
goto Ii;
}
goto sT;
Ii:
if (!($Uo->namespaceURI !== "urn:oasis:names:tc:SAML:2.0:assertion")) {
goto JQ;
}
throw new Exception("Unknown namespace of condition: " . var_export($Uo->namespaceURI, TRUE));
JQ:
switch ($Uo->localName) {
case "AudienceRestriction":
$yy = UtilitiesSAML::extractStrings($Uo, "urn:oasis:names:tc:SAML:2.0:assertion", "Audience");
if ($this->validAudiences === NULL) {
goto iQ;
}
$this->validAudiences = array_intersect($this->validAudiences, $yy);
goto Ul;
iQ:
$this->validAudiences = $yy;
Ul:
goto vp;
case "OneTimeUse":
goto vp;
case "ProxyRestriction":
goto vp;
default:
throw new Exception("Unknown condition: " . var_export($Uo->localName, TRUE));
}
Df:
vp:
sT:
$Uo = $Uo->nextSibling;
goto HC;
jy:
}
private function parseAuthnStatement(DOMElement $cg)
{
$DW = UtilitiesSAML::xpQuery($cg, "./saml_assertion:AuthnStatement");
if (empty($DW)) {
goto pp;
}
if (count($DW) > 1) {
goto Zs;
}
goto Sz;
pp:
$this->authnInstant = NULL;
return;
goto Sz;
Zs:
throw new Exception("More that one <saml:AuthnStatement> in <saml:Assertion> not supported.");
Sz:
$hQ = $DW[0];
if ($hQ->hasAttribute("AuthnInstant")) {
goto rP;
}
throw new Exception("Missing required AuthnInstant attribute on <saml:AuthnStatement>.");
rP:
$this->authnInstant = UtilitiesSAML::xsDateTimeToTimestamp($hQ->getAttribute("AuthnInstant"));
if (!$hQ->hasAttribute("SessionNotOnOrAfter")) {
goto ta;
}
$this->sessionNotOnOrAfter = UtilitiesSAML::xsDateTimeToTimestamp($hQ->getAttribute("SessionNotOnOrAfter"));
ta:
if (!$hQ->hasAttribute("SessionIndex")) {
goto Of;
}
$this->sessionIndex = $hQ->getAttribute("SessionIndex");
Of:
$this->parseAuthnContext($hQ);
}
private function parseAuthnContext(DOMElement $hI)
{
$h1 = UtilitiesSAML::xpQuery($hI, "./saml_assertion:AuthnContext");
if (count($h1) > 1) {
goto rQ;
}
if (empty($h1)) {
goto nu;
}
goto WF;
rQ:
throw new Exception("More than one <saml:AuthnContext> in <saml:AuthnStatement>.");
goto WF;
nu:
throw new Exception("Missing required <saml:AuthnContext> in <saml:AuthnStatement>.");
WF:
$zT = $h1[0];
$QE = UtilitiesSAML::xpQuery($zT, "./saml_assertion:AuthnContextDeclRef");
if (count($QE) > 1) {
goto N4;
}
if (count($QE) === 1) {
goto FS;
}
goto nl;
N4:
throw new Exception("More than one <saml:AuthnContextDeclRef> found?");
goto nl;
FS:
$this->setAuthnContextDeclRef(trim($QE[0]->textContent));
nl:
$se = UtilitiesSAML::xpQuery($zT, "./saml_assertion:AuthnContextDecl");
if (count($se) > 1) {
goto pW;
}
if (count($se) === 1) {
goto a6;
}
goto Ol;
pW:
throw new Exception("More than one <saml:AuthnContextDecl> found?");
goto Ol;
a6:
$this->setAuthnContextDecl(new SAML2_XML_Chunk($se[0]));
Ol:
$Vm = UtilitiesSAML::xpQuery($zT, "./saml_assertion:AuthnContextClassRef");
if (count($Vm) > 1) {
goto NV;
}
if (count($Vm) === 1) {
goto Li;
}
goto ul;
NV:
throw new Exception("More than one <saml:AuthnContextClassRef> in <saml:AuthnContext>.");
goto ul;
Li:
$this->setAuthnContextClassRef(trim($Vm[0]->textContent));
ul:
if (!(empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef))) {
goto qC;
}
throw new Exception("Missing either <saml:AuthnContextClassRef> or <saml:AuthnContextDeclRef> or <saml:AuthnContextDecl>");
qC:
$this->AuthenticatingAuthority = UtilitiesSAML::extractStrings($zT, "urn:oasis:names:tc:SAML:2.0:assertion", "AuthenticatingAuthority");
}
private function parseAttributes(DOMElement $cg)
{
$vE = TRUE;
$Bh = UtilitiesSAML::xpQuery($cg, "./saml_assertion:AttributeStatement/saml_assertion:Attribute");
foreach ($Bh as $zJ) {
if ($zJ->hasAttribute("Name")) {
goto oc;
}
throw new Exception("Missing name on <saml:Attribute> element.");
oc:
$yu = $zJ->getAttribute("Name");
if ($zJ->hasAttribute("NameFormat")) {
goto hW;
}
$Rh = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
goto yW;
hW:
$Rh = $zJ->getAttribute("NameFormat");
yW:
if ($vE) {
goto FG;
}
if (!($this->nameFormat !== $Rh)) {
goto Oh;
}
$this->nameFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
Oh:
goto fM;
FG:
$this->nameFormat = $Rh;
$vE = FALSE;
fM:
if (array_key_exists($yu, $this->attributes)) {
goto Nw;
}
$this->attributes[$yu] = array();
Nw:
$AP = UtilitiesSAML::xpQuery($zJ, "./saml_assertion:AttributeValue");
foreach ($AP as $K6) {
$this->attributes[$yu][] = trim($K6->textContent);
zE:
}
rh:
kv:
}
fF:
}
private function parseEncryptedAttributes(DOMElement $cg)
{
$this->encryptedAttribute = UtilitiesSAML::xpQuery($cg, "./saml_assertion:AttributeStatement/saml_assertion:EncryptedAttribute");
}
private function parseSignature(DOMElement $cg)
{
$CV = UtilitiesSAML::validateElement($cg);
if (!($CV !== FALSE)) {
goto CA;
}
$this->wasSignedAtConstruction = TRUE;
$this->certificates = $CV["Certificates"];
$this->signatureData = $CV;
CA:
}
public function validate(XMLSecurityKeySAML $lv)
{
if (!($this->signatureData === NULL)) {
goto o9;
}
return FALSE;
o9:
UtilitiesSAML::validateSignature($this->signatureData, $lv);
return TRUE;
}
public function getId()
{
return $this->id;
}
public function setId($oA)
{
$this->id = $oA;
}
public function getIssueInstant()
{
return $this->issueInstant;
}
public function setIssueInstant($VE)
{
$this->issueInstant = $VE;
}
public function getIssuer()
{
return $this->issuer;
}
public function setIssuer($yB)
{
$this->issuer = $yB;
}
public function getNameId()
{
if (!($this->encryptedNameId !== NULL)) {
goto xx;
}
throw new Exception("Attempted to retrieve encrypted NameID without decrypting it first.");
xx:
return $this->nameId;
}
public function setNameId($uj)
{
$this->nameId = $uj;
}
public function isNameIdEncrypted()
{
if (!($this->encryptedNameId !== NULL)) {
goto zM;
}
return TRUE;
zM:
return FALSE;
}
public function encryptNameId(XMLSecurityKeySAML $lv)
{
$Fk = new DOMDocument();
$mt = $Fk->createElement("root");
$Fk->appendChild($mt);
UtilitiesSAML::addNameId($mt, $this->nameId);
$uj = $mt->firstChild;
UtilitiesSAML::getContainer()->debugMessage($uj, "encrypt");
$rQ = new XMLSecEncSAML();
$rQ->setNode($uj);
$rQ->type = XMLSecEncSAML::Element;
$AK = new XMLSecurityKeySAML(XMLSecurityKeySAML::AES128_CBC);
$AK->generateSessionKey();
$rQ->encryptKey($lv, $AK);
$this->encryptedNameId = $rQ->encryptNode($AK);
$this->nameId = NULL;
}
public function decryptNameId(XMLSecurityKeySAML $lv, array $k8 = array())
{
if (!($this->encryptedNameId === NULL)) {
goto g3;
}
return;
g3:
$uj = UtilitiesSAML::decryptElement($this->encryptedNameId, $lv, $k8);
UtilitiesSAML::getContainer()->debugMessage($uj, "decrypt");
$this->nameId = UtilitiesSAML::parseNameId($uj);
$this->encryptedNameId = NULL;
}
public function decryptAttributes(XMLSecurityKeySAML $lv, array $k8 = array())
{
if (!($this->encryptedAttribute === NULL)) {
goto FU;
}
return;
FU:
$vE = TRUE;
$Bh = $this->encryptedAttribute;
foreach ($Bh as $L6) {
$zJ = UtilitiesSAML::decryptElement($L6->getElementsByTagName("EncryptedData")->item(0), $lv, $k8);
if ($zJ->hasAttribute("Name")) {
goto bS;
}
throw new Exception("Missing name on <saml:Attribute> element.");
bS:
$yu = $zJ->getAttribute("Name");
if ($zJ->hasAttribute("NameFormat")) {
goto OE;
}
$Rh = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
goto Bh;
OE:
$Rh = $zJ->getAttribute("NameFormat");
Bh:
if ($vE) {
goto le;
}
if (!($this->nameFormat !== $Rh)) {
goto S5;
}
$this->nameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
S5:
goto pV;
le:
$this->nameFormat = $Rh;
$vE = FALSE;
pV:
if (array_key_exists($yu, $this->attributes)) {
goto LW;
}
$this->attributes[$yu] = array();
LW:
$AP = UtilitiesSAML::xpQuery($zJ, "./saml_assertion:AttributeValue");
foreach ($AP as $K6) {
$this->attributes[$yu][] = trim($K6->textContent);
ow:
}
WM:
gv:
}
bI:
}
public function getNotBefore()
{
return $this->notBefore;
}
public function setNotBefore($oC)
{
$this->notBefore = $oC;
}
public function getNotOnOrAfter()
{
return $this->notOnOrAfter;
}
public function setNotOnOrAfter($bu)
{
$this->notOnOrAfter = $bu;
}
public function setEncryptedAttributes($Yl)
{
$this->requiredEncAttributes = $Yl;
}
public function getValidAudiences()
{
return $this->validAudiences;
}
public function setValidAudiences(array $yX = NULL)
{
$this->validAudiences = $yX;
}
public function getAuthnInstant()
{
return $this->authnInstant;
}
public function setAuthnInstant($wA)
{
$this->authnInstant = $wA;
}
public function getSessionNotOnOrAfter()
{
return $this->sessionNotOnOrAfter;
}
public function setSessionNotOnOrAfter($fh)
{
$this->sessionNotOnOrAfter = $fh;
}
public function getSessionIndex()
{
return $this->sessionIndex;
}
public function setSessionIndex($eK)
{
$this->sessionIndex = $eK;
}
public function getAuthnContext()
{
if (empty($this->authnContextClassRef)) {
goto Zf;
}
return $this->authnContextClassRef;
Zf:
if (empty($this->authnContextDeclRef)) {
goto Gp;
}
return $this->authnContextDeclRef;
Gp:
return NULL;
}
public function setAuthnContext($wj)
{
$this->setAuthnContextClassRef($wj);
}
public function getAuthnContextClassRef()
{
return $this->authnContextClassRef;
}
public function setAuthnContextClassRef($lf)
{
$this->authnContextClassRef = $lf;
}
public function setAuthnContextDecl(SAML2_XML_Chunk $VW)
{
if (empty($this->authnContextDeclRef)) {
goto pz;
}
throw new Exception("AuthnContextDeclRef is already registered! May only have either a Decl or a DeclRef, not both!");
pz:
$this->authnContextDecl = $VW;
}
public function getAuthnContextDecl()
{
return $this->authnContextDecl;
}
public function setAuthnContextDeclRef($vc)
{
if (empty($this->authnContextDecl)) {
goto sd;
}
throw new Exception("AuthnContextDecl is already registered! May only have either a Decl or a DeclRef, not both!");
sd:
$this->authnContextDeclRef = $vc;
}
public function getAuthnContextDeclRef()
{
return $this->authnContextDeclRef;
}
public function getAuthenticatingAuthority()
{
return $this->AuthenticatingAuthority;
}
public function setAuthenticatingAuthority($PW)
{
$this->AuthenticatingAuthority = $PW;
}
public function getAttributes()
{
return $this->attributes;
}
public function setAttributes(array $Bh)
{
$this->attributes = $Bh;
}
public function getAttributeNameFormat()
{
return $this->nameFormat;
}
public function setAttributeNameFormat($Rh)
{
$this->nameFormat = $Rh;
}
public function getSubjectConfirmation()
{
return $this->SubjectConfirmation;
}
public function setSubjectConfirmation(array $rg)
{
$this->SubjectConfirmation = $rg;
}
public function getSignatureKey()
{
return $this->signatureKey;
}
public function setSignatureKey(XMLSecurityKeySAML $gV = NULL)
{
$this->signatureKey = $gV;
}
public function getEncryptionKey()
{
return $this->encryptionKey;
}
public function setEncryptionKey(XMLSecurityKeySAML $aO = NULL)
{
$this->encryptionKey = $aO;
}
public function setCertificates(array $aZ)
{
$this->certificates = $aZ;
}
public function getCertificates()
{
return $this->certificates;
}
public function getWasSignedAtConstruction()
{
return $this->wasSignedAtConstruction;
}
public function toXML(DOMNode $p6 = NULL)
{
if ($p6 === NULL) {
goto hJ;
}
$L0 = $p6->ownerDocument;
goto wy;
hJ:
$L0 = new DOMDocument();
$p6 = $L0;
wy:
$mt = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:" . "Assertion");
$p6->appendChild($mt);
$mt->setAttributeNS("urn:oasis:names:tc:SAML:2.0:protocol", "samlp:tmp", "tmp");
$mt->removeAttributeNS("urn:oasis:names:tc:SAML:2.0:protocol", "tmp");
$mt->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:tmp", "tmp");
$mt->removeAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "tmp");
$mt->setAttributeNS("http://www.w3.org/2001/XMLSchema", "xs:tmp", "tmp");
$mt->removeAttributeNS("http://www.w3.org/2001/XMLSchema", "tmp");
$mt->setAttribute("ID", $this->id);
$mt->setAttribute("Version", "2.0");
$mt->setAttribute("IssueInstant", gmdate("Y-m-d\TH:i:s\Z", $this->issueInstant));
$yB = UtilitiesSAML::addString($mt, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:Issuer", $this->issuer);
$this->addSubject($mt);
$this->addConditions($mt);
$this->addAuthnStatement($mt);
if ($this->requiredEncAttributes == FALSE) {
goto vT;
}
$this->addEncryptedAttributeStatement($mt);
goto VX;
vT:
$this->addAttributeStatement($mt);
VX:
if (!($this->signatureKey !== NULL)) {
goto K6;
}
UtilitiesSAML::insertSignature($this->signatureKey, $this->certificates, $mt, $yB->nextSibling);
K6:
return $mt;
}
private function addSubject(DOMElement $mt)
{
if (!($this->nameId === NULL && $this->encryptedNameId === NULL)) {
goto U4;
}
return;
U4:
$AW = $mt->ownerDocument->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Subject");
$mt->appendChild($AW);
if ($this->encryptedNameId === NULL) {
goto ke;
}
$VF = $AW->ownerDocument->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:" . "EncryptedID");
$AW->appendChild($VF);
$VF->appendChild($AW->ownerDocument->importNode($this->encryptedNameId, TRUE));
goto Gs;
ke:
UtilitiesSAML::addNameId($AW, $this->nameId);
Gs:
foreach ($this->SubjectConfirmation as $gE) {
$gE->toXML($AW);
e2:
}
fU:
}
private function addConditions(DOMElement $mt)
{
$L0 = $mt->ownerDocument;
$Zb = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Conditions");
$mt->appendChild($Zb);
if (!($this->notBefore !== NULL)) {
goto C3;
}
$Zb->setAttribute("NotBefore", gmdate("Y-m-d\TH:i:s\Z", $this->notBefore));
C3:
if (!($this->notOnOrAfter !== NULL)) {
goto UW;
}
$Zb->setAttribute("NotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->notOnOrAfter));
UW:
if (!($this->validAudiences !== NULL)) {
goto m3;
}
$qc = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AudienceRestriction");
$Zb->appendChild($qc);
UtilitiesSAML::addStrings($qc, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:Audience", FALSE, $this->validAudiences);
m3:
}
private function addAuthnStatement(DOMElement $mt)
{
if (!($this->authnInstant === NULL || $this->authnContextClassRef === NULL && $this->authnContextDecl === NULL && $this->authnContextDeclRef === NULL)) {
goto Cm;
}
return;
Cm:
$L0 = $mt->ownerDocument;
$hI = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnStatement");
$mt->appendChild($hI);
$hI->setAttribute("AuthnInstant", gmdate("Y-m-d\TH:i:s\Z", $this->authnInstant));
if (!($this->sessionNotOnOrAfter !== NULL)) {
goto EY;
}
$hI->setAttribute("SessionNotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->sessionNotOnOrAfter));
EY:
if (!($this->sessionIndex !== NULL)) {
goto RA;
}
$hI->setAttribute("SessionIndex", $this->sessionIndex);
RA:
$zT = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContext");
$hI->appendChild($zT);
if (empty($this->authnContextClassRef)) {
goto af;
}
UtilitiesSAML::addString($zT, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContextClassRef", $this->authnContextClassRef);
af:
if (empty($this->authnContextDecl)) {
goto Ya;
}
$this->authnContextDecl->toXML($zT);
Ya:
if (empty($this->authnContextDeclRef)) {
goto WN;
}
UtilitiesSAML::addString($zT, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContextDeclRef", $this->authnContextDeclRef);
WN:
UtilitiesSAML::addStrings($zT, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthenticatingAuthority", FALSE, $this->AuthenticatingAuthority);
}
private function addAttributeStatement(DOMElement $mt)
{
if (!empty($this->attributes)) {
goto Ha;
}
return;
Ha:
$L0 = $mt->ownerDocument;
$I2 = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeStatement");
$mt->appendChild($I2);
foreach ($this->attributes as $yu => $AP) {
$zJ = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Attribute");
$I2->appendChild($zJ);
$zJ->setAttribute("Name", $yu);
if (!($this->nameFormat !== "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")) {
goto jo;
}
$zJ->setAttribute("NameFormat", $this->nameFormat);
jo:
foreach ($AP as $K6) {
if (is_string($K6)) {
goto l6;
}
if (is_int($K6)) {
goto MT;
}
$T_ = NULL;
goto r4;
l6:
$T_ = "xs:string";
goto r4;
MT:
$T_ = "xs:integer";
r4:
$SA = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeValue");
$zJ->appendChild($SA);
if (!($T_ !== NULL)) {
goto ue;
}
$SA->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", $T_);
ue:
if (!is_null($K6)) {
goto X8;
}
$SA->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil", "true");
X8:
if ($K6 instanceof DOMNodeList) {
goto TU;
}
$SA->appendChild($L0->createTextNode($K6));
goto Yr;
TU:
$Va = 0;
jH:
if (!($Va < $K6->length)) {
goto By;
}
$Uo = $L0->importNode($K6->item($Va), TRUE);
$SA->appendChild($Uo);
JS:
$Va++;
goto jH;
By:
Yr:
Hz:
}
Iq:
yo:
}
EL:
}
private function addEncryptedAttributeStatement(DOMElement $mt)
{
if (!($this->requiredEncAttributes == FALSE)) {
goto OJ;
}
return;
OJ:
$L0 = $mt->ownerDocument;
$I2 = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeStatement");
$mt->appendChild($I2);
foreach ($this->attributes as $yu => $AP) {
$oz = new DOMDocument();
$zJ = $oz->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Attribute");
$zJ->setAttribute("Name", $yu);
$oz->appendChild($zJ);
if (!($this->nameFormat !== "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")) {
goto Mj;
}
$zJ->setAttribute("NameFormat", $this->nameFormat);
Mj:
foreach ($AP as $K6) {
if (is_string($K6)) {
goto gz;
}
if (is_int($K6)) {
goto Cs;
}
$T_ = NULL;
goto Qr;
gz:
$T_ = "xs:string";
goto Qr;
Cs:
$T_ = "xs:integer";
Qr:
$SA = $oz->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeValue");
$zJ->appendChild($SA);
if (!($T_ !== NULL)) {
goto AJ;
}
$SA->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", $T_);
AJ:
if ($K6 instanceof DOMNodeList) {
goto tK;
}
$SA->appendChild($oz->createTextNode($K6));
goto i7;
tK:
$Va = 0;
BD:
if (!($Va < $K6->length)) {
goto Tt;
}
$Uo = $oz->importNode($K6->item($Va), TRUE);
$SA->appendChild($Uo);
XJ:
$Va++;
goto BD;
Tt:
i7:
hr:
}
tI:
$x7 = new XMLSecEncSAML();
$x7->setNode($oz->documentElement);
$x7->type = "http://www.w3.org/2001/04/xmlenc#Element";
$AK = new XMLSecurityKeySAML(XMLSecurityKeySAML::AES256_CBC);
$AK->generateSessionKey();
$x7->encryptKey($this->encryptionKey, $AK);
$On = $x7->encryptNode($AK);
$wX = $L0->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:EncryptedAttribute");
$I2->appendChild($wX);
$r_ = $L0->importNode($On, TRUE);
$wX->appendChild($r_);
sb:
}
cO:
}
public function getSignatureData()
{
return $this->signatureData;
}
}
?>
Did this file decode correctly?
Original Code
<?php
class SAML2_Assertion
{
private $id;
private $issueInstant;
private $issuer;
private $nameId;
private $encryptedNameId;
private $encryptedAttribute;
private $encryptionKey;
private $notBefore;
private $notOnOrAfter;
private $validAudiences;
private $sessionNotOnOrAfter;
private $sessionIndex;
private $authnInstant;
private $authnContextClassRef;
private $authnContextDecl;
private $authnContextDeclRef;
private $AuthenticatingAuthority;
private $attributes;
private $nameFormat;
private $signatureKey;
private $certificates;
private $signatureData;
private $requiredEncAttributes;
private $SubjectConfirmation;
protected $wasSignedAtConstruction = FALSE;
public function __construct(DOMElement $cg = NULL)
{
$this->id = UtilitiesSAML::generateId();
$this->issueInstant = UtilitiesSAML::generateTimestamp();
$this->issuer = '';
$this->authnInstant = UtilitiesSAML::generateTimestamp();
$this->attributes = array();
$this->nameFormat = "\x75\x72\156\x3a\x6f\x61\163\151\x73\x3a\x6e\141\x6d\x65\x73\x3a\164\x63\x3a\x53\x41\115\x4c\x3a\x31\56\x31\72\156\x61\x6d\145\151\x64\55\x66\x6f\x72\155\141\x74\x3a\x75\156\x73\160\145\143\x69\146\151\x65\x64";
$this->certificates = array();
$this->AuthenticatingAuthority = array();
$this->SubjectConfirmation = array();
if (!($cg === NULL)) {
goto TM;
}
return;
TM:
if (!($cg->localName === "\x45\156\x63\x72\171\160\164\145\144\101\x73\163\145\162\164\x69\x6f\156")) {
goto RR;
}
$PQ = UtilitiesSAML::xpQuery($cg, "\x2e\57\x78\145\x6e\143\72\105\x6e\x63\x72\x79\x70\164\x65\x64\104\141\x74\141");
$Ox = UtilitiesSAML::xpQuery($cg, "\x2e\57\x78\145\156\x63\72\105\x6e\x63\x72\x79\x70\164\x65\144\x44\x61\164\141\57\144\x73\x3a\113\x65\171\x49\x6e\x66\x6f\57\170\145\x6e\x63\72\x45\156\x63\x72\171\x70\x74\145\x64\x4b\x65\171");
$Cu = '';
if (empty($Ox)) {
goto Zo;
}
$Cu = $Ox[0]->firstChild->getAttribute("\x41\x6c\x67\157\x72\x69\164\x68\x6d");
goto z3;
Zo:
$Ox = UtilitiesSAML::xpQuery($cg, "\x2e\57\170\x65\x6e\143\72\105\x6e\x63\162\171\160\x74\x65\x64\113\145\171\x2f\x78\145\x6e\x63\x3a\x45\x6e\143\x72\171\x70\x74\x69\157\156\x4d\x65\164\x68\x6f\x64");
$Cu = $Ox[0]->getAttribute("\101\154\147\x6f\x72\151\164\150\x6d");
z3:
$jC = UtilitiesSAML::getEncryptionAlgorithm($Cu);
if (count($PQ) === 0) {
goto W1;
}
if (count($PQ) > 1) {
goto RU;
}
goto ui;
W1:
throw new Exception("\115\151\163\163\x69\x6e\x67\40\145\x6e\143\162\x79\160\164\145\x64\x20\x64\141\x74\141\x20\151\x6e\x20\74\x73\x61\x6d\x6c\72\x45\x6e\143\162\171\160\x74\145\144\101\163\163\x65\162\164\151\x6f\156\x3e\x2e");
goto ui;
RU:
throw new Exception("\115\x6f\x72\x65\x20\164\150\141\x6e\40\157\156\x65\40\x65\x6e\143\x72\171\x70\x74\145\144\x20\x64\141\x74\141\x20\x65\x6c\x65\x6d\145\156\x74\x20\151\156\40\74\163\141\x6d\x6c\x3a\x45\156\143\x72\171\x70\164\x65\x64\101\163\x73\145\162\x74\151\157\156\x3e\56");
ui:
$lv = new XMLSecurityKeySAML($jC, array("\x74\171\x70\x65" => "\160\x72\x69\x76\141\x74\145"));
$zJ = UtilitiesSAML::getCustomerDetails();
$A8 = '';
if (!isset($zJ["\x73\x70\x5f\x62\x61\163\145\x5f\165\162\x6c"])) {
goto O0;
}
$A8 = $zJ["\163\160\x5f\142\141\x73\145\137\x75\x72\154"];
O0:
$SR = JURI::base();
if (empty($A8)) {
goto Z3;
}
$SR = $A8;
Z3:
$zJ = UtilitiesSAML::getSAMLConfiguration();
$hD = UtilitiesSAML::get_public_private_certificate($zJ, "\160\162\151\166\141\164\x65\137\x63\x65\162\164\x69\146\151\143\x61\164\x65");
if ($hD == null || $hD == '') {
goto oF;
}
$gH = UtilitiesSAML::getCustom_CertificatePath("\x43\x75\163\x74\x6f\x6d\120\162\151\166\141\164\145\x43\145\162\164\x69\146\151\143\141\164\145\x2e\153\x65\x79");
goto jY;
oF:
$gH = dirname(__FILE__) . DIRECTORY_SEPARATOR . "\143\x65\x72\164" . DIRECTORY_SEPARATOR . "\163\160\55\153\x65\171\x2e\153\145\171";
jY:
$lv->loadKey($gH, TRUE);
try {
$cg = UtilitiesSAML::decryptElement($PQ[0], $lv);
} catch (Exception $tU) {
echo "\x43\141\165\147\150\164\40\145\x78\143\145\x70\x74\151\x6f\x6e\x3a\40", $tU->getMessage(), "\xa";
}
RR:
if ($cg->hasAttribute("\x49\104")) {
goto Lp;
}
throw new Exception("\115\x69\x73\163\x69\x6e\x67\x20\111\104\40\x61\x74\164\x72\x69\142\165\164\x65\40\157\x6e\x20\x53\x41\x4d\x4c\40\141\163\x73\x65\x72\164\x69\157\x6e\x2e");
Lp:
$this->id = $cg->getAttribute("\x49\104");
if (!($cg->getAttribute("\126\x65\162\x73\151\157\156") !== "\x32\56\60")) {
goto v2;
}
throw new Exception("\x55\156\x73\165\160\160\157\162\164\x65\144\40\166\145\x72\163\x69\x6f\156\72\x20" . $cg->getAttribute("\126\x65\x72\x73\151\x6f\x6e"));
v2:
$this->issueInstant = UtilitiesSAML::xsDateTimeToTimestamp($cg->getAttribute("\111\163\x73\x75\x65\111\156\163\x74\141\x6e\164"));
$yB = UtilitiesSAML::xpQuery($cg, "\56\x2f\x73\141\x6d\154\137\141\163\x73\x65\x72\164\x69\x6f\x6e\x3a\111\163\x73\165\x65\162");
if (!empty($yB)) {
goto Em;
}
throw new Exception("\115\151\163\163\x69\x6e\147\x20\74\163\x61\155\154\x3a\x49\x73\x73\x75\145\162\76\40\x69\156\x20\x61\x73\163\145\162\164\x69\x6f\156\56");
Em:
$this->issuer = trim($yB[0]->textContent);
$this->parseConditions($cg);
$this->parseAuthnStatement($cg);
$this->parseAttributes($cg);
$this->parseEncryptedAttributes($cg);
$this->parseSignature($cg);
$this->parseSubject($cg);
}
private function parseSubject(DOMElement $cg)
{
$AW = UtilitiesSAML::xpQuery($cg, "\x2e\57\x73\x61\155\154\x5f\141\163\163\145\x72\164\x69\x6f\x6e\72\123\x75\x62\x6a\145\x63\164");
if (empty($AW)) {
goto lO;
}
if (count($AW) > 1) {
goto h9;
}
goto On;
lO:
return;
goto On;
h9:
throw new Exception("\115\157\x72\145\x20\x74\150\x61\x6e\40\x6f\156\x65\x20\x3c\x73\x61\155\x6c\72\123\x75\x62\x6a\x65\x63\x74\76\40\151\x6e\40\x3c\163\141\x6d\154\x3a\x41\x73\163\145\162\164\x69\x6f\156\x3e\56");
On:
$AW = $AW[0];
$uj = UtilitiesSAML::xpQuery($AW, "\56\57\163\x61\x6d\154\x5f\141\x73\163\x65\x72\x74\151\x6f\x6e\x3a\116\141\x6d\x65\111\x44\40\x7c\x20\56\x2f\x73\141\155\154\137\141\163\x73\145\162\x74\151\x6f\x6e\x3a\105\156\x63\162\x79\160\x74\x65\x64\x49\104\x2f\170\x65\x6e\143\x3a\105\156\143\162\171\x70\164\145\144\x44\141\164\141");
if (empty($uj)) {
goto ni;
}
if (count($uj) > 1) {
goto k7;
}
goto EE;
ni:
throw new Exception("\x4d\151\x73\x73\151\x6e\x67\40\74\163\141\155\154\72\x4e\x61\155\x65\x49\104\x3e\40\157\x72\x20\x3c\163\x61\155\154\x3a\x45\x6e\143\x72\171\x70\164\145\x64\111\x44\76\x20\x69\x6e\x20\x3c\x73\141\x6d\154\72\123\165\x62\152\145\x63\164\x3e\56");
goto EE;
k7:
throw new Exception("\115\157\x72\145\x20\164\x68\141\156\x20\157\156\145\x20\x3c\x73\141\x6d\154\x3a\x4e\141\155\x65\111\104\x3e\x20\x6f\x72\x20\74\163\x61\x6d\154\x3a\105\156\143\162\x79\x70\164\145\144\104\76\x20\151\x6e\40\74\x73\141\155\x6c\72\123\x75\x62\152\145\x63\164\x3e\x2e");
EE:
$uj = $uj[0];
if ($uj->localName === "\x45\156\x63\x72\x79\x70\164\x65\x64\x44\141\x74\x61") {
goto xu;
}
$this->nameId = UtilitiesSAML::parseNameId($uj);
goto Kg;
xu:
$this->encryptedNameId = $uj;
Kg:
}
private function parseConditions(DOMElement $cg)
{
$Zb = UtilitiesSAML::xpQuery($cg, "\56\57\163\x61\155\154\137\141\163\x73\x65\x72\164\x69\157\156\x3a\103\x6f\156\x64\x69\x74\x69\x6f\156\163");
if (empty($Zb)) {
goto Ct;
}
if (count($Zb) > 1) {
goto Hu;
}
goto r5;
Ct:
return;
goto r5;
Hu:
throw new Exception("\x4d\x6f\x72\x65\40\x74\x68\x61\156\x20\157\156\145\40\74\163\141\x6d\x6c\72\103\157\x6e\144\x69\164\x69\x6f\x6e\163\x3e\40\x69\x6e\40\74\163\141\155\154\72\x41\163\x73\x65\162\164\x69\157\156\76\56");
r5:
$Zb = $Zb[0];
if (!$Zb->hasAttribute("\116\157\x74\x42\145\146\x6f\x72\145")) {
goto lG;
}
$oC = UtilitiesSAML::xsDateTimeToTimestamp($Zb->getAttribute("\116\157\164\x42\145\146\157\162\145"));
if (!($this->notBefore === NULL || $this->notBefore < $oC)) {
goto Jp;
}
$this->notBefore = $oC;
Jp:
lG:
if (!$Zb->hasAttribute("\x4e\x6f\x74\117\x6e\117\162\101\x66\164\145\x72")) {
goto bL;
}
$bu = UtilitiesSAML::xsDateTimeToTimestamp($Zb->getAttribute("\x4e\157\164\x4f\x6e\117\x72\101\x66\x74\145\x72"));
if (!($this->notOnOrAfter === NULL || $this->notOnOrAfter > $bu)) {
goto Gm;
}
$this->notOnOrAfter = $bu;
Gm:
bL:
$Uo = $Zb->firstChild;
HC:
if (!($Uo !== NULL)) {
goto jy;
}
if (!$Uo instanceof DOMText) {
goto Ii;
}
goto sT;
Ii:
if (!($Uo->namespaceURI !== "\165\162\x6e\72\x6f\141\x73\151\163\72\156\141\x6d\145\x73\72\164\x63\72\123\101\x4d\x4c\x3a\x32\56\60\x3a\x61\163\163\145\x72\164\151\x6f\x6e")) {
goto JQ;
}
throw new Exception("\x55\156\x6b\x6e\157\x77\x6e\40\x6e\x61\x6d\145\x73\x70\141\x63\x65\x20\157\x66\x20\143\157\156\x64\x69\x74\x69\x6f\156\72\x20" . var_export($Uo->namespaceURI, TRUE));
JQ:
switch ($Uo->localName) {
case "\x41\165\144\151\145\156\x63\145\x52\145\x73\164\162\x69\143\x74\x69\x6f\156":
$yy = UtilitiesSAML::extractStrings($Uo, "\x75\x72\x6e\72\157\x61\x73\151\163\x3a\156\x61\155\x65\x73\72\x74\143\x3a\123\101\x4d\x4c\72\x32\x2e\x30\x3a\141\163\163\145\162\x74\x69\157\x6e", "\x41\165\144\151\145\156\x63\x65");
if ($this->validAudiences === NULL) {
goto iQ;
}
$this->validAudiences = array_intersect($this->validAudiences, $yy);
goto Ul;
iQ:
$this->validAudiences = $yy;
Ul:
goto vp;
case "\117\156\145\x54\151\x6d\145\125\163\145":
goto vp;
case "\x50\x72\157\x78\171\122\x65\163\x74\x72\x69\x63\x74\151\157\x6e":
goto vp;
default:
throw new Exception("\125\156\x6b\156\x6f\x77\156\x20\143\157\156\144\x69\x74\151\157\x6e\72\40" . var_export($Uo->localName, TRUE));
}
Df:
vp:
sT:
$Uo = $Uo->nextSibling;
goto HC;
jy:
}
private function parseAuthnStatement(DOMElement $cg)
{
$DW = UtilitiesSAML::xpQuery($cg, "\56\x2f\x73\141\x6d\154\x5f\x61\163\x73\x65\x72\164\x69\x6f\156\x3a\101\x75\x74\x68\156\123\164\141\x74\x65\x6d\x65\156\164");
if (empty($DW)) {
goto pp;
}
if (count($DW) > 1) {
goto Zs;
}
goto Sz;
pp:
$this->authnInstant = NULL;
return;
goto Sz;
Zs:
throw new Exception("\115\157\x72\145\40\164\150\141\164\x20\157\x6e\x65\x20\74\163\141\x6d\x6c\x3a\101\165\x74\150\156\123\x74\x61\164\x65\155\145\156\164\76\40\x69\156\40\x3c\163\141\155\x6c\72\x41\x73\x73\x65\162\x74\151\157\x6e\x3e\40\x6e\157\164\40\x73\x75\x70\160\157\162\x74\x65\x64\56");
Sz:
$hQ = $DW[0];
if ($hQ->hasAttribute("\x41\x75\x74\150\156\111\156\163\164\141\156\164")) {
goto rP;
}
throw new Exception("\x4d\x69\163\x73\x69\156\x67\x20\x72\145\x71\x75\x69\x72\145\x64\x20\x41\x75\x74\150\x6e\x49\156\x73\x74\141\x6e\x74\40\141\164\x74\x72\151\142\165\164\x65\x20\157\x6e\x20\74\x73\x61\155\x6c\x3a\101\x75\164\x68\x6e\123\164\x61\164\x65\155\145\x6e\x74\x3e\56");
rP:
$this->authnInstant = UtilitiesSAML::xsDateTimeToTimestamp($hQ->getAttribute("\101\165\x74\150\x6e\111\x6e\163\x74\141\156\164"));
if (!$hQ->hasAttribute("\x53\145\163\163\151\x6f\x6e\x4e\157\164\x4f\156\x4f\162\101\146\x74\145\162")) {
goto ta;
}
$this->sessionNotOnOrAfter = UtilitiesSAML::xsDateTimeToTimestamp($hQ->getAttribute("\x53\x65\x73\x73\x69\x6f\x6e\116\157\x74\117\156\x4f\162\x41\146\x74\145\x72"));
ta:
if (!$hQ->hasAttribute("\123\x65\x73\x73\x69\x6f\x6e\111\x6e\144\145\x78")) {
goto Of;
}
$this->sessionIndex = $hQ->getAttribute("\123\x65\163\163\x69\157\x6e\111\x6e\x64\x65\170");
Of:
$this->parseAuthnContext($hQ);
}
private function parseAuthnContext(DOMElement $hI)
{
$h1 = UtilitiesSAML::xpQuery($hI, "\x2e\x2f\163\141\x6d\154\x5f\141\163\x73\x65\162\164\x69\x6f\156\72\x41\165\164\x68\156\103\x6f\156\164\x65\x78\164");
if (count($h1) > 1) {
goto rQ;
}
if (empty($h1)) {
goto nu;
}
goto WF;
rQ:
throw new Exception("\115\157\x72\x65\x20\164\x68\141\156\40\x6f\x6e\x65\40\74\x73\x61\x6d\154\72\101\165\x74\x68\x6e\x43\157\156\164\x65\170\164\x3e\x20\x69\x6e\40\74\x73\x61\x6d\x6c\x3a\x41\x75\x74\x68\156\123\164\141\164\x65\155\145\x6e\164\76\x2e");
goto WF;
nu:
throw new Exception("\115\x69\163\x73\x69\x6e\147\x20\162\145\x71\x75\x69\162\145\144\x20\x3c\163\141\155\x6c\x3a\x41\165\x74\x68\156\x43\157\156\164\145\170\x74\76\40\151\156\40\74\x73\x61\155\x6c\72\101\165\164\x68\156\x53\x74\x61\x74\x65\x6d\145\x6e\x74\x3e\56");
WF:
$zT = $h1[0];
$QE = UtilitiesSAML::xpQuery($zT, "\x2e\57\163\x61\155\x6c\137\x61\163\163\145\x72\164\x69\157\156\x3a\101\x75\x74\x68\156\103\x6f\156\x74\145\x78\164\104\x65\x63\154\122\145\146");
if (count($QE) > 1) {
goto N4;
}
if (count($QE) === 1) {
goto FS;
}
goto nl;
N4:
throw new Exception("\115\x6f\162\145\x20\x74\150\x61\156\40\157\x6e\x65\40\x3c\x73\x61\x6d\154\x3a\101\165\164\150\x6e\x43\x6f\x6e\x74\x65\x78\164\104\x65\x63\x6c\x52\x65\146\x3e\40\146\x6f\x75\156\x64\x3f");
goto nl;
FS:
$this->setAuthnContextDeclRef(trim($QE[0]->textContent));
nl:
$se = UtilitiesSAML::xpQuery($zT, "\x2e\57\163\x61\x6d\154\x5f\141\x73\163\145\x72\164\x69\x6f\156\72\101\165\x74\150\156\x43\157\156\x74\x65\x78\x74\x44\145\x63\154");
if (count($se) > 1) {
goto pW;
}
if (count($se) === 1) {
goto a6;
}
goto Ol;
pW:
throw new Exception("\115\157\162\145\x20\164\x68\x61\156\x20\x6f\x6e\145\40\74\163\x61\x6d\x6c\x3a\x41\165\164\x68\156\x43\157\x6e\164\145\170\164\104\145\x63\154\76\40\146\x6f\x75\156\144\x3f");
goto Ol;
a6:
$this->setAuthnContextDecl(new SAML2_XML_Chunk($se[0]));
Ol:
$Vm = UtilitiesSAML::xpQuery($zT, "\x2e\x2f\x73\x61\x6d\x6c\137\x61\x73\x73\x65\x72\x74\x69\157\156\x3a\101\165\x74\150\x6e\x43\157\156\x74\x65\170\164\103\x6c\x61\x73\163\122\145\146");
if (count($Vm) > 1) {
goto NV;
}
if (count($Vm) === 1) {
goto Li;
}
goto ul;
NV:
throw new Exception("\115\157\162\145\40\164\150\141\x6e\x20\x6f\x6e\x65\x20\x3c\163\141\x6d\x6c\x3a\101\x75\164\x68\156\103\157\156\164\145\x78\x74\x43\154\141\x73\x73\x52\145\x66\76\x20\x69\156\40\74\x73\141\x6d\154\x3a\x41\x75\x74\150\x6e\103\157\x6e\164\145\x78\x74\x3e\x2e");
goto ul;
Li:
$this->setAuthnContextClassRef(trim($Vm[0]->textContent));
ul:
if (!(empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef))) {
goto qC;
}
throw new Exception("\115\x69\163\x73\151\x6e\147\40\145\x69\x74\x68\x65\x72\x20\74\163\x61\x6d\x6c\x3a\101\165\x74\x68\x6e\103\157\x6e\x74\145\170\x74\103\x6c\141\x73\163\122\145\146\76\40\157\162\40\x3c\x73\x61\155\154\72\x41\165\164\150\156\x43\x6f\x6e\x74\x65\x78\164\x44\x65\143\154\122\x65\x66\76\x20\157\162\x20\74\x73\141\x6d\x6c\x3a\101\165\x74\150\156\103\x6f\x6e\164\145\170\x74\104\x65\143\x6c\76");
qC:
$this->AuthenticatingAuthority = UtilitiesSAML::extractStrings($zT, "\165\162\x6e\x3a\157\x61\163\x69\x73\72\x6e\x61\x6d\x65\163\x3a\164\143\72\x53\101\115\x4c\72\62\56\60\x3a\x61\163\x73\145\x72\164\x69\157\x6e", "\101\165\164\150\145\x6e\164\x69\143\141\164\x69\x6e\147\101\165\x74\x68\157\x72\x69\x74\x79");
}
private function parseAttributes(DOMElement $cg)
{
$vE = TRUE;
$Bh = UtilitiesSAML::xpQuery($cg, "\56\x2f\x73\x61\x6d\154\137\x61\163\163\145\x72\164\151\157\x6e\x3a\x41\x74\164\162\x69\142\x75\x74\145\x53\164\141\164\145\155\x65\156\164\57\x73\x61\x6d\x6c\x5f\x61\163\163\x65\162\x74\151\x6f\x6e\72\101\x74\x74\x72\x69\x62\165\x74\145");
foreach ($Bh as $zJ) {
if ($zJ->hasAttribute("\x4e\141\x6d\x65")) {
goto oc;
}
throw new Exception("\x4d\x69\163\x73\151\x6e\147\x20\x6e\x61\x6d\145\x20\x6f\156\40\74\163\141\155\x6c\x3a\x41\x74\164\162\151\x62\x75\164\x65\76\x20\145\154\x65\155\145\156\164\x2e");
oc:
$yu = $zJ->getAttribute("\116\x61\x6d\145");
if ($zJ->hasAttribute("\x4e\x61\155\145\106\157\x72\x6d\x61\x74")) {
goto hW;
}
$Rh = "\165\162\156\x3a\157\141\x73\x69\163\72\x6e\x61\x6d\x65\163\72\164\x63\72\x53\x41\x4d\x4c\72\x31\56\x31\x3a\156\141\x6d\x65\x69\144\x2d\146\x6f\x72\155\141\164\x3a\x75\156\163\160\x65\x63\x69\146\x69\x65\x64";
goto yW;
hW:
$Rh = $zJ->getAttribute("\x4e\141\x6d\145\x46\x6f\162\155\141\164");
yW:
if ($vE) {
goto FG;
}
if (!($this->nameFormat !== $Rh)) {
goto Oh;
}
$this->nameFormat = "\165\x72\156\x3a\157\x61\x73\x69\x73\x3a\156\x61\155\145\163\72\x74\x63\x3a\123\x41\115\x4c\72\x31\x2e\61\72\x6e\141\x6d\x65\151\144\55\x66\157\162\x6d\141\x74\72\x75\156\x73\x70\x65\x63\151\146\151\x65\x64";
Oh:
goto fM;
FG:
$this->nameFormat = $Rh;
$vE = FALSE;
fM:
if (array_key_exists($yu, $this->attributes)) {
goto Nw;
}
$this->attributes[$yu] = array();
Nw:
$AP = UtilitiesSAML::xpQuery($zJ, "\56\x2f\163\x61\155\154\137\x61\x73\163\x65\x72\164\151\x6f\156\72\101\164\164\x72\x69\x62\x75\164\145\x56\141\x6c\x75\145");
foreach ($AP as $K6) {
$this->attributes[$yu][] = trim($K6->textContent);
zE:
}
rh:
kv:
}
fF:
}
private function parseEncryptedAttributes(DOMElement $cg)
{
$this->encryptedAttribute = UtilitiesSAML::xpQuery($cg, "\56\57\x73\x61\155\154\137\x61\163\x73\x65\162\x74\151\x6f\x6e\x3a\x41\x74\x74\x72\x69\142\x75\x74\x65\x53\x74\141\164\145\x6d\145\x6e\164\57\163\x61\155\154\137\141\x73\163\x65\x72\x74\x69\x6f\x6e\x3a\x45\x6e\143\x72\x79\160\x74\x65\x64\101\164\x74\x72\x69\142\x75\x74\145");
}
private function parseSignature(DOMElement $cg)
{
$CV = UtilitiesSAML::validateElement($cg);
if (!($CV !== FALSE)) {
goto CA;
}
$this->wasSignedAtConstruction = TRUE;
$this->certificates = $CV["\103\x65\x72\x74\151\x66\x69\x63\141\164\145\163"];
$this->signatureData = $CV;
CA:
}
public function validate(XMLSecurityKeySAML $lv)
{
if (!($this->signatureData === NULL)) {
goto o9;
}
return FALSE;
o9:
UtilitiesSAML::validateSignature($this->signatureData, $lv);
return TRUE;
}
public function getId()
{
return $this->id;
}
public function setId($oA)
{
$this->id = $oA;
}
public function getIssueInstant()
{
return $this->issueInstant;
}
public function setIssueInstant($VE)
{
$this->issueInstant = $VE;
}
public function getIssuer()
{
return $this->issuer;
}
public function setIssuer($yB)
{
$this->issuer = $yB;
}
public function getNameId()
{
if (!($this->encryptedNameId !== NULL)) {
goto xx;
}
throw new Exception("\101\x74\164\x65\155\160\164\145\x64\40\x74\x6f\x20\x72\x65\164\162\x69\145\x76\x65\40\145\156\143\162\x79\160\164\145\144\x20\116\141\x6d\x65\111\x44\40\x77\151\x74\150\x6f\165\164\40\144\145\x63\x72\171\160\x74\151\x6e\147\x20\151\x74\x20\x66\151\162\x73\164\56");
xx:
return $this->nameId;
}
public function setNameId($uj)
{
$this->nameId = $uj;
}
public function isNameIdEncrypted()
{
if (!($this->encryptedNameId !== NULL)) {
goto zM;
}
return TRUE;
zM:
return FALSE;
}
public function encryptNameId(XMLSecurityKeySAML $lv)
{
$Fk = new DOMDocument();
$mt = $Fk->createElement("\162\x6f\x6f\164");
$Fk->appendChild($mt);
UtilitiesSAML::addNameId($mt, $this->nameId);
$uj = $mt->firstChild;
UtilitiesSAML::getContainer()->debugMessage($uj, "\x65\156\143\162\171\x70\x74");
$rQ = new XMLSecEncSAML();
$rQ->setNode($uj);
$rQ->type = XMLSecEncSAML::Element;
$AK = new XMLSecurityKeySAML(XMLSecurityKeySAML::AES128_CBC);
$AK->generateSessionKey();
$rQ->encryptKey($lv, $AK);
$this->encryptedNameId = $rQ->encryptNode($AK);
$this->nameId = NULL;
}
public function decryptNameId(XMLSecurityKeySAML $lv, array $k8 = array())
{
if (!($this->encryptedNameId === NULL)) {
goto g3;
}
return;
g3:
$uj = UtilitiesSAML::decryptElement($this->encryptedNameId, $lv, $k8);
UtilitiesSAML::getContainer()->debugMessage($uj, "\x64\145\x63\162\x79\x70\x74");
$this->nameId = UtilitiesSAML::parseNameId($uj);
$this->encryptedNameId = NULL;
}
public function decryptAttributes(XMLSecurityKeySAML $lv, array $k8 = array())
{
if (!($this->encryptedAttribute === NULL)) {
goto FU;
}
return;
FU:
$vE = TRUE;
$Bh = $this->encryptedAttribute;
foreach ($Bh as $L6) {
$zJ = UtilitiesSAML::decryptElement($L6->getElementsByTagName("\x45\156\143\162\171\x70\x74\145\x64\x44\x61\164\x61")->item(0), $lv, $k8);
if ($zJ->hasAttribute("\x4e\141\x6d\145")) {
goto bS;
}
throw new Exception("\x4d\151\x73\163\151\x6e\147\40\x6e\141\x6d\x65\x20\x6f\x6e\40\74\x73\x61\x6d\154\72\101\164\164\162\151\x62\x75\164\x65\76\x20\x65\x6c\x65\155\145\156\164\56");
bS:
$yu = $zJ->getAttribute("\116\141\x6d\x65");
if ($zJ->hasAttribute("\116\141\155\x65\106\157\x72\155\x61\164")) {
goto OE;
}
$Rh = "\x75\x72\x6e\x3a\x6f\141\163\151\163\x3a\156\x61\155\x65\x73\72\164\x63\x3a\123\101\115\x4c\72\62\56\x30\x3a\141\164\164\162\x6e\x61\x6d\x65\x2d\146\157\x72\155\141\164\72\x75\x6e\x73\x70\145\x63\151\x66\x69\145\x64";
goto Bh;
OE:
$Rh = $zJ->getAttribute("\116\x61\x6d\x65\x46\157\162\155\x61\164");
Bh:
if ($vE) {
goto le;
}
if (!($this->nameFormat !== $Rh)) {
goto S5;
}
$this->nameFormat = "\165\162\156\x3a\x6f\141\x73\x69\x73\72\x6e\x61\x6d\x65\x73\x3a\164\x63\72\x53\x41\x4d\x4c\x3a\62\56\60\72\141\x74\164\x72\x6e\x61\155\145\x2d\x66\157\x72\155\141\164\x3a\165\x6e\163\x70\145\x63\151\x66\x69\145\x64";
S5:
goto pV;
le:
$this->nameFormat = $Rh;
$vE = FALSE;
pV:
if (array_key_exists($yu, $this->attributes)) {
goto LW;
}
$this->attributes[$yu] = array();
LW:
$AP = UtilitiesSAML::xpQuery($zJ, "\56\57\163\141\x6d\154\x5f\141\163\163\145\x72\x74\151\x6f\x6e\72\x41\x74\164\x72\x69\x62\165\164\x65\x56\x61\154\165\145");
foreach ($AP as $K6) {
$this->attributes[$yu][] = trim($K6->textContent);
ow:
}
WM:
gv:
}
bI:
}
public function getNotBefore()
{
return $this->notBefore;
}
public function setNotBefore($oC)
{
$this->notBefore = $oC;
}
public function getNotOnOrAfter()
{
return $this->notOnOrAfter;
}
public function setNotOnOrAfter($bu)
{
$this->notOnOrAfter = $bu;
}
public function setEncryptedAttributes($Yl)
{
$this->requiredEncAttributes = $Yl;
}
public function getValidAudiences()
{
return $this->validAudiences;
}
public function setValidAudiences(array $yX = NULL)
{
$this->validAudiences = $yX;
}
public function getAuthnInstant()
{
return $this->authnInstant;
}
public function setAuthnInstant($wA)
{
$this->authnInstant = $wA;
}
public function getSessionNotOnOrAfter()
{
return $this->sessionNotOnOrAfter;
}
public function setSessionNotOnOrAfter($fh)
{
$this->sessionNotOnOrAfter = $fh;
}
public function getSessionIndex()
{
return $this->sessionIndex;
}
public function setSessionIndex($eK)
{
$this->sessionIndex = $eK;
}
public function getAuthnContext()
{
if (empty($this->authnContextClassRef)) {
goto Zf;
}
return $this->authnContextClassRef;
Zf:
if (empty($this->authnContextDeclRef)) {
goto Gp;
}
return $this->authnContextDeclRef;
Gp:
return NULL;
}
public function setAuthnContext($wj)
{
$this->setAuthnContextClassRef($wj);
}
public function getAuthnContextClassRef()
{
return $this->authnContextClassRef;
}
public function setAuthnContextClassRef($lf)
{
$this->authnContextClassRef = $lf;
}
public function setAuthnContextDecl(SAML2_XML_Chunk $VW)
{
if (empty($this->authnContextDeclRef)) {
goto pz;
}
throw new Exception("\101\165\164\x68\x6e\103\157\156\x74\145\x78\x74\x44\x65\x63\x6c\x52\145\146\40\x69\x73\x20\x61\x6c\162\145\141\x64\171\x20\x72\x65\147\x69\163\x74\x65\x72\x65\x64\41\x20\x4d\x61\171\x20\157\156\154\x79\x20\150\x61\166\145\40\145\151\x74\150\x65\x72\x20\x61\40\x44\x65\143\154\x20\x6f\x72\x20\x61\x20\104\x65\143\154\x52\145\146\x2c\40\156\x6f\x74\x20\142\157\164\150\41");
pz:
$this->authnContextDecl = $VW;
}
public function getAuthnContextDecl()
{
return $this->authnContextDecl;
}
public function setAuthnContextDeclRef($vc)
{
if (empty($this->authnContextDecl)) {
goto sd;
}
throw new Exception("\101\165\x74\150\x6e\x43\157\156\x74\145\x78\x74\104\145\143\154\40\x69\163\40\x61\x6c\x72\x65\141\x64\x79\40\162\145\147\x69\x73\164\x65\x72\x65\x64\x21\40\115\x61\x79\40\x6f\x6e\154\171\40\x68\141\166\145\x20\x65\x69\x74\150\x65\162\x20\141\x20\104\145\143\154\x20\157\162\x20\141\40\104\x65\143\x6c\x52\145\x66\x2c\x20\x6e\x6f\x74\40\142\157\x74\150\x21");
sd:
$this->authnContextDeclRef = $vc;
}
public function getAuthnContextDeclRef()
{
return $this->authnContextDeclRef;
}
public function getAuthenticatingAuthority()
{
return $this->AuthenticatingAuthority;
}
public function setAuthenticatingAuthority($PW)
{
$this->AuthenticatingAuthority = $PW;
}
public function getAttributes()
{
return $this->attributes;
}
public function setAttributes(array $Bh)
{
$this->attributes = $Bh;
}
public function getAttributeNameFormat()
{
return $this->nameFormat;
}
public function setAttributeNameFormat($Rh)
{
$this->nameFormat = $Rh;
}
public function getSubjectConfirmation()
{
return $this->SubjectConfirmation;
}
public function setSubjectConfirmation(array $rg)
{
$this->SubjectConfirmation = $rg;
}
public function getSignatureKey()
{
return $this->signatureKey;
}
public function setSignatureKey(XMLSecurityKeySAML $gV = NULL)
{
$this->signatureKey = $gV;
}
public function getEncryptionKey()
{
return $this->encryptionKey;
}
public function setEncryptionKey(XMLSecurityKeySAML $aO = NULL)
{
$this->encryptionKey = $aO;
}
public function setCertificates(array $aZ)
{
$this->certificates = $aZ;
}
public function getCertificates()
{
return $this->certificates;
}
public function getWasSignedAtConstruction()
{
return $this->wasSignedAtConstruction;
}
public function toXML(DOMNode $p6 = NULL)
{
if ($p6 === NULL) {
goto hJ;
}
$L0 = $p6->ownerDocument;
goto wy;
hJ:
$L0 = new DOMDocument();
$p6 = $L0;
wy:
$mt = $L0->createElementNS("\x75\162\156\72\x6f\x61\163\151\x73\72\x6e\141\x6d\145\x73\x3a\x74\143\72\123\101\115\x4c\x3a\x32\56\x30\72\x61\163\163\145\x72\164\151\157\156", "\x73\x61\155\x6c\72" . "\x41\x73\x73\x65\162\164\151\157\156");
$p6->appendChild($mt);
$mt->setAttributeNS("\x75\162\x6e\72\157\x61\163\x69\x73\72\x6e\x61\155\145\163\72\x74\143\72\123\101\115\114\72\62\56\x30\72\160\x72\157\x74\x6f\x63\157\x6c", "\163\141\x6d\154\160\x3a\x74\155\160", "\164\155\x70");
$mt->removeAttributeNS("\x75\162\156\x3a\157\x61\x73\x69\163\72\x6e\x61\155\145\163\x3a\164\143\x3a\123\101\x4d\x4c\72\x32\56\x30\x3a\x70\162\x6f\164\157\x63\x6f\154", "\164\x6d\x70");
$mt->setAttributeNS("\x68\164\x74\x70\x3a\x2f\x2f\167\167\x77\x2e\x77\63\56\x6f\x72\x67\57\62\x30\x30\x31\57\130\115\x4c\123\143\150\x65\x6d\141\55\151\156\x73\x74\x61\x6e\143\145", "\170\163\151\72\x74\155\x70", "\164\x6d\160");
$mt->removeAttributeNS("\150\164\164\160\72\x2f\57\x77\167\167\56\167\x33\56\157\x72\147\57\62\x30\60\61\x2f\130\115\x4c\x53\143\150\145\x6d\x61\55\151\x6e\163\164\141\156\x63\x65", "\x74\155\x70");
$mt->setAttributeNS("\x68\164\x74\x70\72\x2f\57\167\167\167\56\x77\x33\56\157\x72\x67\57\62\x30\60\x31\57\130\115\x4c\x53\x63\x68\x65\155\141", "\x78\163\72\164\x6d\160", "\x74\155\160");
$mt->removeAttributeNS("\150\x74\x74\160\72\x2f\57\x77\x77\167\56\167\x33\x2e\x6f\x72\x67\x2f\62\x30\60\x31\57\x58\115\x4c\x53\143\x68\145\x6d\141", "\x74\x6d\x70");
$mt->setAttribute("\x49\x44", $this->id);
$mt->setAttribute("\x56\x65\x72\163\151\x6f\x6e", "\x32\x2e\60");
$mt->setAttribute("\111\x73\x73\165\x65\x49\156\x73\164\x61\156\x74", gmdate("\131\55\x6d\x2d\144\x5c\124\x48\x3a\x69\72\163\x5c\x5a", $this->issueInstant));
$yB = UtilitiesSAML::addString($mt, "\165\x72\156\72\157\141\163\x69\x73\72\156\141\x6d\145\163\x3a\x74\x63\72\123\x41\x4d\114\72\x32\x2e\x30\72\141\x73\163\x65\162\x74\151\157\156", "\x73\141\155\x6c\x3a\111\163\x73\165\145\162", $this->issuer);
$this->addSubject($mt);
$this->addConditions($mt);
$this->addAuthnStatement($mt);
if ($this->requiredEncAttributes == FALSE) {
goto vT;
}
$this->addEncryptedAttributeStatement($mt);
goto VX;
vT:
$this->addAttributeStatement($mt);
VX:
if (!($this->signatureKey !== NULL)) {
goto K6;
}
UtilitiesSAML::insertSignature($this->signatureKey, $this->certificates, $mt, $yB->nextSibling);
K6:
return $mt;
}
private function addSubject(DOMElement $mt)
{
if (!($this->nameId === NULL && $this->encryptedNameId === NULL)) {
goto U4;
}
return;
U4:
$AW = $mt->ownerDocument->createElementNS("\x75\162\x6e\72\157\x61\x73\151\x73\x3a\156\x61\x6d\145\163\x3a\164\143\x3a\123\x41\x4d\114\x3a\62\x2e\60\x3a\141\x73\163\x65\x72\164\151\157\156", "\x73\141\x6d\x6c\72\123\165\x62\152\145\x63\x74");
$mt->appendChild($AW);
if ($this->encryptedNameId === NULL) {
goto ke;
}
$VF = $AW->ownerDocument->createElementNS("\x75\x72\x6e\x3a\x6f\141\x73\x69\163\72\156\141\x6d\145\163\72\x74\x63\x3a\x53\x41\x4d\x4c\72\62\56\60\x3a\141\x73\163\145\x72\164\151\157\156", "\x73\141\x6d\x6c\x3a" . "\105\156\x63\x72\x79\160\x74\x65\x64\111\x44");
$AW->appendChild($VF);
$VF->appendChild($AW->ownerDocument->importNode($this->encryptedNameId, TRUE));
goto Gs;
ke:
UtilitiesSAML::addNameId($AW, $this->nameId);
Gs:
foreach ($this->SubjectConfirmation as $gE) {
$gE->toXML($AW);
e2:
}
fU:
}
private function addConditions(DOMElement $mt)
{
$L0 = $mt->ownerDocument;
$Zb = $L0->createElementNS("\x75\162\x6e\x3a\x6f\x61\x73\151\163\72\156\x61\x6d\145\163\72\164\143\72\123\101\115\x4c\x3a\x32\56\x30\x3a\141\163\x73\x65\x72\x74\x69\157\156", "\x73\141\155\154\72\103\157\156\144\151\x74\151\157\156\x73");
$mt->appendChild($Zb);
if (!($this->notBefore !== NULL)) {
goto C3;
}
$Zb->setAttribute("\x4e\157\164\x42\145\146\157\x72\145", gmdate("\x59\55\155\x2d\x64\x5c\x54\110\x3a\151\72\163\x5c\x5a", $this->notBefore));
C3:
if (!($this->notOnOrAfter !== NULL)) {
goto UW;
}
$Zb->setAttribute("\116\x6f\164\117\x6e\x4f\162\x41\x66\x74\x65\x72", gmdate("\131\x2d\155\x2d\x64\134\124\110\x3a\x69\72\163\134\x5a", $this->notOnOrAfter));
UW:
if (!($this->validAudiences !== NULL)) {
goto m3;
}
$qc = $L0->createElementNS("\x75\x72\x6e\x3a\x6f\141\x73\151\163\72\x6e\x61\x6d\x65\x73\x3a\x74\143\72\x53\101\115\114\x3a\x32\x2e\60\72\141\x73\163\x65\162\164\x69\157\x6e", "\163\x61\155\x6c\72\101\165\144\x69\145\156\143\145\122\145\163\x74\x72\x69\143\164\x69\x6f\156");
$Zb->appendChild($qc);
UtilitiesSAML::addStrings($qc, "\165\x72\156\x3a\157\x61\163\x69\163\x3a\156\141\155\145\163\72\164\x63\72\123\101\115\x4c\x3a\62\x2e\x30\x3a\x61\x73\163\145\x72\x74\151\157\x6e", "\x73\x61\x6d\154\72\101\x75\144\151\x65\156\143\145", FALSE, $this->validAudiences);
m3:
}
private function addAuthnStatement(DOMElement $mt)
{
if (!($this->authnInstant === NULL || $this->authnContextClassRef === NULL && $this->authnContextDecl === NULL && $this->authnContextDeclRef === NULL)) {
goto Cm;
}
return;
Cm:
$L0 = $mt->ownerDocument;
$hI = $L0->createElementNS("\165\162\156\x3a\x6f\x61\163\x69\163\x3a\156\141\155\145\x73\x3a\164\x63\x3a\123\x41\x4d\114\x3a\62\x2e\60\72\x61\163\x73\x65\162\x74\151\157\156", "\163\141\x6d\x6c\x3a\101\x75\164\150\x6e\123\164\141\164\x65\155\145\x6e\x74");
$mt->appendChild($hI);
$hI->setAttribute("\x41\x75\x74\x68\x6e\x49\156\x73\x74\x61\x6e\x74", gmdate("\131\55\x6d\x2d\x64\x5c\124\x48\72\x69\72\x73\134\x5a", $this->authnInstant));
if (!($this->sessionNotOnOrAfter !== NULL)) {
goto EY;
}
$hI->setAttribute("\x53\145\163\163\151\157\x6e\116\x6f\x74\117\156\x4f\162\x41\x66\x74\x65\162", gmdate("\x59\x2d\155\55\144\134\x54\x48\x3a\151\x3a\x73\134\132", $this->sessionNotOnOrAfter));
EY:
if (!($this->sessionIndex !== NULL)) {
goto RA;
}
$hI->setAttribute("\x53\145\x73\163\x69\157\156\x49\156\144\145\x78", $this->sessionIndex);
RA:
$zT = $L0->createElementNS("\165\x72\156\x3a\157\x61\163\151\163\72\x6e\141\x6d\x65\x73\x3a\x74\x63\x3a\123\101\x4d\x4c\72\x32\x2e\60\72\141\163\163\x65\162\x74\151\x6f\156", "\x73\x61\x6d\x6c\x3a\101\x75\x74\150\x6e\x43\157\156\x74\x65\x78\164");
$hI->appendChild($zT);
if (empty($this->authnContextClassRef)) {
goto af;
}
UtilitiesSAML::addString($zT, "\165\x72\x6e\72\x6f\x61\163\x69\x73\x3a\x6e\141\155\145\x73\x3a\x74\143\x3a\x53\x41\115\x4c\72\62\56\60\72\141\x73\163\145\162\164\x69\x6f\x6e", "\x73\x61\x6d\x6c\x3a\101\x75\164\x68\x6e\x43\157\x6e\164\145\170\164\x43\154\x61\x73\x73\x52\145\x66", $this->authnContextClassRef);
af:
if (empty($this->authnContextDecl)) {
goto Ya;
}
$this->authnContextDecl->toXML($zT);
Ya:
if (empty($this->authnContextDeclRef)) {
goto WN;
}
UtilitiesSAML::addString($zT, "\165\162\x6e\72\157\141\x73\151\163\x3a\156\141\155\145\x73\x3a\x74\143\72\123\101\x4d\x4c\72\x32\x2e\x30\72\141\163\x73\x65\162\164\151\x6f\156", "\163\141\155\x6c\x3a\101\165\x74\x68\156\x43\x6f\x6e\164\x65\170\x74\104\x65\x63\x6c\122\145\x66", $this->authnContextDeclRef);
WN:
UtilitiesSAML::addStrings($zT, "\165\x72\156\x3a\157\141\x73\151\163\72\x6e\x61\x6d\x65\163\72\164\143\72\x53\x41\115\114\72\x32\56\x30\72\x61\163\163\x65\x72\x74\x69\x6f\x6e", "\163\x61\155\154\x3a\101\165\164\150\x65\156\164\151\x63\x61\164\151\x6e\147\101\x75\164\150\157\162\x69\164\171", FALSE, $this->AuthenticatingAuthority);
}
private function addAttributeStatement(DOMElement $mt)
{
if (!empty($this->attributes)) {
goto Ha;
}
return;
Ha:
$L0 = $mt->ownerDocument;
$I2 = $L0->createElementNS("\165\x72\156\72\x6f\x61\x73\x69\163\72\156\141\x6d\145\x73\72\x74\143\72\x53\x41\115\x4c\x3a\62\56\x30\72\x61\163\163\145\162\164\151\157\156", "\x73\x61\155\x6c\x3a\x41\x74\164\x72\x69\x62\x75\x74\x65\x53\x74\141\x74\145\x6d\145\x6e\x74");
$mt->appendChild($I2);
foreach ($this->attributes as $yu => $AP) {
$zJ = $L0->createElementNS("\165\162\156\72\x6f\141\x73\151\163\x3a\156\141\x6d\145\x73\72\164\x63\72\x53\x41\x4d\114\x3a\x32\x2e\60\x3a\141\x73\163\x65\x72\164\151\157\156", "\163\x61\155\x6c\x3a\101\x74\x74\162\x69\142\x75\x74\x65");
$I2->appendChild($zJ);
$zJ->setAttribute("\x4e\x61\x6d\x65", $yu);
if (!($this->nameFormat !== "\x75\x72\x6e\72\x6f\x61\163\151\163\x3a\x6e\141\x6d\145\163\72\x74\x63\x3a\x53\101\115\114\x3a\x32\56\60\72\141\164\164\x72\x6e\x61\155\x65\55\x66\157\x72\x6d\x61\164\72\165\156\163\x70\x65\143\151\146\151\145\x64")) {
goto jo;
}
$zJ->setAttribute("\116\x61\x6d\x65\x46\157\162\155\141\x74", $this->nameFormat);
jo:
foreach ($AP as $K6) {
if (is_string($K6)) {
goto l6;
}
if (is_int($K6)) {
goto MT;
}
$T_ = NULL;
goto r4;
l6:
$T_ = "\x78\163\x3a\163\x74\162\151\x6e\x67";
goto r4;
MT:
$T_ = "\x78\x73\x3a\x69\156\x74\145\147\145\x72";
r4:
$SA = $L0->createElementNS("\x75\162\x6e\x3a\x6f\x61\x73\x69\163\x3a\x6e\141\x6d\145\163\72\164\x63\x3a\x53\101\x4d\114\x3a\62\56\60\x3a\x61\163\163\x65\162\164\151\x6f\x6e", "\x73\141\155\154\72\101\164\x74\x72\x69\x62\x75\x74\145\126\141\x6c\x75\145");
$zJ->appendChild($SA);
if (!($T_ !== NULL)) {
goto ue;
}
$SA->setAttributeNS("\150\x74\x74\x70\72\57\x2f\x77\167\x77\56\167\x33\x2e\x6f\x72\x67\x2f\62\60\x30\61\x2f\130\x4d\x4c\x53\143\150\x65\155\x61\x2d\151\x6e\163\x74\141\156\x63\x65", "\170\163\151\x3a\x74\171\160\145", $T_);
ue:
if (!is_null($K6)) {
goto X8;
}
$SA->setAttributeNS("\x68\164\164\x70\72\57\57\x77\x77\167\56\x77\x33\x2e\x6f\162\x67\x2f\62\x30\x30\x31\57\130\115\x4c\123\x63\150\145\x6d\x61\55\x69\x6e\163\x74\141\x6e\143\145", "\170\x73\x69\x3a\x6e\151\154", "\164\x72\165\145");
X8:
if ($K6 instanceof DOMNodeList) {
goto TU;
}
$SA->appendChild($L0->createTextNode($K6));
goto Yr;
TU:
$Va = 0;
jH:
if (!($Va < $K6->length)) {
goto By;
}
$Uo = $L0->importNode($K6->item($Va), TRUE);
$SA->appendChild($Uo);
JS:
$Va++;
goto jH;
By:
Yr:
Hz:
}
Iq:
yo:
}
EL:
}
private function addEncryptedAttributeStatement(DOMElement $mt)
{
if (!($this->requiredEncAttributes == FALSE)) {
goto OJ;
}
return;
OJ:
$L0 = $mt->ownerDocument;
$I2 = $L0->createElementNS("\165\162\156\72\x6f\141\163\x69\x73\72\x6e\x61\x6d\x65\x73\x3a\x74\143\x3a\x53\101\115\x4c\72\62\56\x30\x3a\x61\163\163\x65\162\x74\x69\157\x6e", "\x73\x61\x6d\154\72\x41\164\x74\162\151\142\165\x74\145\x53\x74\x61\x74\145\155\x65\x6e\164");
$mt->appendChild($I2);
foreach ($this->attributes as $yu => $AP) {
$oz = new DOMDocument();
$zJ = $oz->createElementNS("\x75\162\x6e\72\157\141\x73\x69\x73\72\x6e\141\155\x65\163\x3a\x74\x63\72\123\x41\x4d\x4c\72\x32\x2e\x30\x3a\141\163\163\x65\x72\164\151\157\x6e", "\x73\x61\x6d\154\72\x41\164\164\x72\151\x62\165\x74\145");
$zJ->setAttribute("\x4e\x61\x6d\145", $yu);
$oz->appendChild($zJ);
if (!($this->nameFormat !== "\165\x72\156\72\157\141\163\151\x73\x3a\x6e\141\x6d\x65\x73\72\x74\143\72\x53\101\115\114\72\62\x2e\60\x3a\141\164\x74\162\x6e\x61\155\x65\55\146\x6f\162\x6d\141\x74\72\x75\156\163\x70\145\x63\x69\146\x69\x65\x64")) {
goto Mj;
}
$zJ->setAttribute("\x4e\x61\x6d\x65\x46\x6f\162\x6d\141\x74", $this->nameFormat);
Mj:
foreach ($AP as $K6) {
if (is_string($K6)) {
goto gz;
}
if (is_int($K6)) {
goto Cs;
}
$T_ = NULL;
goto Qr;
gz:
$T_ = "\170\x73\72\x73\x74\162\x69\156\x67";
goto Qr;
Cs:
$T_ = "\x78\x73\x3a\151\156\164\145\147\x65\162";
Qr:
$SA = $oz->createElementNS("\165\x72\156\72\157\141\x73\151\163\72\156\x61\x6d\145\163\72\164\x63\72\123\101\115\114\x3a\x32\56\x30\x3a\x61\x73\x73\x65\162\x74\x69\x6f\x6e", "\x73\x61\x6d\154\x3a\101\x74\x74\162\151\x62\x75\164\145\x56\x61\x6c\165\145");
$zJ->appendChild($SA);
if (!($T_ !== NULL)) {
goto AJ;
}
$SA->setAttributeNS("\150\164\164\x70\72\57\57\x77\167\x77\56\167\63\x2e\157\162\147\57\62\60\60\61\57\x58\115\x4c\123\x63\x68\145\155\x61\55\x69\x6e\163\164\141\156\143\145", "\170\163\151\72\164\x79\160\145", $T_);
AJ:
if ($K6 instanceof DOMNodeList) {
goto tK;
}
$SA->appendChild($oz->createTextNode($K6));
goto i7;
tK:
$Va = 0;
BD:
if (!($Va < $K6->length)) {
goto Tt;
}
$Uo = $oz->importNode($K6->item($Va), TRUE);
$SA->appendChild($Uo);
XJ:
$Va++;
goto BD;
Tt:
i7:
hr:
}
tI:
$x7 = new XMLSecEncSAML();
$x7->setNode($oz->documentElement);
$x7->type = "\x68\164\164\x70\72\x2f\57\x77\167\x77\56\x77\x33\56\157\162\147\x2f\62\60\x30\61\x2f\60\x34\x2f\170\x6d\154\145\x6e\x63\43\x45\x6c\x65\155\x65\156\164";
$AK = new XMLSecurityKeySAML(XMLSecurityKeySAML::AES256_CBC);
$AK->generateSessionKey();
$x7->encryptKey($this->encryptionKey, $AK);
$On = $x7->encryptNode($AK);
$wX = $L0->createElementNS("\x75\162\156\72\157\x61\x73\151\x73\72\156\x61\155\x65\x73\72\164\143\x3a\123\101\115\x4c\72\62\56\x30\x3a\x61\163\x73\x65\x72\x74\x69\157\x6e", "\x73\x61\x6d\154\72\x45\x6e\143\162\171\160\164\145\144\x41\164\x74\162\x69\x62\x75\164\x65");
$I2->appendChild($wX);
$r_ = $L0->importNode($On, TRUE);
$wX->appendChild($r_);
sb:
}
cO:
}
public function getSignatureData()
{
return $this->signatureData;
}
}
Function Calls
None |
Stats
MD5 | 3f964b2a6959f390ff890ff9df52f9bd |
Eval Count | 0 |
Decode Time | 648 ms |