From 823f3e7995a27d89524f07aee46c8efad246fbc7 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 3 Nov 2022 23:31:53 +0000 Subject: base-sim: fix length when reading GID1/GID2 We were attempting to read 15 bytes unconditionally, regardless of the size of the EF_gid1 and EF_gid2 files. This operation would succeed in some SIM cards even if the actual file lengths are shorter: AT+CRSM=176,28478,0,0,15 +CRSM: 144,0,"FFFF" OK But the operation would fail in some other SIM cards due to the length mismatch: AT+CRSM=176,28478,0,0,15 +CRSM: 103,0 OK Using 0 as requested length instructs the modem to read the length specified in the EF status information, which is also the same approach we do in QMI and MBIM. AT+CRSM=176,28478,0,0,0 +CRSM: 144,0,"FFFF" OK --- src/mm-base-sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mm-base-sim.c') diff --git a/src/mm-base-sim.c b/src/mm-base-sim.c index a641f6a4..f2e5a5ce 100644 --- a/src/mm-base-sim.c +++ b/src/mm-base-sim.c @@ -2349,7 +2349,7 @@ load_gid1 (MMBaseSim *self, /* READ BINARY of EFgid1 */ mm_base_modem_at_command ( self->priv->modem, - "+CRSM=176,28478,0,0,15", + "+CRSM=176,28478,0,0,0", 10, FALSE, (GAsyncReadyCallback)load_gid1_command_ready, @@ -2364,7 +2364,7 @@ load_gid2 (MMBaseSim *self, /* READ BINARY of EFgid2 */ mm_base_modem_at_command ( self->priv->modem, - "+CRSM=176,28479,0,0,15", + "+CRSM=176,28479,0,0,0", 10, FALSE, (GAsyncReadyCallback)load_gid2_command_ready, -- cgit v1.2.3-70-g09d2