DIY information cards - Issue with enveloping signature

Hi,

it looks like I could need some help. My situation is following:

- I create DIY cards through some homegrown Java code

- I sign these DIY cards with Apache xmlsec version 1.3 (latest release). Verification works with this toolkit.

- The CardSpace application always refuses to import the crd files saying "An error occurred during the import of a card. Errors in reading the imported card file." in the event log (Event ID 260)

- The signature verification seems to work (if I manipulate the signed data, I get the event description "An incoming identity could not be validated. Signature could not be verified.")

- The signature path validation seems to work (if I removed the trusted certificate, I get chain trust errors)

- The contained information card object seems to be OK (if I sign the same object with the Microsoft .NET class for XML Signature and the same keys, I can import this card to CardSpace)

- When I verify the Apache xmlsec-generated signature with the Microsoft .NET class for XML Signature, I get a valid with the directive "preserveWhitespace(true)" and a not valid with the directive "preserveWhitespace(false)"

- When comparing the Apache xmlsec and Microsoft .NET-signed objects by a diff, I just recognize line breaks in the signature value and the certificate as well as the representation of empty elements as differences. But that should not make a difference in my opinion. A sample of my signature object is attached at the bottom of this message.

Does somebody have suggestions on what I should change - on the side of signature creation and/or some configuration setting at the side of the client?

Best regards,

Oliver

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">

<SignedInfo>

<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>

<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>

<Reference URI="#_Object_InfoCard">

<Transforms>

<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>

</Transforms>

<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>

<DigestValue>/+xfgW9+5HQz4jxphHSowyu29eo=</DigestValue>

</Reference>

</SignedInfo>

<SignatureValue>

gKE4vZ3FMF6v0+ociWL0ZuHgBmYYE8hrvTBkasP7hc7f0igFHtONF0/1jHL16xVfrq7nUFfv7MLE

H24EwpHgz3Go33/4KtV9dtF30iDP3EAx8YNLuAObMrnMtRXR2SYby7rpcQZQObQeOdpAcwdtYaCa

HgTpqwrWEih6L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z6V1CdiY094BFaiX9+HFead+rWbIzQjfmKabinFOveek+qbHq5Vw

hHbB9zY3V8QumTytrY8eBlBlWV1ePuLT0EPbv73CWjV+zi9NA3gdgVsCd23gR/k005peP4y+sNwS

3SKlFQCrobgDSPl7

</X509Certificate>

</X509Data>

</KeyInfo>

<Object Id="_Object_InfoCard"><InformationCard xmlns="http://schemas.microsoft.com/ws/2005/05/identity" xml:lang="en-us"><!-- omitted since that child element should not cause the problem--></InformationCard></Object>

</Signature>

[4785 byte] By [OlliP] at [2008-2-5]
# 1

Could you send me your .CRD file, I'll see what I can dig up.

garretts at microsoft.com

g


Garrett Serack | Program Manager |Federated Identity Team | Microsoft Corporation
blog:http://blogs.msdn.com/garretts

GarrettSerack-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 2
I'm having the exact same issue. Did you ever make any progress? Any tips on how to resolve this would be greatly apprciated
cmort at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 3

I put it aside for a while - the problem was not really blocking other work in the last days.

I'll pick up the issue soon and plan to test-drive other XML Security toolkits since the issue seems to be related to the string-encoding of the ds:Signature element and I want to avoid diving into the internals of the Apache XML security toolkit.

I'll let you know, when I have some progress.

Oliver

OlliP at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 4
Let me know if there is any way I can assist or we can collaborate. I'm using my own DSIG impl rather than apache, so it sounds like there might be a generalized issue here...
cmort at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 5

Sorry, I got backlogged this last couple of weeks. RTM comes waaaaay to fast somedays :D

I'll see if I can spare some time to get back in and look at this--although, we should probably try it on RC1 bits--there is a breaking change or two in the card format, there may be other fixes too.

g


Garrett Serack | Program Manager |Federated Identity Team | Microsoft Corporation
blog:http://blogs.msdn.com/garretts

GarrettSerack-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 6
My problem turned out to be the format of my Object Id attribute. Looks like yours is Ok, so we must have similar but different issues.

Mine are working now - good luck on yours and let me know if I can help

cmort at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 7

I think I found the issue resp. a workaround for it today: by chance I realized that removing the CRLF between </Object> and </Signature> changes things: by removing this specific CRLF from the XML signature document the resulting card is accepted by CardSpace (holds for the July CTP and RC-1). I.e. the issue is related to CRLFs placed into the XML Signature element and particular the described one.

OlliP at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...

Software Development for Windows Vista

Site Classified