From 134f41f5d13329ca8c8d6fa59600b36ad7f24980 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 26 Feb 2020 10:57:07 +0100 Subject: [PATCH] Invalidate TMSI, P-TMSI after changing IMSI Now the ME doesn't try to send the TMSI anymore in the next Location Updating Request, it directly sends the IMSI. --- sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java b/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java index d876dca..79e8edb 100755 --- a/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java +++ b/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java @@ -210,6 +210,8 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst mi = MobileIdentity.str2mi(newIMSI_str, MobileIdentity.MI_IMSI, (byte)9); writeIMSI(mi); showMsg(changed); + invalidateTMSI((short)SIMView.FID_EF_LOCI); + invalidateTMSI((short)SIMView.FID_EF_LOCIGPRS); refreshIMSI(); } catch (Exception e) { showError((short)42); @@ -234,6 +236,14 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst gsmFile.updateBinary((short)0, mi, (short)0, (short)mi.length); } + private void invalidateTMSI(short fid) + { + byte[] TMSI = {(byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff}; + gsmFile.select((short) SIMView.FID_DF_GSM); + gsmFile.select(fid); + gsmFile.updateBinary((short)0, TMSI, (short)0, (short)TMSI.length); + } + /* * - command qualifiers for REFRESH, * ETSI TS 101 267 / 3GPP TS 11.14 chapter 12.6 "Command details":