On Wed, May 27, 2009 at 11:03:24PM +0200, s.ferey wrote:
> Joao Pedro a écrit :
> >
> >Ouch, my bad. I've just re-read the JC API and, indeed, the JVM should 
> >throw an APDUException.ILLEGAL_USE exception - the weird part is that 
> >I've been using the Muscle applet with the extended APDU patch for a 
> >couple of months now, with absolutely no issues. I use it to login on OS 
> >X, sign emails, use ssh, etc., on a daily basis...
> 
> It can work or not, it always safer to use setIncomingAndReceive first.
> 
> SUN states that (for getIncomingLength):
> "This method can be invoked whenever inbound data processing
> methods can be invoked ..."
> 
> meaning when NO (inbound) method is already invoked but simply
> can be invoked.
> 
> and then:
> "throws APDUException.ILLEGAL_USE if setIncomingAndReceive() not called"
> 
> these 2 points are not consistent, badly some platforms conform to
> the 2nd point.
> 

>From what I have read in recent days, could the difference be in
the low level protocol between card and reader?, specifically, I
suspecte that some variants (maybe those based on T=0, maybe
others) might not make the Lc field (and its size: 1 vs. 3)
available in the APDU buffer until after setIncomingAndReceive()
waits for that field to arrive from the reader.

There is also the issue that the APDU format begins identically
for an APDU with Lc!=0 and for an APDU with Lc=0 Le!=0.  Some APDU
documents even suggest that the APDU ends before the Lc/Le field
if both are semantically 0 (not to be confused with 256d encoded
as 00 or 65536d encoded as 00 00 00)

Just a wild guess though...

-- 
This message is hastily written, please ignore any unpleasant wordings,
do not consider it a binding commitment, even if its phrasing may
indicate so. Its contents may be deliberately or accidentally untrue.
Trademarks and other things belong to their owners, if any.
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to