From 8e0fccdbf361e045f0f13c63a0f79cf52c134f6f Mon Sep 17 00:00:00 2001 From: Supreeth Herle Date: Mon, 23 Mar 2020 12:10:56 +0100 Subject: sysmoISIM-SJA2: Add support for programming Home ePDG Identifier Example: ./pySim-prog.py -p 0 -x 001 -y 01 -s 8988211900000000004 -i 001011234567895 \ -k 8baf473f2f8fd09487cccbd7097c6862 --op 11111111111111111111111111111111 \ -o 8E27B6AF0E692E750F32667A3B14605D -a 85524953 -n isim.test \ --msisdn 0598765432100 --epdgid epdg.epc.mnc001.mcc001.pub.3gppnetwork.org Note: 1. For Operator Identifier based ePDG FQDN must be in the format epdg.epc.mnc.mcc.pub.3gppnetwork.org 2. For Tracking/Location Area Identity based ePDG FQDN must be in format lac.epdg.epc.mnc.mcc.pub.3gppnetwork.org and tac-lb.tac-hb.tac.epdg.epc.mnc.mcc.pub.3gppnetwork.org and 3. For 5GS Tracking Area Identity based ePDG FQDN using a 3 octet TAC tac-lb.tac-mb.tac-hb.5gstac. epdg.epc.mnc.mcc.pub.3gppnetwork.org Change-Id: Ia00bfea36c50b6a38a5387d2f8147f25c81b1de4 --- pySim-prog.py | 4 ++++ pySim/cards.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/pySim-prog.py b/pySim-prog.py index 601f980..8547573 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -147,6 +147,9 @@ def parse_options(): parser.add_option("--acc", dest="acc", help="Set ACC bits (Access Control Code). not all card types are supported", ) + parser.add_option("--epdgid", dest="epdgid", + help="Set Home Evolved Packet Data Gateway (ePDG) Identifier. (Only FQDN format supported)", + ) parser.add_option("--read-imsi", dest="read_imsi", action="store_true", help="Read the IMSI from the CARD", default=False ) @@ -442,6 +445,7 @@ def gen_parameters(opts): 'acc' : acc, 'pin_adm' : pin_adm, 'msisdn' : opts.msisdn, + 'epdgid' : opts.epdgid, } diff --git a/pySim/cards.py b/pySim/cards.py index eeeae82..8835cc9 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -1160,6 +1160,15 @@ class SysmoISIMSJA2(UsimCard): sw = self.update_ehplmn(p['mcc'], p['mnc']) if sw != '9000': print("Programming EHPLMN failed with code %s"%sw) + + # update EF.ePDGId in ADF.USIM + if self.file_exists(EF_USIM_ADF_map['ePDGId']): + if p.get('epdgid'): + sw = self._scc.update_binary( + EF_USIM_ADF_map['ePDGId'], enc_epdgid(p['epdgid'])) + if sw != '9000': + print("Programming ePDGId failed with code %s"%sw) + return -- cgit v1.2.3