From 1ae3093e7e8311bb210de7b9f761967ce4cf20c5 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Thu, 21 Sep 2023 17:53:39 +0200 Subject: [PATCH] egk-tool: fixed reading relative files adds compatibility with eGK 2.1 https://fachportal.gematik.de/fachportal-import/files/gemSpec_eGK_ObjSys_G2_1_V4.5.0.pdf fixes https://github.com/OpenSC/OpenSC/issues/2861 --- src/tools/egk-tool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/egk-tool.c b/src/tools/egk-tool.c index fd976efeb4..c00f0a4aab 100644 --- a/src/tools/egk-tool.c +++ b/src/tools/egk-tool.c @@ -177,7 +177,7 @@ main (int argc, char **argv) goto err; if (cmdline.pd_flag - && read_file(card, "D001", &data, &data_len) + && read_file(card, "iD001", &data, &data_len) && data_len >= 2) { size_t len_pd = (data[0] << 8) | data[1]; @@ -195,7 +195,7 @@ main (int argc, char **argv) } if ((cmdline.vd_flag || cmdline.gvd_flag) - && read_file(card, "D002", &data, &data_len) + && read_file(card, "iD002", &data, &data_len) && data_len >= 8) { size_t off_vd = (data[0] << 8) | data[1]; size_t end_vd = (data[2] << 8) | data[3]; @@ -230,7 +230,7 @@ main (int argc, char **argv) } if (cmdline.vsd_status_flag - && read_file(card, "D00C", &data, &data_len) + && read_file(card, "iD00C", &data, &data_len) && data_len >= 25) { char *status; unsigned int major, minor, fix;