Attention is currently required from: Hoernchen.
dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43552?usp=email )
Change subject: GP: only send a GET STATUS tag list to cards that support it
......................................................................
Patch Set 2: Code-Review+1
(2 comments)
Patchset:
PS2:
I am not entirely through yet, however, my first impression is that this should be ok.
File pySim/global_platform/__init__.py:
https://gerrit.osmocom.org/c/pysim/+/43552/comment/16a4ddd2_5984ac9c?usp=em… :
PS2, Line 805: self._gp_version = decode_gp_version(h2b(data))
maybe logging the gp_version?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43552?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: I74cd2bd47617d616bede6453397f544cde5abcb7
Gerrit-Change-Number: 43552
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 17 Sep 2026 14:06:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: Hoernchen.
dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43551?usp=email )
Change subject: transport: stop the T=0 layer from breaking GP 6310
......................................................................
Patch Set 2: Code-Review+1
(6 comments)
Patchset:
PS2:
From what I can see, the logic is ok, a few spec references and other minor issues might be checked back. Through the unit-tests I only looked through very briefly, but they look comprehensive.
Commit Message:
https://gerrit.osmocom.org/c/pysim/+/43551/comment/7b4556e9_7f09fd2c?usp=em… :
PS2, Line 15: That is not "redundant", as per GP CS v2.3 section 11.4.3.1 the
I think we normally refer to the "GlobalPlatform Card
Specification" as "GPC" (they haven't given themselves an official abbreviation - at least not that I heard of...)
File pySim/global_platform/__init__.py:
https://gerrit.osmocom.org/c/pysim/+/43551/comment/aadecb3a_ec057098?usp=em… :
PS2, Line 740: p2 = 0x02 # TLV format according to Table 11-36
maybe reference as GPC, section 11.4.3.1, table 11-36. I mention this since at the very beginning of that section they explain the meaning of the 0x02 (bit 2 set in P2)
https://gerrit.osmocom.org/c/pysim/+/43551/comment/1328ed5e_82b2533d?usp=em… :
PS2, Line 751: raise SwMatchError(sw, '9000/6310')
I would recommend to check this back. When I look at the apidoc in exceptions.py:SwMatchError, the sw_expected is defined as a string with 4 hex digits.
I have also looked further. When using SwMatchError like this, nothing catastrophic happens. It just prints it out, but its clearly not how the inventors of SwMatchError originally thought.
I would recommend to revisit the sw_expected parameter. Maybe we can have a variable parameter here that can be a 4 digit hex-string or a list with multiple 4 digit hex-strings. Then you would call:
```
raise SwMatchError(sw, ['9000', '6310'])
```
I think this would be much cleaner and future-proof.
https://gerrit.osmocom.org/c/pysim/+/43551/comment/d5913610_e98cff9f?usp=em… :
PS2, Line 760: # GPC CardSpec v2.3, section 11.4.3.1, 6310 == additional matches.
As it seems the spec ref is wrong. As far as I understand, the following is correct:
GPC, section 11.4.2.2, table 11-34
I wonder if we have to keep the state of bit 2 for the "Get next occurrence(s)"? Section 11.4.2.2 also mentions that bit 2 is deprecated. I would recommend to check this back.
I haven't found the spec version 2.3, I used 2.3.1 instead, but that should be close enough.
File pySim/transport/__init__.py:
https://gerrit.osmocom.org/c/pysim/+/43551/comment/9d1f91d5_bd743594?usp=em… :
PS2, Line 344: # makes the card answer 6982 and tears down the whole SCP session and following commands fail with 6985.
I always had difficulties to understand what ETSI TS 102 221, section 7.3.1.1.4, step 4b describes, but here is what I understand now:
We come from step 3b, and are in 3b. We send the dummy GET RESPONSE as described and we continue with step 5. Never come back, so we never send a dummy GET RESPONSE again. (all the other if statements either break or set le_gr to a length value)
So I think that your fix is correct.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43551?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: I10f8afa8dd5623a49a6a0e7132607b3a1fad2d8c
Gerrit-Change-Number: 43551
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 17 Sep 2026 13:26:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
dexter has submitted this change. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43437?usp=email )
Change subject: libipa: remove non spec compliant user consent callback
......................................................................
libipa: remove non spec compliant user consent callback
libipa allows to pass a callback via its configuration struct.
This callback is executed before the profile installation and
may be used to prompt the user to consent to the profile
download.
This is technically a feature that is exclusive to SGP.22.
It is not applicable to SGP.32, so let's remove it.
Related: OS#8100
Change-Id: I1882890a5c1c74be1243d9649117ba7220c271d6
---
M include/onomondo/ipa/ipad.h
M src/ipa/libipa/proc_indirect_prfle_dwnld.c
M src/ipa/libipa/proc_prfle_dwnld.c
M src/ipa/main.c
4 files changed, 0 insertions(+), 40 deletions(-)
Approvals:
Jenkins Builder: Verified
jolly: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/onomondo/ipa/ipad.h b/include/onomondo/ipa/ipad.h
index eafcee4..77a66df 100644
--- a/include/onomondo/ipa/ipad.h
+++ b/include/onomondo/ipa/ipad.h
@@ -16,9 +16,6 @@
struct ipa_context;
struct ipa_buf;
-/* (deprecated, see github issue #5) */
-typedef bool (*ipa_prfle_inst_consent_cb)(char *sm_dp_plus_address, char *ac_token);
-
enum ipa_poll_rc {
/*! The API user shall call ipa_poll() again immediately.
* (there may be still eIM packages waiting to be executed). */
@@ -81,12 +78,6 @@
* consumer eUICC appears as an IoT eUICC on procedure level. */
bool iot_euicc_emu_enabled;
- /*! (deprecated, see github issue #5) Consent to profile installation.
- * SGP.32 requires to prompt the user to consent to a profile installation. The API user may pass a callback
- * function here to handle the consent request. In case no callback function is provided onomondo-eim will
- * automatically consent to any profile installation. */
- ipa_prfle_inst_consent_cb prfle_inst_consent_cb;
-
/*! Set the Device Capabilities.
* As IPAd need to set the device capabilities, it overwrites any other capabilities that might have set by
* the modem or IoT device. The upper 5 bits can be set according to section 3.4.2 of SGG.22. The lower 3
diff --git a/src/ipa/libipa/proc_indirect_prfle_dwnld.c b/src/ipa/libipa/proc_indirect_prfle_dwnld.c
index 016e9a8..9b233d3 100644
--- a/src/ipa/libipa/proc_indirect_prfle_dwnld.c
+++ b/src/ipa/libipa/proc_indirect_prfle_dwnld.c
@@ -65,7 +65,6 @@
/* TODO: Check if ProfileMetadata contains Profile Policy Rulses (PPRs) and apply the PPRs as configured on the
* eUICC. (This is an optional feature, which we currently do not support, see also proc_euicc_data_req.c) */
- /* TODO: remove this part as it is not required (see also github issue #5) */
/* Execute sub procedure: Sub-procedure Profile Download and Installation – Download Confirmation */
prfle_dwnlod_pars.auth_clnt_ok_dpe = auth_clnt_res->auth_clnt_ok_dpe;
get_bnd_prfle_pkg_res = ipa_proc_prfle_dwnlod(ctx, &prfle_dwnlod_pars);
@@ -77,17 +76,6 @@
goto error;
}
- /* At this point we must ask the user for consent before we proceed with the profile installation. In case the
- * user does not consent, we must abort by calling the common cancel session procedure. */
- if (ctx->cfg->prfle_inst_consent_cb
- && !ctx->cfg->prfle_inst_consent_cb(activation_code->sm_dp_plus_address, activation_code->ac_token)) {
- IPA_LOGP(SIPA, LERROR, "no end user consent for profile installation -- canceling session!\n");
- cmn_cancel_sess_pars.reason = CancelSessionReason_endUserRejection;
- cmn_cancel_sess_pars.transaction_id = *auth_clnt_res->transaction_id;
- ipa_proc_cmn_cancel_sess(ctx, &cmn_cancel_sess_pars);
- goto error;
- }
-
/* Execute sub procedure: Sub-procedure Profile Installation (See also section 3.1.3.3 of SGP.22) */
prfle_inst_pars.bound_profile_package = &get_bnd_prfle_pkg_res->get_bnd_prfle_pkg_ok->boundProfilePackage;
if (ipa_proc_prfle_inst(ctx, &prfle_inst_pars) < 0) {
diff --git a/src/ipa/libipa/proc_prfle_dwnld.c b/src/ipa/libipa/proc_prfle_dwnld.c
index c30442c..f9c5176 100644
--- a/src/ipa/libipa/proc_prfle_dwnld.c
+++ b/src/ipa/libipa/proc_prfle_dwnld.c
@@ -8,8 +8,6 @@
* See also: GSMA SGP.22, section 3.1.3.2: Sub-procedure Profile Download and Installation – Download Confirmation
*/
-/* TODO: fix spec reference, see github issue #5 */
-
#include <stdio.h>
#include <assert.h>
#include <string.h>
diff --git a/src/ipa/main.c b/src/ipa/main.c
index bf2e386..2b15d9b 100644
--- a/src/ipa/main.c
+++ b/src/ipa/main.c
@@ -37,19 +37,6 @@
bool running = true;
-bool prfle_inst_consent(char *sm_dp_plus_address, char *ac_token)
-{
- char user_input;
- printf("PLEASE CONSENT TO PROFILE INSTALLATION:\n");
- printf("smdp+: %s\n", sm_dp_plus_address);
- printf("ac-token: %s\n", ac_token);
- printf("Consent (Y/N)? ");
- user_input = getchar();
- if (user_input == 'Y' || user_input == 'y')
- return true;
- return false;
-}
-
static void print_help(const char *prog_name)
{
printf("Usage: %s [OPTIONS] [OPERATION]\n", prog_name);
@@ -63,7 +50,6 @@
printf(" -n PATH ..................... path to nvstate file (default: %s)\n", DEFAULT_NVSTATE_PATH);
printf(" -y NUM ...................... number of retries for ESipa requests (default: %u)\n",
DEFAULT_ESIPA_REQ_RETRIES);
- printf(" -a .......................... ask end user for consent\n");
printf(" -C .......................... CA (Certificate Authority) Bundle file\n");
printf(" -S .......................... disable HTTPS\n");
printf(" -I .......................... disable SSL certificate verification (insecure)\n");
@@ -222,9 +208,6 @@
case 'y':
cfg.esipa_req_retries = atoi(optarg);
break;
- case 'a':
- cfg.prfle_inst_consent_cb = prfle_inst_consent;
- break;
case '1':
getopt_one_euicc_pkg_only = true;
break;
--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43437?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: onomondo-ipa
Gerrit-Branch: master
Gerrit-Change-Id: I1882890a5c1c74be1243d9649117ba7220c271d6
Gerrit-Change-Number: 43437
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Attention is currently required from: dexter, laforge.
Hello Jenkins Builder, jolly, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/onomondo-ipa/+/43438?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified+1 by Jenkins Builder
Change subject: proc_indirect_prfle_dwnld: refactor module, fix spec references
......................................................................
proc_indirect_prfle_dwnld: refactor module, fix spec references
The Indirect Profile Download Procedure uses incorrect spec
references. As it seems it was a bit mixed up with the Direct
Profile Download Procedure, which is very similar, but not
identical.
With this patch we:
- Move the steps from proc_prfle_dwnld.c into
proc_indirect_prfle_dwnld.c
- restructure the code
- Fix the incorrect spec references
- Refactor the error handling (session cancellation)
- Add TODOs for parts that are still missing
Related: SYS#8101
Change-Id: I69571280c7b52f2cb09f733bc0466cb77c0d2590
---
M src/ipa/libipa/CMakeLists.txt
M src/ipa/libipa/proc_cmn_mtl_auth.c
M src/ipa/libipa/proc_indirect_prfle_dwnld.c
D src/ipa/libipa/proc_prfle_dwnld.c
D src/ipa/libipa/proc_prfle_dwnld.h
5 files changed, 64 insertions(+), 122 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/38/43438/3
--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43438?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: onomondo-ipa
Gerrit-Branch: master
Gerrit-Change-Id: I69571280c7b52f2cb09f733bc0466cb77c0d2590
Gerrit-Change-Number: 43438
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>