Friday, September 25, 2015

#511 (javax.smartcardio.CardException : list() failed)

I did some research on #511.

It is a Java message (an error inside the applet) and I have no stacktrace. But even without stacktrace I guess that it happens in the following code (in my file EIDReader.java):

public static boolean matchesEidAtr(ATR atr) { // from eid-applet-core...PcscEid.java
        byte[] atrBytes = atr.getBytes();
        if (atrBytes.length != ATR_PATTERN.length) {
                return false;
        }
        for (int idx = 0; idx < atrBytes.length; idx++) {
                atrBytes[idx] &= ATR_MASK[idx];
        }
        if (Arrays.equals(atrBytes, ATR_PATTERN)) {
                return true;
        }
        return false;
}

This guess is enfoced by a message on http://eid.belgium.be which says

Afin de pouvoir utiliser facilement la dernière génération de l’eID, veuillez télécharger la dernière version du logiciel ici.

And by a document Importantes modifications apportées aux documents d’identité belges (dated 2013-06-17).

And also by the release notes at eid.belgium.be which state that Middleware 4.1.3 “added support for new foreigner cards”. Unfortunately I could not find any source which tells me when that version 4.1.3 was released. They had a bulletin with announcements but this stopped at version 4.0.6 (2013-12-13).

So there is no proof. It is possible that there have not been any more changes after 2013. I started eidreader in 2013 because of these new foreigner eid cards. TIM cannot read them, but eidreader can.

The eid.belgium.be site seems poorly maintained in general. They provide an eId Developers Guide but this document has no date and seems to be obsolete.

One page Développer des applications eID states:

C’est également la raison pour laquelle Fedict donne à chacun l’opportunité de développer sa propre application eID. Avec les fondements eID, les éléments de base pour des applications eID sont mis à la disposition de tous les développeurs. Dans ce cadre, peu importe que vous travailliez pour une administration, pour une entreprise privée ou que vous souhaitiez développer une application comme simple particulier.

Which is encouraging, but leads only to another page Fondements eID which links to the eId Applet without explanation.

None of the downloadable source files contains above java code.

I still do not understand how the eid applet is integrated into the general concept. But it seems that it is used and even maintained. Of course no longer on code.google.com (as they say). It seems that I found it on GitHub.

There I found the file PcscEid.java from which I had copied above code snippet two years ago. And hoped that this code has changed. But it hasn’t.

I am stuck… how to continue?

  • Wait until the customer has a new case, and then capture the stacktrace and see where the error occurs
  • Buy a testkit in the hope of reproducing the problem.

Miscellaneous

Received and fixed #551. This is in lino_welfare.modlib.pcsw.models. En passant I changed the name from setup_workflows to setup_client_workflow and added the decorator to register it as receiver for pre_analyze. Because naming it setup_workflows is an old automagic way that should get deprecated. Added comment to docstring of on_each_app.

For some reason I ignore there was a build failure on Travis and Drone (error message RuntimeError: The babel data files are not available. This usually happens because you are using a source checkout from Babel and you did not build the data files.  Just make sure to run "python setup.py import_cldr" before installing the library.) Maybe a temporary server outage caused the import_cldr to fail?

Received and fixed #552. lino.utils.html2rst now supports <img> tags. Modified Exporting to Excel so that this case is covered.