Oops, you're right I missed that. I have updated it to use the length of
the namespaces array, please check it.

BTW, do you have some sample signed SAML messages that I can add to our
test suite to test that it finds the Ids correctly?

--Sean

Brent Putman wrote:
>> The IdResolver should be modified to include this namespace URI in the array 
>> at
>> line 164, and the code at line 266 should be updated to differentiate the 2
>> namespaces.
>>
>>   
> 
> Thanks for looking at this.   With the above, I didn't mean to imply
> those line references were the *only* things that needed to be changed,
> however.  I think (unfortunately) there are some hardcoded assumptions
> about the length of that 'namespaces' array in the code between those
> two line references.  It's a bit hard for me to grok what the code is
> trying to do, it's a bit convoluted, but:  Isn't the idea essentially
> that after the call to getEl() in getElementBySearching() the 'Element
> [] els' array contains the resolved element in the slot (index) that
> corresponds to the same index in the namespace array for the namespace
> from which the ID attribute came?  And the 'els' array is one slot
> larger than the namespaces array, so that the last slot just means "no
> namespace" (happens if the attribute local name is just "ID" , or  "Id"
> or "id",  with some exceptions for  namespace-qualified attribs that use
> those).
> 
> If so, then the code is now a little off - the array size references
> need to be incremented, or even better, changed to be relative to the
> length of the namespaces array (actually visible as static List
> 'names').  Or something along those lines.
> 
> See for example:
> 
> Line 176          Element []els=new Element[6];
> 
> Line 230         elementIndex=(elementIndex<0) ? 5 : elementIndex;
> 
> Line 236             index=(index<0) ? 5 : index;
> 
> Line 250                         index=5;
> 
> Line 256                     index=5;
> 
> 
> The namespaces array did have length 5, now it has length 6  - so the
> "no namespace" slot in the 'els' array (which should now have length 7)
> would now be 6 , not 5.  Again, it would seem to me to be better to make
> this all relative to the size of the namespaces array in the first
> place, not absolute.
> 
> Those are just the things I see.  I'm not completely clear on the search
> algorithm, so don't take my word for it.
> 
> Thanks,
> Brent

Reply via email to