laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/40936?usp=email )
Change subject: contrib: add a tool to parse the SIMA response from an eUICC
......................................................................
contrib: add a tool to parse the SIMA response from an eUICC
When an eUICC performs a profile installation it returns a (concatenated)
series of ASN.1 encoded strings as "simaResponse". In case the profile
installation fails for some reason the simaResponse contains diagnostic
information to diagnose why the profile installation failed.
Unfortunately there are currently no practical tools available to decode
and display the information in the simaResponse. Let's add a tool for that.
Related SYS#7617
Change-Id: Ida4c3c5446653b283a3869c0c387f328ae51e55e
---
A contrib/analyze_simaResponse.py
1 file changed, 112 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/contrib/analyze_simaResponse.py b/contrib/analyze_simaResponse.py
new file mode 100755
index 0000000..170597d
--- /dev/null
+++ b/contrib/analyze_simaResponse.py
@@ -0,0 +1,112 @@
+#!/usr/bin/env python3
+
+# A tool to analyze the eUICC simaResponse (series of EUICCResponse)
+#
+# (C) 2025 by sysmocom - s.f.m.c. GmbH
+# All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+import argparse
+from osmocom.utils import h2b, b2h
+from osmocom.tlv import bertlv_parse_one, bertlv_encode_tag, bertlv_encode_len
+from pySim.esim.saip import *
+
+parser = argparse.ArgumentParser(description="""Utility program to analyze the contents of an eUICC simaResponse.""")
+parser.add_argument('SIMA_RESPONSE', help='Hexstring containing the simaResponse as received from the eUICC')
+
+def split_sima_response(sima_response):
+ """split an eUICC simaResponse field into a list of EUICCResponse fields"""
+
+ remainder = sima_response
+ result = []
+ while len(remainder):
+ tdict, l, v, next_remainder = bertlv_parse_one(remainder)
+ rawtag = bertlv_encode_tag(tdict)
+ rawlen = bertlv_encode_len(l)
+ result = result + [remainder[0:len(rawtag) + len(rawlen) + l]]
+ remainder = next_remainder
+ return result
+
+def analyze_status(status):
+ """
+ Convert a status code (integer) into a human readable string
+ (see eUICC Profile Package: Interoperable Format Technical Specification, section 8.11)
+ """
+
+ # SIMA status codes
+ string_values = {0 : 'ok',
+ 1 : 'pe-not-supported',
+ 2 : 'memory-failure',
+ 3 : 'bad-values',
+ 4 : 'not-enough-memory',
+ 5 : 'invalid-request-format',
+ 6 : 'invalid-parameter',
+ 7 : 'runtime-not-supported',
+ 8 : 'lib-not-supported',
+ 9 : 'template-not-supported ',
+ 10 : 'feature-not-supported',
+ 11 : 'pin-code-missing',
+ 31 : 'unsupported-profile-version'}
+
+ string_value = string_values.get(status, None)
+ if string_value is not None:
+ return "%d = %s (SIMA status code)" % (status, string_value)
+
+ # ISO 7816 status words
+ if status >= 24576 and status <= 28671:
+ return "%d = %04x (ISO7816 status word)" % (status, status)
+ elif status >= 36864 and status <= 40959:
+ return "%d = %04x (ISO7816 status word)" % (status, status)
+
+ # Proprietary status codes
+ elif status >= 40960 and status <= 65535:
+ return "%d = %04x (proprietary)" % (status, status)
+
+ # Unknown status codes
+ return "%d (unknown, proprietary?)" % status
+
+def analyze_euicc_response(euicc_response):
+ """Analyze and display the contents of an EUICCResponse"""
+
+ print(" EUICCResponse: %s" % b2h(euicc_response))
+ euicc_response_decoded = asn1.decode('EUICCResponse', euicc_response)
+
+ pe_status = euicc_response_decoded.get('peStatus')
+ print(" peStatus:")
+ for s in pe_status:
+ print(" status: %s" % analyze_status(s.get('status')))
+ print(" identification: %s" % str(s.get('identification', None)))
+ print(" additional-information: %s" % str(s.get('additional-information', None)))
+ print(" offset: %s" % str(s.get('offset', None)))
+
+ if euicc_response_decoded.get('profileInstallationAborted', False) is None:
+ # This type is defined as profileInstallationAborted NULL OPTIONAL, so when it is present it
+ # will have the value None, otherwise it is simply not present.
+ print(" profileInstallationAborted: True")
+ else:
+ print(" profileInstallationAborted: False")
+
+ status_message = euicc_response_decoded.get('statusMessage', None)
+ print(" statusMessage: %s" % str(status_message))
+
+if __name__ == '__main__':
+ opts = parser.parse_args()
+ sima_response = h2b(opts.SIMA_RESPONSE);
+
+ print("simaResponse: %s" % b2h(sima_response))
+ euicc_response_list = split_sima_response(sima_response)
+
+ for euicc_response in euicc_response_list:
+ analyze_euicc_response(euicc_response)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40936?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c3c5446653b283a3869c0c387f328ae51e55e
Gerrit-Change-Number: 40936
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Attention is currently required from: dexter, osmith.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/40936?usp=email )
Change subject: contrib: add a tool to parse the SIMA response from an eUICC
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40936?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c3c5446653b283a3869c0c387f328ae51e55e
Gerrit-Change-Number: 40936
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jan 2026 21:41:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria.
laforge has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41764?usp=email )
Change subject: s1gw: add MME pool related REST definitions
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41764?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I76f1a5cf41331d021c08fbefdf78e34da4ac2121
Gerrit-Change-Number: 41764
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jan 2026 21:40:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41749?usp=email )
Change subject: hnbgw: set different mgcp_params ports and ids for each subscriber
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41749?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I32f644038d7e29b261ba3852583170a63544dae5
Gerrit-Change-Number: 41749
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jan 2026 21:39:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/41750?usp=email )
Change subject: trau_frame cosmetic: rm dead/invalid definitions
......................................................................
trau_frame cosmetic: rm dead/invalid definitions
All 3 module-internal C preprocessor definitions removed here have
never been used, and it is not clear where or how they were ever
intended to be used. (The present trau_frame layer is concerned with
low-level de/encoding; high-level de/encoding of AMR frames happens in
the new AMR TRAU frame interworking facility.) Furthermore, one of
these never-used preprocessor definitions expands to invalid C code.
Remove the bogon.
Change-Id: Icd96220455888ec5e1d03402b750da6945aaf095
---
M src/trau/trau_frame.c
1 file changed, 0 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c
index d8541c5..c5f234f 100644
--- a/src/trau/trau_frame.c
+++ b/src/trau/trau_frame.c
@@ -1640,10 +1640,6 @@
}
}
-#define TRAU8_FT_AMR_NO_SPEECH_CMI 0x10 /* 1, 0, 0, 0, 0 */
-#define TRAU8_FT_AMR_NO_SPEECH_CMR 0x14 /* 1, 0, 1, 0, 0 */
-#define TRAU8_FT_AMR_475_515_590 0..7
-
static const uint8_t bit8_0[8] = { 0, };
/*!< check sync pattern for hr/data/oam */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/41750?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Icd96220455888ec5e1d03402b750da6945aaf095
Gerrit-Change-Number: 41750
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>