dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-eim/+/43176?usp=email )
Change subject: WIP: invert asn1ct tag workaround
......................................................................
WIP: invert asn1ct tag workaround
The erlang asn1ct compiler runs into problems when a context specific
ASN.1 tag is applied twice, which is the case in the original SGP.32
SGP32Definitions spec.
Currently we remove the excess tag on the ASN.1 struct definition.
This works fine as long as the structs are only used internally, which
is the case when ASN.1 ESipa bindings are used. When the JSON ESipa
bindings are used, many of the structs are used directly. A missing
context specific tag on the struct definition will then obviously
cause interoperability problems.
With this patch we invert the workaround, we now no longer remove
the context specific tag at the struct definition, instead we remove
it at the struct member in each parent struct.
Related: SYS#8100
Change-Id: I43625be897f7a1cdbf0fa6b71ee651df993f8584
---
M asn1/SGP32Definitions.asn1
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/76/43176/1
diff --git a/asn1/SGP32Definitions.asn1 b/asn1/SGP32Definitions.asn1
index cc052b4..d5500bf 100644
--- a/asn1/SGP32Definitions.asn1
+++ b/asn1/SGP32Definitions.asn1
@@ -383,10 +383,11 @@
ecallIndication [123] BOOLEAN OPTIONAL, -- Tag '9F7B'
fallbackAllowed [103] BOOLEAN OPTIONAL -- Tag '9F67'
}
+-- workaround for erlang asn1ct: remove already specified context-specific tag [56] on member authenticateServerResponse
-- workaround: add prefix ("SGP32-") to avoid clash with SGP.22
SGP32-AuthenticateClientRequest ::= [59] SEQUENCE { -- Tag 'BF3B'
transactionId [0] TransactionId,
- authenticateServerResponse [56] SGP32-AuthenticateServerResponse -- This is the response from ES10b.AuthenticateServer
+ authenticateServerResponse SGP32-AuthenticateServerResponse -- This is the response from ES10b.AuthenticateServer
}
-- workaround: add prefix ("SGP32-") to avoid clash with SGP.22
SGP32-EUICCInfo2 ::= [34] SEQUENCE { -- Tag 'BF22'
@@ -613,9 +614,8 @@
SGP32-SetDefaultDpAddressResponse ::= [101] SEQUENCE { -- Tag 'BF65'
setDefaultDpAddressResult INTEGER { ok (0), undefinedError (127)}
}
--- workaround for erlang asn1ct: remove already specified context-specific tag [33]
-- workaround: add prefix ("SGP32-") to avoid clash with SGP.22
-SGP32-PrepareDownloadResponse ::= CHOICE { -- Tag 'BF21'
+SGP32-PrepareDownloadResponse ::= [33] CHOICE { -- Tag 'BF21'
downloadResponseOk PrepareDownloadResponseOk,
downloadResponseError PrepareDownloadResponseError,
compactDownloadResponseOk CompactPrepareDownloadResponseOk
@@ -643,9 +643,8 @@
euiccCertificate Certificate, -- eUICC Certificate (CERT.EUICC.ECDSA) signed by the EUM
eumCertificate Certificate -- EUM Certificate (CERT.EUM.ECDSA) signed by the requested CI
}
--- workaround for erlang asn1ct: remove already specified context-specific tag [56]
-- workaround: add prefix ("SGP32-") to avoid clash with SGP.22
-SGP32-AuthenticateServerResponse ::= CHOICE { -- Tag 'BF38'
+SGP32-AuthenticateServerResponse ::= [56] CHOICE { -- Tag 'BF38'
authenticateResponseOk SGP32-AuthenticateResponseOk,
authenticateResponseError AuthenticateResponseError,
compactAuthenticateResponseOk CompactAuthenticateResponseOk
@@ -758,9 +757,10 @@
matchingId UTF8String OPTIONAL,
ctxParams1 [2] CtxParams1 OPTIONAL
}
+-- workaround for erlang asn1ct: remove already specified context-specific tag [56] on member authenticateServerResponse
AuthenticateClientRequestEsipa ::= [59] SEQUENCE { -- Tag 'BF3B'
transactionId [0] TransactionId, -- The TransactionID generated by the SM-DP+/SM-DS
- authenticateServerResponse [56] SGP32-AuthenticateServerResponse -- This is the response from ES10b.AuthenticateServer, possibly in compact format
+ authenticateServerResponse SGP32-AuthenticateServerResponse -- This is the response from ES10b.AuthenticateServer, possibly in compact format
}
AuthenticateClientResponseEsipa ::= [59] CHOICE { -- Tag 'BF3B'
authenticateClientOkDPEsipa AuthenticateClientOkDPEsipa,
@@ -794,9 +794,10 @@
transactionId [0] TransactionId, -- The TransactionID generated by the SM-DS
profileDownloadTrigger [84] ProfileDownloadTriggerRequest OPTIONAL -- Tag 'BF54'
}
+-- workaround for erlang asn1ct: remove already specified context-specific tag [33] on member prepareDownloadResponse
GetBoundProfilePackageRequestEsipa ::= [58] SEQUENCE { -- Tag 'BF3A'
transactionId [0] TransactionId, -- The TransactionID generated by the SM-DP+
- prepareDownloadResponse [33] SGP32-PrepareDownloadResponse -- This is the response from ES10b.PrepareDownload, possibly in compact format
+ prepareDownloadResponse SGP32-PrepareDownloadResponse -- This is the response from ES10b.PrepareDownload, possibly in compact format
}
GetBoundProfilePackageResponseEsipa ::= [58] CHOICE { -- Tag 'BF3A'
getBoundProfilePackageOkEsipa GetBoundProfilePackageOkEsipa,
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/43176?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I43625be897f7a1cdbf0fa6b71ee651df993f8584
Gerrit-Change-Number: 43176
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: Hoernchen.
laforge 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 1: Code-Review+1
--
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: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 07 Aug 2026 07:50:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Hoernchen, dexter, lynxis lazus.
laforge has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43136?usp=email )
Change subject: GP: mixed PSK TLS PUT KEY (Amendment B Table 3-13)
......................................................................
Patch Set 1:
(2 comments)
File pySim/global_platform/__init__.py:
https://gerrit.osmocom.org/c/pysim/+/43136/comment/f9c966a0_e5a90a56?usp=em… :
PS1, Line 655: (b'\x85' + bertlv_encode_len(len(block)) + block +
: bytes([len(kcv)]) + kcv)
I would have preferred the use of our object-oriented BER_TLV_IE encoder for the 0x85 as well as some new Transcodable-derived class for the LV KCV section. That would feel more "pysim-onic" to me ,than the low-level byte-concatenation here in a rather high-level method. Or alternatively some kind of costruct.
https://gerrit.osmocom.org/c/pysim/+/43136/comment/fb5dd59c_19f11f10?usp=em… :
PS1, Line 1113:
wouldn't this return more than the three bytes that the comment above indicates? But then, I see, the existing functions above do the same and the truncation happens in the shared compute_kcv() below.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43136?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: I480a9d049a052aa5ae54fe6e2771dba44e89434d
Gerrit-Change-Number: 43136
Gerrit-PatchSet: 1
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-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 07 Aug 2026 07:48:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: laforge.
Hoernchen has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/43171?usp=email )
Change subject: tlv: preserve the comprehension bit
......................................................................
Patch Set 1:
(1 comment)
File src/osmocom/tlv.py:
https://gerrit.osmocom.org/c/python/pyosmocom/+/43171/comment/97067343_d68b… :
PS1, Line 638: if x.tag > 0xff:
: # two byte tag: the comprehension bit is 0x8000!
: if x.tag & 0x8000 == 0:
: print("Fixing up COMPR_TLV_IE class %s: tag=0x%x has no comprehension bit" % (name, x.tag))
: x.tag = x.tag | 0x8000
> what exactly is the difference here? isn't this change semantically identical?
No, because the original condition was AND, so if either part didnt match it would fall through to the elif and that is what clobbered the two byte tag. As the comment says two byte is 0x8000 - precisely the part in the previous AND that would fail.
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/43171?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ifae37785e2a586d9130d154bc7244f35fa6f2a55
Gerrit-Change-Number: 43171
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 06 Aug 2026 21:31:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: Hoernchen.
laforge has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/43171?usp=email )
Change subject: tlv: preserve the comprehension bit
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/osmocom/tlv.py:
https://gerrit.osmocom.org/c/python/pyosmocom/+/43171/comment/1567ed43_a4ce… :
PS1, Line 638: if x.tag > 0xff:
: # two byte tag: the comprehension bit is 0x8000!
: if x.tag & 0x8000 == 0:
: print("Fixing up COMPR_TLV_IE class %s: tag=0x%x has no comprehension bit" % (name, x.tag))
: x.tag = x.tag | 0x8000
what exactly is the difference here? isn't this change semantically identical?
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/43171?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ifae37785e2a586d9130d154bc7244f35fa6f2a55
Gerrit-Change-Number: 43171
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Aug 2026 16:33:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria, jolly.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/onomondo-eim/+/42881?usp=email )
Change subject: esipa_rest_utils: add support for PSMOs added in SGP.32 V.1.2
......................................................................
Patch Set 9:
(1 comment)
File contrib/rest_api_resource_schema.json:
https://gerrit.osmocom.org/c/onomondo-eim/+/42881/comment/452d1efe_6e49b3cd… :
PS9, Line 169: ,
> This would allow 0-9 and A-F and ','. I see it also in other definitions above and below.
Are you sure? I always thought the ',' is a delimiter. I used SGP.32, section 6.4.1. as an example. They also use a ',' in their definitions.
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42881?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I03cdd70065a83dfc611d614cf32d817c13fad347
Gerrit-Change-Number: 42881
Gerrit-PatchSet: 9
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Aug 2026 15:57:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>