New format for applet selection.

AID comparison is performed by the kernel. If it is the same as previously loaded, do nothing. If not found, do nothing. If found and is different, unload old and load the new one.

All other applets shall be migrated to new format.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-10-11 21:02:04 +02:00
parent dbfb89f959
commit eef2f190f2
4 changed files with 20 additions and 13 deletions

View File

@@ -113,9 +113,10 @@ app_t *current_app = NULL;
const uint8_t *ccid_atr = NULL;
int register_app(app_t *(*select_aid)(app_t *, const uint8_t *, uint8_t)) {
int register_app(int (*select_aid)(app_t *), const uint8_t *aid) {
if (num_apps < sizeof(apps) / sizeof(app_t)) {
apps[num_apps].select_aid = select_aid;
apps[num_apps].aid = aid;
num_apps++;
return 1;
}