Commit b953d9d4 authored by Denis Filatov's avatar Denis Filatov
Browse files

fix multiple id region in cert geterator

parent 982f2adc
......@@ -108,6 +108,15 @@ static asn_dec_rval_t IssuerIdentifier_xer_decoder(const asn_codec_ctx_t *opt_co
return CHOICE_decode_xer(opt_codec_ctx, td, struct_ptr, opt_mname, buf_ptr, size);
}
static asn_dec_rval_t CountryOnly_xer_decoder(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **struct_ptr,
const char *opt_mname, const void *buf_ptr, size_t size)
{
// for the future to support letter codes
return NativeInteger_decode_xer(opt_codec_ctx, td, struct_ptr, opt_mname, buf_ptr, size);
}
typedef struct overrun_encoder_key {
void *buffer;
size_t buffer_size;
......@@ -272,9 +281,13 @@ int main(int argc, char ** argv)
asn_TYPE_operation_t signatureOps = *asn_DEF_Signature.op;
asn_DEF_Signature.op = &signatureOps;
asn_TYPE_operation_t countryOnlyOps = *asn_DEF_CountryOnly.op;
asn_DEF_CountryOnly.op = &countryOnlyOps;
issuerOps.xer_decoder = IssuerIdentifier_xer_decoder;
tbsOps.oer_encoder = ToBeSignedCertificate_oer_encoder;
signatureOps.oer_encoder = Signature_oer_encoder;
countryOnlyOps.xer_decoder = CountryOnly_xer_decoder;
PublicVerificationKey_PR hashType = PublicVerificationKey_PR_NOTHING;
......
......@@ -472,28 +472,32 @@
</region>
</xsl:template>
<xsl:template mode="region" match="id">
<region>
<xsl:template mode="region" match="restriction[@type='region' and id]">
<region>
<identifiedRegion>
<xsl:choose>
<xsl:when test="@local != '0'">
<countryAndRegions>
<xsl:call-template name="country-only">
<xsl:with-param name="id" select="@id"/>
</xsl:call-template>
<regions>
<INTEGER>@local</INTEGER>
</regions>
</countryAndRegions>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="country-only">
<xsl:with-param name="id" select="@id"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates mode="region" select="id"/>
</identifiedRegion>
</region>
</region>
</xsl:template>
<xsl:template mode="region" match="id">
<xsl:choose>
<xsl:when test="@local != '0'">
<countryAndRegions>
<xsl:call-template name="country-only">
<xsl:with-param name="id" select="@id"/>
</xsl:call-template>
<regions>
<INTEGER>@local</INTEGER>
</regions>
</countryAndRegions>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="country-only">
<xsl:with-param name="id" select="@id"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="geo-value">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment