Loading certgen/CERT_IUT_C1_AT.xml −36 File deleted. Show changes certgen/asn1certgen.xslt +97 −25 Changes for certgen/asn1certgen.xslt: 97 added lines, 25 removed lines. Original line number Diff line number Diff line Loading @@ -11,10 +11,10 @@ xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date" > <xsl:variable name="base-time" select="'2022-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"/> <xsl:param name="base-time" select="concat(date:year(date:date()), '-01-01')"/> <xsl:param name="local-region" select="250"/> <xsl:param name="base-latitude" select="436169490.0"/> <xsl:param name="base-longitude" select="70533080.0"/> <!-- <xsl:variable name="base-latitude" select="0"/> <xsl:variable name="base-longitude" select="0"/> Loading @@ -36,8 +36,36 @@ <xsl:variable name="AID-GPC" select="540802"/> <xsl:variable name="AID-CPM" select="639"/> <xsl:variable name="AID-VRU" select="638"/> <xsl:variable name="AID-VAM" select="638"/> <xsl:variable name="AID-SA" select="540801"/> <xsl:template name="AID-name2value"> <xsl:param name="aid" /> <xsl:choose> <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'" ><xsl:value-of select="$AID-SPAT"/></xsl:when> <xsl:when test="$aid = 'SPAT'"><xsl:value-of select="$AID-SPAT"/></xsl:when> <xsl:when test="$aid = 'RLT'" ><xsl:value-of select="$AID-MAP"/></xsl:when> <xsl:when test="$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'" ><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="$aid = 'SREM'"><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="$aid = 'SSEM'"><xsl:value-of select="$AID-SSEM"/></xsl:when> <xsl:when test="$aid = 'GPC'" ><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="$aid = 'RTCMEM'" ><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="$aid = 'CPM'" ><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="$aid = 'CPS'" ><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="$aid = 'VRU'" ><xsl:value-of select="$AID-VAM"/></xsl:when> <xsl:when test="$aid = 'VAM'" ><xsl:value-of select="$AID-VAM"/></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> </xsl:template> <xsl:template match = "/"> <xsl:apply-templates select="certificate"/> </xsl:template> Loading @@ -45,7 +73,7 @@ <xsl:template match = "certificate"> <EtsiTs103097Certificate> <xsl:apply-templates select="version"/> <type><explicit/></type> <xsl:apply-templates select="." mode="cert_type"/> <xsl:apply-templates select="signer"/> <xsl:apply-templates select="subject"/> <xsl:apply-templates select="signature"/> Loading @@ -57,6 +85,16 @@ <version>3</version> </xsl:template> <xsl:template match="certificate" mode="cert_type"> <type><xsl:choose> <xsl:when test="@type='implicit'"><implicit/></xsl:when> <xsl:when test="@type='explicit'"><explicit/></xsl:when> <xsl:when test="subject/attribute[@type='verification_key']/public_key"><explicit/></xsl:when> <xsl:when test="subject/attribute[@type='verification_key']/reconstruction_value"><implicit/></xsl:when> <xsl:otherwise><explicit/></xsl:otherwise> </xsl:choose></type> </xsl:template> <xsl:template match = "signer"> <xsl:choose> <xsl:when test="@type='digest'"> Loading Loading @@ -99,6 +137,7 @@ <xsl:choose> <xsl:when test="@type = 'ROOT'">0</xsl:when> <xsl:when test="@type = 'AA'">00110010</xsl:when> <xsl:when test="@type = 'MA'">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> Loading @@ -111,6 +150,7 @@ <xsl:choose> <xsl:when test="@type = 'ROOT'">11111110</xsl:when> <xsl:when test="@type = 'AA'">0</xsl:when> <xsl:when test="@type = 'MA'">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> Loading @@ -134,10 +174,10 @@ <xsl:apply-templates select="../validity/restriction[@type='time']"/> <xsl:apply-templates mode="region" select="../validity/restriction[@type='region']"/> <xsl:apply-templates select="attribute[@type='assurance_level']"/> <xsl:apply-templates select="attribute[@type='its_aid_ssp_list']"/> <xsl:if test="attribute[@type='its_aid_list']"> <xsl:apply-templates select="attribute[@type='its_aid_ssp_list' or @type='app_aid_list']"/> <xsl:if test="attribute[@type='its_aid_list' or @type='issuing_aid_list']"> <certIssuePermissions> <xsl:apply-templates select="attribute[@type='its_aid_list']"> <xsl:apply-templates select="attribute[@type='its_aid_list' or @type='issuing_aid_list']"> <xsl:with-param name="certType" select="@type"/> </xsl:apply-templates> </certIssuePermissions> Loading Loading @@ -167,42 +207,52 @@ <xsl:comment>level=<xsl:value-of select="$level"/> confidence=<xsl:value-of select="$confidence"/> </xsl:comment> </xsl:template> <xsl:template match="attribute[@type='its_aid_list']"> <xsl:template match="attribute[@type='its_aid_list' or @type='issuing_aid_list']"> <xsl:param name="certType"/> <PsidGroupPermissions> <subjectPermissions> <xsl:choose> <xsl:when test="@all or aid[@value='all'] or aid[@all]"> <all/> </xsl:when> <xsl:otherwise> <explicit> <xsl:apply-templates mode="certIssuePermissions" select="aid"> <xsl:with-param name="certType" select="$certType"/> </xsl:apply-templates> </explicit> </xsl:otherwise> </xsl:choose> </subjectPermissions> <minChainLength> <xsl:choose> <xsl:when test="@minChainLength"><xsl:value-of select="@minChainLength"/></xsl:when> <xsl:when test="$certType = 'ROOT'">2</xsl:when> <xsl:otherwise>1</xsl:otherwise> <xsl:when test="@minChainLength and not(@minChainLength='1')"> <minChainLength><xsl:value-of select="@minChainLength"/></minChainLength> </xsl:when> <xsl:when test="@minLength and not(@minLength='1')"> <minChainLength><xsl:value-of select="@minLength"/></minChainLength> </xsl:when> <xsl:when test="$certType = 'ROOT'">2 <minChainLength>2</minChainLength> </xsl:when> </xsl:choose> </minChainLength> <chainLengthRange> <xsl:choose> <xsl:when test="$certType = 'ROOT'">0</xsl:when> <xsl:otherwise>0</xsl:otherwise> <xsl:when test="@chainLengthRange and not(@chainLengthRange='0')"> <chainLengthRange><xsl:value-of select="@chainLengthRange"/></chainLengthRange> </xsl:when> <xsl:when test="@lengthRange and not(@lengthRange='0')"> <chainLengthRange><xsl:value-of select="@lengthRange"/></chainLengthRange> </xsl:when> </xsl:choose> </chainLengthRange> <eeType> <xsl:choose> <xsl:when test="@eeType = 'enrol' or @eeType = '40'"> <xsl:text>01000000</xsl:text> <eeType><xsl:text>01000000</xsl:text></eeType> </xsl:when> <xsl:when test="@eeType = 'app' or @eeType = '80'"> <xsl:text>10000000</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>11000000</xsl:text> <eeType><xsl:text>11000000</xsl:text></eeType> <!-- all --> </xsl:otherwise> </xsl:choose> </eeType> </PsidGroupPermissions> </xsl:template> Loading @@ -228,6 +278,8 @@ <xsl:when test="@value = 'TLC' or @value=$AID-SREM or @value='SREM'">02 FF FF E0</xsl:when> <xsl:when test="@value = 'SSEM' or @value=$AID-SSEM">01</xsl:when> <xsl:when test="@value = 'GPC' or @value=$AID-GPC">01</xsl:when> <xsl:when test="@value = 'CPM' or @value=$AID-CPM">01</xsl:when> <xsl:when test="@value = 'VAM' or @value=$AID-VAM">01</xsl:when> <xsl:when test="@value = 'CRT-REQ' or @value = $AID-CRT-REQ"> <xsl:choose> <xsl:when test="$certType = 'ROOT'">01 FE</xsl:when> Loading Loading @@ -257,6 +309,8 @@ <xsl:when test="@value = 'TLC' or @value=$AID-SREM or @value='SREM'">FF 00 00 1F</xsl:when> <xsl:when test="@value = 'SSEM' or @value=$AID-SSEM">FF</xsl:when> <xsl:when test="@value = 'GPC' or @value=$AID-GPC">FF</xsl:when> <xsl:when test="@value = 'CPM' or @value=$AID-CPM">FF</xsl:when> <xsl:when test="@value = 'VAM' or @value=$AID-VAM">FF</xsl:when> <xsl:when test="@value = 'CRT-REQ' or @value = $AID-CRT-REQ"> <xsl:choose> <xsl:when test="$certType = 'ROOT'">FF 01</xsl:when> Loading @@ -269,6 +323,10 @@ <PsidSspRange> <xsl:comment><xsl:value-of select="@value"/></xsl:comment> <psid> <xsl:call-template name="AID-name2value"> <xsl:with-param name="aid" select="@value"/> </xsl:call-template> <!-- <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> Loading @@ -278,12 +336,15 @@ <xsl:when test="@value = 'TLC' or @value = 'SREM'"><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="@value = 'SSEM'"><xsl:value-of select="$AID-SSEM"/></xsl:when> <xsl:when test="@value = 'GPC'"><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="@value = 'CPM'"><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="@value = 'VAM'"><xsl:value-of select="$AID-VAM"/></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) > 0"> <sspRange> Loading @@ -296,7 +357,7 @@ </PsidSspRange> </xsl:template> <xsl:template match="attribute[@type='its_aid_ssp_list']"> <xsl:template match="attribute[@type='its_aid_ssp_list' or @type='app_aid_list']"> <appPermissions> <xsl:apply-templates mode="appPermissions" select="ssp"/> </appPermissions> Loading @@ -315,6 +376,8 @@ <xsl:when test="@aid = 'TLC' or @aid = 'SREM'"><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="@aid = 'SSEM'"><xsl:value-of select="$AID-SSEM"/></xsl:when> <xsl:when test="@aid = 'GPC'"><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="@aid = 'CPM'"><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="@aid = 'VAM'"><xsl:value-of select="$AID-VAM"/></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> Loading Loading @@ -609,9 +672,16 @@ <xsl:template match="attribute[@type='verification_key']"> <verifyKeyIndicator> <xsl:if test="public_key"> <verificationKey> <xsl:apply-templates select="public_key" mode="verification_key"/> </verificationKey> </xsl:if> <xsl:if test="reconstruction_value"> <reconstructionValue> <xsl:apply-templates select="reconstruction_value/ecc_point"/> </reconstructionValue> </xsl:if> </verifyKeyIndicator> </xsl:template> Loading @@ -637,6 +707,9 @@ </xsl:choose> </xsl:template> <!--xsl:template match="reconstruction_value"> </xsl:template--> <xsl:template match="public_key" mode="encryption_key"> <supportedSymmAlg> <xsl:choose> Loading Loading @@ -729,7 +802,6 @@ <sSig/> </xsl:template> <xsl:template name="ConvertDecToHex"> <xsl:param name="index" /> <xsl:if test="$index > 0"> Loading certgen/asncodec.vcxproj +441 −24 File changed.Preview size limit exceeded, changes collapsed. Show changes certgen/asncodec/ANY.c +80 Changes for certgen/asncodec/ANY.c: 80 added lines, 0 removed lines. Original line number Diff line number Diff line /* * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include <asn_internal.h> #include <ANY.h> asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = { sizeof(ANY_t), offsetof(ANY_t, _asn_ctx), ASN_OSUBV_ANY }; asn_TYPE_operation_t asn_OP_ANY = { OCTET_STRING_free, #if !defined(ASN_DISABLE_PRINT_SUPPORT) OCTET_STRING_print, #else 0, #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ OCTET_STRING_compare, #if !defined(ASN_DISABLE_BER_SUPPORT) OCTET_STRING_decode_ber, OCTET_STRING_encode_der, #else 0, 0, #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ #if !defined(ASN_DISABLE_XER_SUPPORT) OCTET_STRING_decode_xer_hex, ANY_encode_xer, #else 0, 0, #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ #if !defined(ASN_DISABLE_JER_SUPPORT) ANY_encode_jer, #else 0, #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ #if !defined(ASN_DISABLE_OER_SUPPORT) 0, 0, #else 0, 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) ANY_decode_uper, ANY_encode_uper, #else 0, 0, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ #if !defined(ASN_DISABLE_APER_SUPPORT) ANY_decode_aper, ANY_encode_aper, #else 0, 0, #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ 0, /* Random fill is not defined for ANY type */ 0 /* Use generic outmost tag fetcher */ }; asn_TYPE_descriptor_t asn_DEF_ANY = { "ANY", "ANY", &asn_OP_ANY, 0, 0, 0, 0, { #if !defined(ASN_DISABLE_OER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ asn_generic_no_constraint }, /* No constraints */ 0, 0, /* No members */ &asn_SPC_ANY_specs, }; certgen/asncodec/ANY.h +84 Changes for certgen/asncodec/ANY.h: 84 added lines, 0 removed lines. Original line number Diff line number Diff line /*- * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_TYPE_ANY_H #define ASN_TYPE_ANY_H #include <OCTET_STRING.h> /* Implemented via OCTET STRING type */ #ifdef __cplusplus extern "C" { #endif typedef struct ANY { uint8_t *buf; /* BER-encoded ANY contents */ int size; /* Size of the above buffer */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ } ANY_t; extern asn_TYPE_descriptor_t asn_DEF_ANY; extern asn_TYPE_operation_t asn_OP_ANY; extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs; #define ANY_free OCTET_STRING_free #if !defined(ASN_DISABLE_PRINT_SUPPORT) #define ANY_print OCTET_STRING_print #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ #define ANY_compare OCTET_STRING_compare #define ANY_constraint asn_generic_no_constraint #if !defined(ASN_DISABLE_BER_SUPPORT) #define ANY_decode_ber OCTET_STRING_decode_ber #define ANY_encode_der OCTET_STRING_encode_der #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ #if !defined(ASN_DISABLE_XER_SUPPORT) #define ANY_decode_xer OCTET_STRING_decode_xer_hex xer_type_encoder_f ANY_encode_xer; #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ #if !defined(ASN_DISABLE_JER_SUPPORT) jer_type_encoder_f ANY_encode_jer; #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) per_type_decoder_f ANY_decode_uper; per_type_encoder_f ANY_encode_uper; #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ #if !defined(ASN_DISABLE_APER_SUPPORT) per_type_decoder_f ANY_decode_aper; per_type_encoder_f ANY_encode_aper; #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ /****************************** * Handy conversion routines. * ******************************/ /* Convert another ASN.1 type into the ANY. This implies DER encoding. */ int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr); ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr); #if !defined(ASN_DISABLE_APER_SUPPORT) int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr); ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr); #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ /* Convert the contents of the ANY type into the specified type. */ int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); #if !defined(ASN_DISABLE_APER_SUPPORT) int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ #define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size)) #define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \ &asn_DEF_ANY, (buf), (size)) #ifdef __cplusplus } #endif #endif /* ASN_TYPE_ANY_H */ Loading
certgen/asn1certgen.xslt +97 −25 Changes for certgen/asn1certgen.xslt: 97 added lines, 25 removed lines. Original line number Diff line number Diff line Loading @@ -11,10 +11,10 @@ xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date" > <xsl:variable name="base-time" select="'2022-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"/> <xsl:param name="base-time" select="concat(date:year(date:date()), '-01-01')"/> <xsl:param name="local-region" select="250"/> <xsl:param name="base-latitude" select="436169490.0"/> <xsl:param name="base-longitude" select="70533080.0"/> <!-- <xsl:variable name="base-latitude" select="0"/> <xsl:variable name="base-longitude" select="0"/> Loading @@ -36,8 +36,36 @@ <xsl:variable name="AID-GPC" select="540802"/> <xsl:variable name="AID-CPM" select="639"/> <xsl:variable name="AID-VRU" select="638"/> <xsl:variable name="AID-VAM" select="638"/> <xsl:variable name="AID-SA" select="540801"/> <xsl:template name="AID-name2value"> <xsl:param name="aid" /> <xsl:choose> <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'" ><xsl:value-of select="$AID-SPAT"/></xsl:when> <xsl:when test="$aid = 'SPAT'"><xsl:value-of select="$AID-SPAT"/></xsl:when> <xsl:when test="$aid = 'RLT'" ><xsl:value-of select="$AID-MAP"/></xsl:when> <xsl:when test="$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'" ><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="$aid = 'SREM'"><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="$aid = 'SSEM'"><xsl:value-of select="$AID-SSEM"/></xsl:when> <xsl:when test="$aid = 'GPC'" ><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="$aid = 'RTCMEM'" ><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="$aid = 'CPM'" ><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="$aid = 'CPS'" ><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="$aid = 'VRU'" ><xsl:value-of select="$AID-VAM"/></xsl:when> <xsl:when test="$aid = 'VAM'" ><xsl:value-of select="$AID-VAM"/></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> </xsl:template> <xsl:template match = "/"> <xsl:apply-templates select="certificate"/> </xsl:template> Loading @@ -45,7 +73,7 @@ <xsl:template match = "certificate"> <EtsiTs103097Certificate> <xsl:apply-templates select="version"/> <type><explicit/></type> <xsl:apply-templates select="." mode="cert_type"/> <xsl:apply-templates select="signer"/> <xsl:apply-templates select="subject"/> <xsl:apply-templates select="signature"/> Loading @@ -57,6 +85,16 @@ <version>3</version> </xsl:template> <xsl:template match="certificate" mode="cert_type"> <type><xsl:choose> <xsl:when test="@type='implicit'"><implicit/></xsl:when> <xsl:when test="@type='explicit'"><explicit/></xsl:when> <xsl:when test="subject/attribute[@type='verification_key']/public_key"><explicit/></xsl:when> <xsl:when test="subject/attribute[@type='verification_key']/reconstruction_value"><implicit/></xsl:when> <xsl:otherwise><explicit/></xsl:otherwise> </xsl:choose></type> </xsl:template> <xsl:template match = "signer"> <xsl:choose> <xsl:when test="@type='digest'"> Loading Loading @@ -99,6 +137,7 @@ <xsl:choose> <xsl:when test="@type = 'ROOT'">0</xsl:when> <xsl:when test="@type = 'AA'">00110010</xsl:when> <xsl:when test="@type = 'MA'">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> Loading @@ -111,6 +150,7 @@ <xsl:choose> <xsl:when test="@type = 'ROOT'">11111110</xsl:when> <xsl:when test="@type = 'AA'">0</xsl:when> <xsl:when test="@type = 'MA'">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> Loading @@ -134,10 +174,10 @@ <xsl:apply-templates select="../validity/restriction[@type='time']"/> <xsl:apply-templates mode="region" select="../validity/restriction[@type='region']"/> <xsl:apply-templates select="attribute[@type='assurance_level']"/> <xsl:apply-templates select="attribute[@type='its_aid_ssp_list']"/> <xsl:if test="attribute[@type='its_aid_list']"> <xsl:apply-templates select="attribute[@type='its_aid_ssp_list' or @type='app_aid_list']"/> <xsl:if test="attribute[@type='its_aid_list' or @type='issuing_aid_list']"> <certIssuePermissions> <xsl:apply-templates select="attribute[@type='its_aid_list']"> <xsl:apply-templates select="attribute[@type='its_aid_list' or @type='issuing_aid_list']"> <xsl:with-param name="certType" select="@type"/> </xsl:apply-templates> </certIssuePermissions> Loading Loading @@ -167,42 +207,52 @@ <xsl:comment>level=<xsl:value-of select="$level"/> confidence=<xsl:value-of select="$confidence"/> </xsl:comment> </xsl:template> <xsl:template match="attribute[@type='its_aid_list']"> <xsl:template match="attribute[@type='its_aid_list' or @type='issuing_aid_list']"> <xsl:param name="certType"/> <PsidGroupPermissions> <subjectPermissions> <xsl:choose> <xsl:when test="@all or aid[@value='all'] or aid[@all]"> <all/> </xsl:when> <xsl:otherwise> <explicit> <xsl:apply-templates mode="certIssuePermissions" select="aid"> <xsl:with-param name="certType" select="$certType"/> </xsl:apply-templates> </explicit> </xsl:otherwise> </xsl:choose> </subjectPermissions> <minChainLength> <xsl:choose> <xsl:when test="@minChainLength"><xsl:value-of select="@minChainLength"/></xsl:when> <xsl:when test="$certType = 'ROOT'">2</xsl:when> <xsl:otherwise>1</xsl:otherwise> <xsl:when test="@minChainLength and not(@minChainLength='1')"> <minChainLength><xsl:value-of select="@minChainLength"/></minChainLength> </xsl:when> <xsl:when test="@minLength and not(@minLength='1')"> <minChainLength><xsl:value-of select="@minLength"/></minChainLength> </xsl:when> <xsl:when test="$certType = 'ROOT'">2 <minChainLength>2</minChainLength> </xsl:when> </xsl:choose> </minChainLength> <chainLengthRange> <xsl:choose> <xsl:when test="$certType = 'ROOT'">0</xsl:when> <xsl:otherwise>0</xsl:otherwise> <xsl:when test="@chainLengthRange and not(@chainLengthRange='0')"> <chainLengthRange><xsl:value-of select="@chainLengthRange"/></chainLengthRange> </xsl:when> <xsl:when test="@lengthRange and not(@lengthRange='0')"> <chainLengthRange><xsl:value-of select="@lengthRange"/></chainLengthRange> </xsl:when> </xsl:choose> </chainLengthRange> <eeType> <xsl:choose> <xsl:when test="@eeType = 'enrol' or @eeType = '40'"> <xsl:text>01000000</xsl:text> <eeType><xsl:text>01000000</xsl:text></eeType> </xsl:when> <xsl:when test="@eeType = 'app' or @eeType = '80'"> <xsl:text>10000000</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>11000000</xsl:text> <eeType><xsl:text>11000000</xsl:text></eeType> <!-- all --> </xsl:otherwise> </xsl:choose> </eeType> </PsidGroupPermissions> </xsl:template> Loading @@ -228,6 +278,8 @@ <xsl:when test="@value = 'TLC' or @value=$AID-SREM or @value='SREM'">02 FF FF E0</xsl:when> <xsl:when test="@value = 'SSEM' or @value=$AID-SSEM">01</xsl:when> <xsl:when test="@value = 'GPC' or @value=$AID-GPC">01</xsl:when> <xsl:when test="@value = 'CPM' or @value=$AID-CPM">01</xsl:when> <xsl:when test="@value = 'VAM' or @value=$AID-VAM">01</xsl:when> <xsl:when test="@value = 'CRT-REQ' or @value = $AID-CRT-REQ"> <xsl:choose> <xsl:when test="$certType = 'ROOT'">01 FE</xsl:when> Loading Loading @@ -257,6 +309,8 @@ <xsl:when test="@value = 'TLC' or @value=$AID-SREM or @value='SREM'">FF 00 00 1F</xsl:when> <xsl:when test="@value = 'SSEM' or @value=$AID-SSEM">FF</xsl:when> <xsl:when test="@value = 'GPC' or @value=$AID-GPC">FF</xsl:when> <xsl:when test="@value = 'CPM' or @value=$AID-CPM">FF</xsl:when> <xsl:when test="@value = 'VAM' or @value=$AID-VAM">FF</xsl:when> <xsl:when test="@value = 'CRT-REQ' or @value = $AID-CRT-REQ"> <xsl:choose> <xsl:when test="$certType = 'ROOT'">FF 01</xsl:when> Loading @@ -269,6 +323,10 @@ <PsidSspRange> <xsl:comment><xsl:value-of select="@value"/></xsl:comment> <psid> <xsl:call-template name="AID-name2value"> <xsl:with-param name="aid" select="@value"/> </xsl:call-template> <!-- <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> Loading @@ -278,12 +336,15 @@ <xsl:when test="@value = 'TLC' or @value = 'SREM'"><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="@value = 'SSEM'"><xsl:value-of select="$AID-SSEM"/></xsl:when> <xsl:when test="@value = 'GPC'"><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="@value = 'CPM'"><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="@value = 'VAM'"><xsl:value-of select="$AID-VAM"/></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) > 0"> <sspRange> Loading @@ -296,7 +357,7 @@ </PsidSspRange> </xsl:template> <xsl:template match="attribute[@type='its_aid_ssp_list']"> <xsl:template match="attribute[@type='its_aid_ssp_list' or @type='app_aid_list']"> <appPermissions> <xsl:apply-templates mode="appPermissions" select="ssp"/> </appPermissions> Loading @@ -315,6 +376,8 @@ <xsl:when test="@aid = 'TLC' or @aid = 'SREM'"><xsl:value-of select="$AID-SREM"/></xsl:when> <xsl:when test="@aid = 'SSEM'"><xsl:value-of select="$AID-SSEM"/></xsl:when> <xsl:when test="@aid = 'GPC'"><xsl:value-of select="$AID-GPC"/></xsl:when> <xsl:when test="@aid = 'CPM'"><xsl:value-of select="$AID-CPM"/></xsl:when> <xsl:when test="@aid = 'VAM'"><xsl:value-of select="$AID-VAM"/></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> Loading Loading @@ -609,9 +672,16 @@ <xsl:template match="attribute[@type='verification_key']"> <verifyKeyIndicator> <xsl:if test="public_key"> <verificationKey> <xsl:apply-templates select="public_key" mode="verification_key"/> </verificationKey> </xsl:if> <xsl:if test="reconstruction_value"> <reconstructionValue> <xsl:apply-templates select="reconstruction_value/ecc_point"/> </reconstructionValue> </xsl:if> </verifyKeyIndicator> </xsl:template> Loading @@ -637,6 +707,9 @@ </xsl:choose> </xsl:template> <!--xsl:template match="reconstruction_value"> </xsl:template--> <xsl:template match="public_key" mode="encryption_key"> <supportedSymmAlg> <xsl:choose> Loading Loading @@ -729,7 +802,6 @@ <sSig/> </xsl:template> <xsl:template name="ConvertDecToHex"> <xsl:param name="index" /> <xsl:if test="$index > 0"> Loading
certgen/asncodec.vcxproj +441 −24 File changed.Preview size limit exceeded, changes collapsed. Show changes
certgen/asncodec/ANY.c +80 Changes for certgen/asncodec/ANY.c: 80 added lines, 0 removed lines. Original line number Diff line number Diff line /* * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include <asn_internal.h> #include <ANY.h> asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = { sizeof(ANY_t), offsetof(ANY_t, _asn_ctx), ASN_OSUBV_ANY }; asn_TYPE_operation_t asn_OP_ANY = { OCTET_STRING_free, #if !defined(ASN_DISABLE_PRINT_SUPPORT) OCTET_STRING_print, #else 0, #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ OCTET_STRING_compare, #if !defined(ASN_DISABLE_BER_SUPPORT) OCTET_STRING_decode_ber, OCTET_STRING_encode_der, #else 0, 0, #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ #if !defined(ASN_DISABLE_XER_SUPPORT) OCTET_STRING_decode_xer_hex, ANY_encode_xer, #else 0, 0, #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ #if !defined(ASN_DISABLE_JER_SUPPORT) ANY_encode_jer, #else 0, #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ #if !defined(ASN_DISABLE_OER_SUPPORT) 0, 0, #else 0, 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) ANY_decode_uper, ANY_encode_uper, #else 0, 0, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ #if !defined(ASN_DISABLE_APER_SUPPORT) ANY_decode_aper, ANY_encode_aper, #else 0, 0, #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ 0, /* Random fill is not defined for ANY type */ 0 /* Use generic outmost tag fetcher */ }; asn_TYPE_descriptor_t asn_DEF_ANY = { "ANY", "ANY", &asn_OP_ANY, 0, 0, 0, 0, { #if !defined(ASN_DISABLE_OER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ asn_generic_no_constraint }, /* No constraints */ 0, 0, /* No members */ &asn_SPC_ANY_specs, };
certgen/asncodec/ANY.h +84 Changes for certgen/asncodec/ANY.h: 84 added lines, 0 removed lines. Original line number Diff line number Diff line /*- * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_TYPE_ANY_H #define ASN_TYPE_ANY_H #include <OCTET_STRING.h> /* Implemented via OCTET STRING type */ #ifdef __cplusplus extern "C" { #endif typedef struct ANY { uint8_t *buf; /* BER-encoded ANY contents */ int size; /* Size of the above buffer */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ } ANY_t; extern asn_TYPE_descriptor_t asn_DEF_ANY; extern asn_TYPE_operation_t asn_OP_ANY; extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs; #define ANY_free OCTET_STRING_free #if !defined(ASN_DISABLE_PRINT_SUPPORT) #define ANY_print OCTET_STRING_print #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ #define ANY_compare OCTET_STRING_compare #define ANY_constraint asn_generic_no_constraint #if !defined(ASN_DISABLE_BER_SUPPORT) #define ANY_decode_ber OCTET_STRING_decode_ber #define ANY_encode_der OCTET_STRING_encode_der #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ #if !defined(ASN_DISABLE_XER_SUPPORT) #define ANY_decode_xer OCTET_STRING_decode_xer_hex xer_type_encoder_f ANY_encode_xer; #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ #if !defined(ASN_DISABLE_JER_SUPPORT) jer_type_encoder_f ANY_encode_jer; #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) per_type_decoder_f ANY_decode_uper; per_type_encoder_f ANY_encode_uper; #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ #if !defined(ASN_DISABLE_APER_SUPPORT) per_type_decoder_f ANY_decode_aper; per_type_encoder_f ANY_encode_aper; #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ /****************************** * Handy conversion routines. * ******************************/ /* Convert another ASN.1 type into the ANY. This implies DER encoding. */ int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr); ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr); #if !defined(ASN_DISABLE_APER_SUPPORT) int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr); ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr); #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ /* Convert the contents of the ANY type into the specified type. */ int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); #if !defined(ASN_DISABLE_APER_SUPPORT) int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ #define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size)) #define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \ &asn_DEF_ANY, (buf), (size)) #ifdef __cplusplus } #endif #endif /* ASN_TYPE_ANY_H */