Commit 6ef8a60a authored by Denis Filatov's avatar Denis Filatov
Browse files

psid names in view mode

parent e92f57ae
Loading
Loading
Loading
Loading
+109 −137
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
                xmlns:date="http://exslt.org/dates-and-times"
                extension-element-prefixes="date"                
                >
 <xsl:variable name="base-time"   select="'2018-01-01'"/>
 <xsl:variable name="base-time"       select="'2019-01-01'"/>
 <xsl:variable name="local-region"    select="250"/>
 <xsl:variable name="base-latitude"   select="436169490.0"/>
 <xsl:variable name="base-longitude"  select="70533080.0"/>
@@ -29,6 +29,9 @@
 <xsl:variable name="AID-IVI"     select="139"/>
 <xsl:variable name="AID-TLC"     select="140"/>
 <xsl:variable name="AID-GN-MGMT" select="141"/>
 <xsl:variable name="AID-CRT-REQ" select="623"/>
 <xsl:variable name="AID-CRL"     select="622"/>
 <xsl:variable name="AID-CTL"     select="624"/>

 <xsl:template match = "/">
  <xsl:apply-templates select="certificate"/>
@@ -86,27 +89,27 @@
 </xsl:template>

 <xsl:template match = "subject">
  <xsl:variable name="eeType">
   <xsl:choose>
    <xsl:when test="@type = 'ROOT'">11000000</xsl:when>
    <xsl:when test="@type = 'AA'">10000000</xsl:when>
    <xsl:when test="@type = 'TLM'">10000000</xsl:when>
    <xsl:when test="@type = 'EA'">01000000</xsl:when> <!-- certReqPermissions is not used yet in TS103097 -->
    <xsl:otherwise>0</xsl:otherwise>
   </xsl:choose>
  </xsl:variable>

  <xsl:variable name="minChainLength">
  <xsl:variable name="defaultCrtReqAppSSP">
   <xsl:choose>
    <xsl:when test="@type = 'ROOT'">2</xsl:when>
    <xsl:when test="@type = 'AA'">1</xsl:when>
    <xsl:when test="@type = 'EA'">1</xsl:when>
    <xsl:when test="@type = 'ROOT'">0</xsl:when>
    <xsl:when test="@type = 'AA'">00110010</xsl:when>
    <xsl:when test="@type = 'TLM'">0</xsl:when>
    <xsl:when test="@type = 'EA'">00001110</xsl:when>
    <xsl:when test="@type = 'EC'">11000000</xsl:when>
    <xsl:when test="@type = 'AT'">0</xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
   </xsl:choose>
  </xsl:variable>
  <xsl:variable name="chainLengthRange">

  <xsl:variable name="defaultCrtReqIssueSSP">
   <xsl:choose>
    <xsl:when test="@type = 'ROOT'">0</xsl:when>
    <xsl:when test="@type = 'ROOT'">11111110</xsl:when>
    <xsl:when test="@type = 'AA'">0</xsl:when>
    <xsl:when test="@type = 'TLM'">0</xsl:when>
    <xsl:when test="@type = 'EA'">11000000</xsl:when>
    <xsl:when test="@type = 'EC'">0</xsl:when>
    <xsl:when test="@type = 'AT'">0</xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
   </xsl:choose>
  </xsl:variable>
@@ -128,9 +131,7 @@
   <xsl:apply-templates select="attribute[@type='assurance_level']"/>
   <xsl:apply-templates select="attribute[@type='its_aid_ssp_list']"/>
   <xsl:apply-templates select="attribute[@type='its_aid_list']">
    <xsl:with-param name="eeType" select="$eeType"/>
    <xsl:with-param name="minChainLength" select="$minChainLength"/>
    <xsl:with-param name="chainLengthRange" select="$chainLengthRange"/>
    <xsl:with-param name="certType" select="@type"/>
   </xsl:apply-templates>
   <xsl:apply-templates select="attribute[@type='encryption_key']"/>
   <xsl:apply-templates select="attribute[@type='verification_key']"/>
