Menu

#6 sdAID is null when loading cap file

open
nobody
None
5
2010-02-09
2010-02-09
Anonymous
No

My code:

private GlobalPlatformService setupGPS(Card card) throws Exception {
CardChannel channel = card.getBasicChannel();
GlobalPlatformService service = new GlobalPlatformService(channel);
service.addAPDUListener(service);
service.openWithDefaultKeys();
return service;
}

InputStream is = ... [cap file stream]

GlobalPlatformService service = setupGPS(card);

CapFile cap = new CapFile(is, null);

int loadSize = GlobalPlatformService.defaultLoadSize - 8;
service.loadCapFile(cap, false, false, loadSize, false, false);

AID p = cap.getPackageAID();
for (AID a : cap.getAppletAIDs()) {
service.installAndMakeSelecatable(p, a,
null, INSTALL_PRIV, INSTALL_PARAMS, null);
}

This winds up throwing an NPE in loadCapFile - the line bo.write(sdAID.getLength());

There is a path through open() that doesn't set sdAID.

This worked in the previous release.

Discussion

  • Nobody/Anonymous

    Reverting to version 14 of GlobalPlatformService fixed it.

     
  • Martin Paljak

    Martin Paljak - 2010-02-12

    This should be fixed in r17

     

Log in to post a comment.

MongoDB Logo MongoDB