lovele0107 / signatures-conformance-checker

7 stars 0 forks source link

Error reported after last child of an element sequence #20

Closed bseddon closed 3 years ago

bseddon commented 3 years ago

Hi

This post is about the second of two errors reported against the signature file attached. Again, I've only just begun using the checker tool so I not be interpreting the information supplied in the error messages correctly and I apologize if this is the case.

signature.zip

The error reported is shown in the screenshot. The Xml fragment from the signature that causes the error is:

<CommitmentTypeIndication>
    <CommitmentTypeId>
            <Identifier>some identifer</Identifier>
    </CommitmentTypeId>
    <ObjectReference>#xmldsig-ref0</ObjectReference>
</CommitmentTypeIndication>

xades checker CommitmentTypeIndication issue

The error reports that something is wrong after the <ObjectReference> (this is where the carat character appears in the output). However <ObjectReference> is the last used element and the only element that can appear after <ObjectReference> is the optional <CommitmentTypeQualifiers>.

The CommitmentTypeIndicationType is described in section 5.2.3 of ETSI 319 132-1 V1.1.1 (2016-04). This type is reproduced here. In it the CommitmentTypeQualifiersListType is defined with a minOccurs facet value of zero. This is reflected in the error message as <CommitmentTypeQualifiers> is shown with a '?' suffix. As a result, surely there should be no error.

<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>

<xsd:complexType name="CommitmentTypeIndicationType">
    <xsd:sequence>
        <xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
        <xsd:choice>
            <xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
            <xsd:element name="AllSignedDataObjects"/>
        </xsd:choice>
        <xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="CommitmentTypeQualifiersListType">
    <xsd:sequence>
        <xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
</xsd:complexType
jccruellas commented 3 years ago

As for this error, the actual truth is that in my local copy, it does not appear.

This error was reported by some other user and fixed. Again, when I deploy the new version on the server it should not appear

bseddon commented 3 years ago

Thanks again.

Because I'm new to the tool, I'm reading every word carefully and spotted this small typo in the Errors and warnings and Full report pages. In a few days it will seem familiar and I will not notice it so this note is to flag it while I still do.

xades checker typo

jccruellas commented 3 years ago

Hi again, Thank you very much indeed for pointing this out. Fixed in my local copy.

Regards Juan Carlos