@@ -158,148 +159,119 @@
 </xsl:template>
 
 <xsl:template match="attribute[@type='its_aid_list']">
  <xsl:param name="eeType"/>
  <xsl:param name="minChainLength"/>
  <xsl:param name="chainLengthRange"/>
  <xsl:param name="certType"/>
  <certIssuePermissions>
   <PsidGroupPermissions>
    <subjectPermissions>
     <explicit>
      <xsl:apply-templates mode="certIssuePermissions" select="aid"/>
      <xsl:apply-templates mode="certIssuePermissions" select="aid">
       <xsl:with-param name="certType" select="$certType"/>
      </xsl:apply-templates>
     </explicit>
    </subjectPermissions>
    <minChainLength><xsl:value-of select="$minChainLength"/></minChainLength>
    <chainLengthRange><xsl:value-of select="$chainLengthRange"/></chainLengthRange>
    <eeType><xsl:value-of select="$eeType"/></eeType>
    <minChainLength>
     <xsl:choose>
      <xsl:when test="$certType = 'ROOT'">2</xsl:when>
      <xsl:when test="$certType = 'AA'">1</xsl:when>
      <xsl:when test="$certType = 'EA'">1</xsl:when>
      <xsl:otherwise>0</xsl:otherwise>
     </xsl:choose>
    </minChainLength>
    <chainLengthRange>
     <xsl:choose>
      <xsl:when test="$certType = 'ROOT'">0</xsl:when>
      <xsl:otherwise>0</xsl:otherwise>
     </xsl:choose>
    </chainLengthRange>
    <eeType>
     <xsl:choose>
      <xsl:when test="@eeType = 'enrol'">
        <xsl:text>01000000</xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>10000000</xsl:text>
      </xsl:otherwise>
     </xsl:choose>
    </eeType>
   </PsidGroupPermissions>
  </certIssuePermissions>
 </xsl:template>
 
 <xsl:template mode="certIssuePermissions" match="aid">
  <PsidSspRange>
  <xsl:param name="certType"/>
  <xsl:variable name="SSPValue">
   <xsl:choose>
    <xsl:when test="@value = 'CAM' or @value=$AID-CAM">
     <xsl:comment>CAM</xsl:comment>
     <psid><xsl:value-of select="$AID-CAM"/></psid>
     <sspRange>
      <bitmapSspRange>
       <sspValue>01 FF FF</sspValue>
       <sspBitmask>01 FF FF</sspBitmask>
      </bitmapSspRange>
     </sspRange>
    </xsl:when>
    <xsl:when test="@value = 'DENM' or @value=$AID-DENM">
     <xsl:comment>DENM</xsl:comment>
     <psid><xsl:value-of select="$AID-DENM"/></psid>
     <sspRange>
      <bitmapSspRange>
       <sspValue>01 FF FF FF</sspValue>
       <sspBitmask>01 FF FF FF</sspBitmask>
      </bitmapSspRange>
     </sspRange>
    </xsl:when>
    <xsl:when test="@value = 'TLM' or @value = 'SPAT' or @value=$AID-SPAT">
     <xsl:comment>SPAT</xsl:comment>
     <psid><xsl:value-of select="$AID-SPAT"/></psid>
     <sspRange>
      <bitmapSspRange>
       <sspValue>01 FF FF FF</sspValue>
       <sspBitmask>01 FF FF FF</sspBitmask>
      </bitmapSspRange>
     </sspRange>
    </xsl:when>
    <xsl:when test="@value = 'RLT' or @value = 'MAP' or @value=$AID-MAP">
     <xsl:comment>MAP</xsl:comment>
     <psid><xsl:value-of select="$AID-MAP"/></psid>
     <sspRange>
      <bitmapSspRange>
       <sspValue>01 FF FF FF</sspValue>
       <sspBitmask>01 FF FF FF</sspBitmask>
      </bitmapSspRange>
     </sspRange>
    </xsl:when>
    <xsl:when test="@value = 'IVI' or @value=$AID-IVI">
     <xsl:comment>IVI</xsl:comment>
     <psid><xsl:value-of select="$AID-IVI"/></psid>
     <sspRange>
      <bitmapSspRange>
       <sspValue>01 FF FF FF</sspValue>
       <sspBitmask>01 FF FF FF</sspBitmask>
      </bitmapSspRange>
     </sspRange>
    <xsl:when test="normalize-space(.) != ''"><xsl:value-of select="normalize-space(.)"/></xsl:when>
    <xsl:when test="@value = 'CAM' or @value=$AID-CAM">01 FF FF</xsl:when>
    <xsl:when test="@value = 'DENM' or @value=$AID-DENM">01 FF FF</xsl:when>
    <xsl:when test="@value = 'TLM' or @value = 'SPAT' or @value=$AID-SPAT">01 FF FF FF</xsl:when>
    <xsl:when test="@value = 'RLT' or @value = 'MAP' or @value=$AID-MAP">01 FF FF FF</xsl:when>
    <xsl:when test="@value = 'IVI' or @value=$AID-IVI">01 FF FF FF</xsl:when>
    <xsl:when test="@value = 'TLC' or @value=$AID-TLC">01 FF FF FF</xsl:when>
    <xsl:when test="@value = 'CRT-REQ' or @value = $AID-CRT-REQ">
     <xsl:choose>
      <xsl:when test="$certType = 'ROOT'">01 FE</xsl:when>
      <xsl:when test="$certType = 'EA'">01 C0</xsl:when>
      <xsl:otherwise>01 00</xsl:otherwise>
     </xsl:choose>
    </xsl:when>
    <xsl:when test="@value = 'TLC' or @value=$AID-TLC">
     <xsl:comment>TLC</xsl:comment>
     <psid><xsl:value-of select="$AID-TLC"/></psid>
   </xsl:choose>
  </xsl:variable>
  <PsidSspRange>
   <xsl:comment><xsl:value-of select="@value"/></xsl:comment>
   <psid>
    <xsl:choose>
     <xsl:when test="@value = 'CAM' "><xsl:value-of select="$AID-CAM"/></xsl:when>
     <xsl:when test="@value = 'DENM' "><xsl:value-of select="$AID-DENM"/></xsl:when>
     <xsl:when test="@value = 'TLM' or @value = 'SPAT'"><xsl:value-of select="$AID-SPAT"/></xsl:when>
     <xsl:when test="@value = 'RLT' or @value = 'MAP'"><xsl:value-of select="$AID-MAP"/></xsl:when>
     <xsl:when test="@value = 'IVI' "><xsl:value-of select="$AID-IVI"/></xsl:when>
     <xsl:when test="@value = 'TLC' or @value=$AID-TLC"><xsl:value-of select="$AID-TLC"/></xsl:when>
     <xsl:when test="@value = 'CRT-REQ'"><xsl:value-of select="$AID-CRT-REQ"/></xsl:when>
     <xsl:when test="@value = 'CRL'"><xsl:value-of select="$AID-CRL"/></xsl:when>
     <xsl:when test="@value = 'CTL'"><xsl:value-of select="$AID-CTL"/></xsl:when>
     <xsl:when test="@value = 'GN-MGMT'"><xsl:value-of select="$AID-GN-MGMT"/></xsl:when>
     <xsl:otherwise><xsl:value-of select="@value"/></xsl:otherwise>
    </xsl:choose>
   </psid>
   <xsl:if test="string-length($SSPValue) &gt; 0">
    <sspRange>
     <bitmapSspRange>
       <sspValue>01 FF FF FF</sspValue>
       <sspBitmask>01 FF FF FF</sspBitmask>
      <sspValue><xsl:value-of select="$SSPValue"/></sspValue>
      <sspBitmask><xsl:value-of select="$SSPValue"/></sspBitmask>
     </bitmapSspRange>
    </sspRange>
    </xsl:when>
    <xsl:when test="@value = 'GN-MGMT' or @value = $AID-GN-MGMT">
     <xsl:comment>GN-MGMT</xsl:comment>
     <psid><xsl:value-of select="$AID-GN-MGMT"/></psid>
    </xsl:when>
    <xsl:otherwise>
     <psid><xsl:value-of select="@value"/></psid>
    </xsl:otherwise>
    </xsl:choose>
   </xsl:if>
  </PsidSspRange>
 </xsl:template>

 
 <xsl:template match="attribute[@type='its_aid_ssp_list']">
   <appPermissions>
    <xsl:apply-templates mode="appPermissions" select="ssp"/>
   </appPermissions>
 </xsl:template>

 <xsl:template mode="appPermissions" match="ssp">
   <PsidSsp>
    <xsl:comment><xsl:value-of select="@aid"/></xsl:comment>
    <psid>
     <xsl:choose>
      <xsl:when test="@aid = 'CAM' or @aid=$AID-CAM">
       <xsl:comment>CAM</xsl:comment>
       <psid><xsl:value-of select="$AID-CAM"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:when test="@aid = 'DENM' or @aid=$AID-DENM">
       <xsl:comment>DENM</xsl:comment>
       <psid><xsl:value-of select="$AID-DENM"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:when test="@aid = 'SPAT' or @aid='TLM' or @aid=$AID-SPAT">
       <xsl:comment>SPAT</xsl:comment>
       <psid><xsl:value-of select="$AID-SPAT"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:when test="@aid = 'MAP' or @aid='RLT' or @aid=$AID-MAP">
       <xsl:comment>MAP</xsl:comment>
       <psid><xsl:value-of select="$AID-MAP"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:when test="@aid = 'IVI' or @aid=$AID-IVI">
       <xsl:comment>IVI</xsl:comment>
       <psid><xsl:value-of select="$AID-IVI"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:when test="@aid = 'TLC' or @aid=$AID-TLC">
       <xsl:comment>TLC</xsl:comment>
       <psid><xsl:value-of select="$AID-TLC"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:when test="@aid = 'GN-MGMT' or @aid=$AID-GN-MGMT">
       <xsl:comment>GN-MGMT</xsl:comment>
       <psid><xsl:value-of select="$AID-GN-MGMT"/></psid>
       <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
      </xsl:when>
      <xsl:otherwise>
       <psid><xsl:value-of select="@aid"/></psid>
      <xsl:when test="@aid = 'CAM' "><xsl:value-of select="$AID-CAM"/></xsl:when>
      <xsl:when test="@aid = 'DENM' "><xsl:value-of select="$AID-DENM"/></xsl:when>
      <xsl:when test="@aid = 'TLM' or @aid = 'SPAT'"><xsl:value-of select="$AID-SPAT"/></xsl:when>
      <xsl:when test="@aid = 'RLT' or @aid = 'MAP'"><xsl:value-of select="$AID-MAP"/></xsl:when>
      <xsl:when test="@aid = 'IVI' "><xsl:value-of select="$AID-IVI"/></xsl:when>
      <xsl:when test="@aid = 'TLC' or @aid=$AID-TLC"><xsl:value-of select="$AID-TLC"/></xsl:when>
      <xsl:when test="@aid = 'CRT-REQ'"><xsl:value-of select="$AID-CRT-REQ"/></xsl:when>
      <xsl:when test="@aid = 'CRL'"><xsl:value-of select="$AID-CRL"/></xsl:when>
      <xsl:when test="@aid = 'CTL'"><xsl:value-of select="$AID-CTL"/></xsl:when>
      <xsl:when test="@aid = 'GN-MGMT'"><xsl:value-of select="$AID-GN-MGMT"/></xsl:when>
      <xsl:otherwise><xsl:value-of select="@aid"/></xsl:otherwise>
     </xsl:choose>
    </psid>
    <xsl:if test="string-length(.) &gt; 0">
        <ssp><opaque><xsl:value-of select="." /></opaque></ssp>
     <ssp><bitmapSsp><xsl:value-of select="." /></bitmapSsp></ssp>
    </xsl:if>
      </xsl:otherwise>
     </xsl:choose>
   </PsidSsp>
 </xsl:template>

