Exception while unmarshalling Integer with an element bigger than 32-bit
Brent Putman
putmanb at georgetown.edu
Wed Jun 6 21:26:47 BST 2012
On 6/6/12 3:17 PM, Cantor, Scott wrote:
> It's also generally something to avoid in XSD anyway. I didn't think we
> used it much in SAML, but I have no doubt it's in there somewhere by
> accident.
>
> We might be able to clean that up a bit in a revision to at least limit
> implementation-required support ranges, much as XSD does anyway.
Looks like the only place SAML 2 uses it is in some authN context
schemas and we don't even implement those as XMLObject. SAML 1 used it
for the Major- and MinorVersion attributes.
Otherwise it's used in few places in the XML signature and encryption
schemas. Interestingly one of them is X509SerialNumber and I have a
note that the Java X509Certificate interface actually exposes that via
BigInteger and so to be consistent we wound up special casing our
X509SerialNumber interface to use BigInteger also, rather than
inheriting from XSInteger.
(Just noticed we also have some of those WS-Trust and WS-Security which
are inheriting from XSInteger but really shouldn't be, since they are
defined as xsd:unsignedInt. So technically those XMLObjects have the
wrong schema type.)
But I think the OP's problem IIUC was processing an Assertion with an
AttributeValue with an xsi:type of xsd:integer. That seems a legitimate
use case and we can't really know or impose any meaningful restrictions
there. I guess my originally suggested workaround could be fine there,
just use a different impl for xsd:integer. I suppose we could even
officially supply an alternate xsd:integer impl that uses Long or
BigInteger or something, for that purpose.
>
> You're not obligated as a conforming processor to handle infinite sizes.
> And in fact, handling that at one layer doesn¹t matter much if the parser
> blows up anyway.
Hmm, I guess I didn't really think of it that way. Obviously supporting
an "infinite" size is literally impossible, but I would assume that the
existence of xsd:integer implies or assumes common support for values
larger than say a long/64-bits?
More information about the users
mailing list