mace-opensaml-users - Re: Sha2 signature info requested
Subject: OpenSAML user discussion
List archive
- From: Brent Putman <>
- To:
- Subject: Re: Sha2 signature info requested
- Date: Fri, 05 Oct 2007 19:51:06 -0400
Prasanna Krishna wrote: Hi Brent & SAML experts - All of that looks good to me. Should probably be said (obviously) that once the document is signed, you need to make sure that it isn't being modified in any way, intentionally or unintentionally, on the signer/sender side, like pretty print formatting, etc. From the below, that's clearly not your issue, just saying it for the record.
Yeah, that's pretty much what the Signer does, compute the cryptographic values as indicated by: http://www.w3.org/TR/xmldsig-core/#sec-CoreGeneration
Before they go any further, they should make sure they really understand the validation process straight from the source: http://www.w3.org/TR/xmldsig-core/#sec-CoreValidation So they really have to write their own signature validation code? Their platform/language/environment doesn't afford a known working XML Signature library that they can take advantage of? That could turn out to be a lot of work. That is perhaps an understatement. :-)
Again, the final word is the spec. They should really, really understand that in detail. The steps you list indicate that they are unclear on some of the basics... I'll make some comments, but what they are doing appears to be totally out-of-sync with the spec. They need to do some more homework. For one thing, SAML signatures are enclosed in the element that is signed and therefore must use the enveloped signature transform: http://www.w3.org/TR/xmldsig-core/#sec-EnvelopedSignature So they need to be excluding the entire ds:Signature element. More generally, you need to properly dereference the Reference URI and apply the indicated Transforms. The output of that process is what serves as the input to the Reference digest method algorithm.
There's really ultimately 2 canonicalizations going on: of the ds:SignedInfo (mandatory in all Signatures) and of the dereferenced target of the Reference (b/c SAML mandates the Exclusive C14N transform). So I'm not sure what they're doing, but sounds like it's probably incorrect either way...
Fine, except I think what they're using as the output (the hash algorithm input) here is totally out-of-whack with the spec. You can't just make stuff up.
Well, the spec clearly says that the comparisons should be made over the decoded octet (binary) values. Encodings aren't canonical in general (e.g. whitespace).
Those are just some obvious things I can see that are wrong. This is a very complex operation, esp. all the canonicalization and generalized transform stuff. There is a reason that there are entire libraries (e.g. Apache XML Security, what we use under the covers) devoted solely or mostly to signing and validation. Sounds like they are biting off a lot if they are planning on (re-)implementing one themselves.
No, not really. ds:KeyInfo is a child of ds:Signature and so (at least in the SAML case) is excluded from the Reference digest calc because of the mandatory enveloped signature transform. It's just a way (in the Signature use case at least) to convey validation key information, but it's only in an advisory way. You still have to establish trust of the key extracted or otherwise resolved from the KeyInfo. --Brent |
- Sha2 signature info requested, Prasanna Krishna, 10/02/2007
- Re: Sha2 signature info requested, Brent Putman, 10/02/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/02/2007
- Re: Sha2 signature info requested, Brent Putman, 10/02/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/03/2007
- RE: Sha2 signature info requested, Paul Hethmon, 10/03/2007
- RE: Sha2 signature info requested, Scott Cantor, 10/03/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/03/2007
- Notes on KeyInfoGenerator (was: RE: Sha2 signature info requested), Brent Putman, 10/03/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/05/2007
- Re: Sha2 signature info requested, Brent Putman, 10/05/2007
- RE: Sha2 signature info requested, Scott Cantor, 10/05/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/05/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/03/2007
- Re: Sha2 signature info requested, Brent Putman, 10/02/2007
- RE: Sha2 signature info requested, Prasanna Krishna, 10/02/2007
- Re: Sha2 signature info requested, Brent Putman, 10/02/2007
Archive powered by MHonArc 2.6.16.