Attention is currently required from: Hoernchen.
dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43172?usp=email )
Change subject: GP: LOAD/STORE DATA chunk size from SCP overhead
......................................................................
Patch Set 7: Code-Review+2 Verified+1
(4 comments)
Patchset:
PS7:
I have read through again and I couldn't spot any mistakes. I also have re-tested it by installing a java applet from pySim-shell with security level 3. Thanks for putting the spec references. Those helped me a lot with understanding the patch.
File pySim/global_platform/__init__.py:
https://gerrit.osmocom.org/c/pysim/+/43172/comment/7ba72859_8d1580c4?usp=em… :
PS7, Line 158: That legacy form is accepted when parsing, but never generated, which agrees with the spec"""
I have looked it up also. There is indeed a deviation from what we normally have in ASN.1 BER-TLV. This is the first time I hear about this indefinite form. I have never seen anything like that anywhere in the smartcard world. Its probably safe to say that it is not applicable to GP.
File pySim/global_platform/scp.py:
https://gerrit.osmocom.org/c/pysim/+/43172/comment/0af620a1_58645cca?usp=em… :
PS7, Line 252: # is formatted as described in Table 11-70: preceded by the actual length of the
In GlobalPlatform Card Specification 2.2.1, Table 11-70 is PUT KEY Error Conditions, in the Public Review v2.3.1.49 its Format of Key Component Block – Padding Present if Needed. So table references shift from version to version. Very distracting...
File tests/unittests/test_globalplatform.py:
https://gerrit.osmocom.org/c/pysim/+/43172/comment/5c809a3a_52cd03ba?usp=em… :
PS7, Line 385: # GP CardSpec v2.3.1 Section 11.8.2.3.1: all lengths ofPUT KEY are always BER TLV coded
missing space ("...length ofPUT KEY...")
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43172?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: Ic208f3959a38896f64fb6ccefb24cc360a3ac3a2
Gerrit-Change-Number: 43172
Gerrit-PatchSet: 7
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: Wed, 12 Aug 2026 14:45:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: laforge, pespin.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/simtrace2/+/43003?usp=email )
Change subject: firmware: Drop CEMU_TX_DATA when sim is in-active
......................................................................
Patch Set 6:
(1 comment)
File firmware/libcommon/source/card_emu.c:
https://gerrit.osmocom.org/c/simtrace2/+/43003/comment/7ba86d80_054de7bd?us… :
PS5, Line 218: /* if the card should enque messages */
> wording is slightly sub-optimal: A card itself (like an actual SIM) doesn't queue messages, right? […]
I changed the wording. If this is not fitting, please recommend a better name.
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43003?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I796e548225a742cddfde12bd6a60e4d2e5c04c8f
Gerrit-Change-Number: 43003
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Aug 2026 13:52:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: laforge, lynxis lazus.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/simtrace2/+/43141?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Code-Review+2 by laforge, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: cosmetic: fix typo in comment
......................................................................
cosmetic: fix typo in comment
Change-Id: I9647fd799839e1d7aa7ab9c118a2e51455536ce4
---
M host/lib/apdu_dispatch.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/41/43141/3
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43141?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I9647fd799839e1d7aa7ab9c118a2e51455536ce4
Gerrit-Change-Number: 43141
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Attention is currently required from: laforge, lynxis lazus, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/simtrace2/+/43003?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review+1 by pespin, Verified+1 by Jenkins Builder
Change subject: firmware: Drop CEMU_TX_DATA when sim is in-active
......................................................................
firmware: Drop CEMU_TX_DATA when sim is in-active
When the emulated sim is in reset or without power, drop
CEMU_TX_DATA.
Change-Id: I796e548225a742cddfde12bd6a60e4d2e5c04c8f
---
M firmware/libcommon/include/card_emu.h
M firmware/libcommon/source/card_emu.c
M firmware/libcommon/source/mode_cardemu.c
3 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/03/43003/6
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43003?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I796e548225a742cddfde12bd6a60e4d2e5c04c8f
Gerrit-Change-Number: 43003
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Attention is currently required from: dexter, laforge.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email )
Change subject: Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
......................................................................
Patch Set 8:
(2 comments)
File host/lib/apdu_dispatch.c:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/4bf80757_c47bf41a?us… :
PS3, Line 120: ac->hdr.cla & 0x80 && /* check for GP */
> In GlobalPlatform Card Specification, section 11.3.2 they list more possible CLA bytes. […]
I don't know what I should do here. Should I drop the requirement for Global Platform and treat all previous case 2 as a case 2?Or keep the code as it?
File host/tests/apdu_dispatch/apdu_dispatch_test.c:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/83cfd253_ebb0fbcf?us… :
PS3, Line 70: OSMO_ASSERT(rc == APDU_ACT_TX_CAPDU_TO_CARD);
> I wonder if it would make sense to inspect the contents of ac and prev_ac after osmo_apdu_segment_in […]
I've added a check on apdu_case.
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
Gerrit-Change-Number: 43185
Gerrit-PatchSet: 8
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Aug 2026 13:31:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: laforge, lynxis lazus.
Hello Jenkins Builder, dexter, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
to look at the new patch set (#8).
Change subject: Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
......................................................................
Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
osmo_apdu_segment_in() doesn't have the context of the previous APDU,
for nearly all calls this is fine, except for GP GET DATA, which can be
a case 2 or case 4 APDU.
GP GET DATA defines the Le field as 0x00 which is used by osmo_apdu_segment_in
to detect if it is a case 2 or case 4.
But if the card responded to a case 2 GP GET DATA with Le = 0 with a
SW 6cXX, the previous GP GET DATA case 2 must be resent with a Le field XX,
which got misinterpreted by the osmo_apdu_segment_in() as a case 4 APDU
instead of a case 2.
Introduce osmo_apdu_segment_in2() containing the previous APDU as
context.
Modem <-> Card
81cadf2000 ->
<- 6c0b
81cadf200b ->
-- Simtrace waits for more data because it wrongly decodes it as APDU case 4
instead of case 2.
Related: SYS#8147
Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
---
M TODO-RELEASE
M host/Makefile.am
M host/configure.ac
M host/include/osmocom/simtrace2/apdu_dispatch.h
M host/lib/apdu_dispatch.c
A host/tests/Makefile.am
A host/tests/apdu_dispatch/Makefile.am
A host/tests/apdu_dispatch/apdu_dispatch_test.c
A host/tests/apdu_dispatch/apdu_dispatch_test.ok
A host/tests/testsuite.at
10 files changed, 199 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/85/43185/8
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
Gerrit-Change-Number: 43185
Gerrit-PatchSet: 8
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Attention is currently required from: laforge, lynxis lazus.
dexter has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email )
Change subject: Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
......................................................................
Patch Set 6: Code-Review+1
(2 comments)
Patchset:
PS5:
I think I understand it better now. So when we receive the 6cXX from the card. We replay the header, but unless we do not memorize the case from the original transmission the following code assumes that the replay transmission is a case 4 and it indefinitely waits for more data from the terminal. So memorizing the case from the original transmission is how we get around this.
Commit Message:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/a46a16be_70238c09?us… :
PS3, Line 17: instead of a case 2 with Le != 0.
> I am having difficulties to understand this description. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
Gerrit-Change-Number: 43185
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Wed, 12 Aug 2026 13:29:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter, laforge.
Hello Jenkins Builder, dexter, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
......................................................................
Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
osmo_apdu_segment_in() doesn't have the context of the previous APDU,
for nearly all calls this is fine, except for GP GET DATA, which can be
a case 2 or case 4 APDU.
GP GET DATA defines the Le field as 0x00 which is used by osmo_apdu_segment_in
to detect if it is a case 2 or case 4.
But if the card responded to a case 2 GP GET DATA with Le = 0 with a
SW 6cXX, the previous GP GET DATA case 2 must be resent with a Le field XX,
which got misinterpreted by the osmo_apdu_segment_in() as a case 4 APDU
instead of a case 2.
Introduce osmo_apdu_segment_in2() containing the previous APDU as
context.
Modem <-> Card
81cadf2000 ->
<- 6c0b
81cadf200b ->
-- Simtrace waits for more data instead sends the APUD case 2 to the card.
Related: SYS#8147
Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
---
M TODO-RELEASE
M host/Makefile.am
M host/configure.ac
M host/include/osmocom/simtrace2/apdu_dispatch.h
M host/lib/apdu_dispatch.c
A host/tests/Makefile.am
A host/tests/apdu_dispatch/Makefile.am
A host/tests/apdu_dispatch/apdu_dispatch_test.c
A host/tests/apdu_dispatch/apdu_dispatch_test.ok
A host/tests/testsuite.at
10 files changed, 199 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/85/43185/7
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
Gerrit-Change-Number: 43185
Gerrit-PatchSet: 7
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter, laforge.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email )
Change subject: Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
......................................................................
Patch Set 6:
(3 comments)
File host/tests/apdu_dispatch/apdu_dispatch_test.c:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/70138950_0b847ed7?us… :
PS3, Line 18: memset(&prev_ac, 0, sizeof(prev_ac)); \
> prev_ac only appears in the memset and nowhere else, is this line needed in this macro?
Done
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/e99c3e3f_c6e62f86?us… :
PS3, Line 22: printf("%d (actual) != %d (intended)\n", rc, exp_rc);\
> I think (expected) is more accurate. The variable is also called "exp_rc".
Done
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/0209f618_d0b3ca17?us… :
PS3, Line 55: rc = osmo_apdu_segment_in2(&ac, &prev_ac, get_data_c2_ca, ARRAY_SIZE(get_data_c2_ca), 1);
> The last parameter of osmo_apdu_segment_in2 is a bool. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
Gerrit-Change-Number: 43185
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Aug 2026 13:23:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>