lovele0107 / signatures-conformance-checker

7 stars 0 forks source link

XAdESCC fails to validate a signature with XML CommitmentTypeQualifier #35

Closed bsanchezb closed 2 years ago

bsanchezb commented 2 years ago

Dear @jccruellas ,

According to the specification, CommitmentTypeQualifier element is a type of AnyType, therefore it may contain text information or an embedded XML:

<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>

However, while XAdESCC is able to verify a signature containing a text type CommitmentTypeQualifier, it fails to verify a signature with XML content enveloped into CommitmentTypeQualifier element.

The returned error is NOT_FOUND_ERR.

Could you please take a look on the issue? The sample document is in the attachment.

Best regards, Aleksandr.

sample.zip

bsanchezb commented 2 years ago

Hm, maybe the problem is not related to all custom 'CommitmentTypeQualifier's, but it is the content of this particular CommitmentTypeQualifier that causes the issue. But still the problem persist.

jccruellas commented 2 years ago

Good afternoon, I will take a look asap and will come to you. Regards Juan Carlos

jccruellas commented 2 years ago

Good afternoon, I think that I have found the reason for the failure and fixed It. Actually it was a failure in the process of registering the nodes with attribute 'Id' or 'ID' or 'id' which are defined in a non-XML namespace. In particular, it was the element . XAdESCC did not properly manage the non-xml namespaces for these elements. I have fixed it in my local XAdESCC local copy. I attach a zip that contains the framework of html pages reporting the result of checking the signature that you have posted.

I will deploy this version of XAdESCC hopefully this afternoon. Regards and thanks for reporting this issue sample-signed-xades-baseline-b.zip

Juan Carlos.

jccruellas commented 2 years ago

Hi again, I have deployed XAdESCC version 1.4 which, as far as I am aware, fixes the problems that you experienced with the signature that you passed to me.

Could you please confirm whether I can close this issue? Regards

bsanchezb commented 2 years ago

Hello Juan Carlos,

It seems to be working perfectly now!

Thank you for the quick resolution. I will close the issue.

KR, Aleksandr.