diff options
author | Eric Caruso <ejcaruso@chromium.org> | 2021-05-04 13:38:57 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-05-05 18:51:08 +0000 |
commit | ba0701b67d3fc2e6936477bd08440ff36a3878aa (patch) | |
tree | 68ceeefcfd3abf5d632ae5078d0ad20baa9eb0d1 /src | |
parent | 27c43075f9ee30ac2cdbeb4e166e8dcf02b09e79 (diff) |
mm-shared-qmi: parse ICCID as hex instead of BCD
Fixes issue 364.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-shared-qmi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c index 695ca341..35911713 100644 --- a/src/mm-shared-qmi.c +++ b/src/mm-shared-qmi.c @@ -3308,8 +3308,10 @@ uim_get_slot_status_ready (QmiClientUim *client, continue; } - raw_iccid = mm_bcd_to_string ((const guint8 *)slot_status->iccid->data, slot_status->iccid->len, - TRUE /* low_nybble_first */); + /* This is supposed to be BCD, but some carriers have non-spec-compliant ICCIDs that use + * A-F characters as part of the operator-specific part of the ICCID. Parse it as hex and + * let mm_3gpp_parse_iccid take care of handling the A-F characters properly. */ + raw_iccid = mm_utils_bin2hexstr ((const guint8 *)slot_status->iccid->data, slot_status->iccid->len); if (!raw_iccid) { mm_obj_warn (self, "not creating SIM object: failed to convert ICCID from BCD"); g_ptr_array_add (ctx->sim_slots, NULL); |