+32 −1
Original line number Diff line number Diff line
@@ -36,8 +36,39 @@ Psid_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
static asn_oer_constraints_t asn_OER_type_Psid_constr_1 CC_NOTUSED = {
	{ 0, 1 }	/* (0..MAX) */,
	-1};
static const asn_INTEGER_enum_map_t asn_MAP_Psid_value2enum_1[] = {
	{ 36, 3, "cam" },
	{ 37, 4, "denm" },
	{ 38, 7, "generic" },
	{ 137, 4, "spat" },
	{ 138, 3, "map" },
	{ 139, 3, "ivi" },
	{ 140, 3, "tlc" },
	{ 141, 7, "gn-mgmt" },
	{ 622, 3, "crl" },
	{ 623, 8, "cert-req" },
	{ 624, 3, "ctl" }
};
static const unsigned int asn_MAP_Psid_enum2value_1[] = {
	0,	/* cam(36) */
	9,	/* cert-req(623) */
	8,	/* crl(622) */
	10,	/* ctl(624) */
	1,	/* denm(37) */
	2,	/* generic(38) */
	7,	/* gn-mgmt(141) */
	5,	/* ivi(139) */
	4,	/* map(138) */
	3,	/* spat(137) */
	6	/* tlc(140) */
};

const asn_INTEGER_specifics_t asn_SPC_Psid_specs_1 = {
	0,	0,	0,	0,	0,
	asn_MAP_Psid_value2enum_1,	/* "tag" => N; sorted by tag */
	asn_MAP_Psid_enum2value_1,	/* N => "tag"; sorted by N */
	11,	/* Number of elements in the maps */
	0,
	0,
	0,	/* Native long size */
	1	/* Unsigned representation */
};