lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

November 2026

  • 1 participants
  • 714 discussions
[M] Change in pysim[master]: global_platform: add tracked security domain selection
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, dexter, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43724?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+2 by dexter, Verified-1 by Jenkins Builder Change subject: global_platform: add tracked security domain selection ...................................................................... global_platform: add tracked security domain selection select_security_domain <aid> does SELECT by AID and models the result as an ADF_SD, so the GP commands, prompt and CardKeyProvider identity work. Plain select cannot do this: probe_file() classifies by the ISO FCP, an application answers with a GP FCI, and whether that FCI belongs to a Security Domain is not obvious (GPC 11.9.3.1 table 11-56 tag 73 is optional, the sysmoEUICC1 omits it). The CardKeyProvider identity (ICCID vs EID) used for csv lookup of credentials is (obviously) not part of the answer at all. This new command makes using the eUICC with MNO-SDs and SSDs easier, because so far we only had raw apdus to select those that led to a confused internal pysim state, i.e. install_cap after selecting like that would try to install to the ISD-R. Change-Id: I7c6dda0f11dc6bb175f05b3832cf49691089c297 --- M docs/put_key-tutorial.rst M docs/shell.rst M pySim/global_platform/__init__.py M tests/unittests/test_globalplatform.py 4 files changed, 221 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/24/43724/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43724?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I7c6dda0f11dc6bb175f05b3832cf49691089c297 Gerrit-Change-Number: 43724 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: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: saip: fix key usage qualifier of helper created SD keys
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43723?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: saip: fix key usage qualifier of helper created SD keys ...................................................................... saip: fix key usage qualifier of helper created SD keys SD_KEY_DEFS holds the GP Key Usage Qualifier as its encoded octet, SecurityDomainKey expects the decoded FlagsEnum dict. Passing the int encoded a 0 qualifier for every newly created key... Change-Id: I4a94562d6052c6796929b81b1f9b9ce5b56dcd20 --- M pySim/esim/saip/personalization.py M tests/unittests/test_esim_saip.py 2 files changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/23/43723/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43723?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4a94562d6052c6796929b81b1f9b9ce5b56dcd20 Gerrit-Change-Number: 43723 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: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in pysim[master]: smpp-ota-tool: use the shared OTA argparse helpers
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43722?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: smpp-ota-tool: use the shared OTA argparse helpers ...................................................................... smpp-ota-tool: use the shared OTA argparse helpers Change-Id: Icea287f1a216fae4274f00a723a47ec19376a6ce --- M contrib/smpp-ota-tool.py 1 file changed, 4 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/22/43722/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43722?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Icea287f1a216fae4274f00a723a47ec19376a6ce Gerrit-Change-Number: 43722 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: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[L] Change in pysim[master]: contrib: CAT_TP admin server for RAM/RFM over BIP
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43721?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: contrib: CAT_TP admin server for RAM/RFM over BIP ...................................................................... contrib: CAT_TP admin server for RAM/RFM over BIP Basically the UDP counterpart of scp81_admin_server.py, plain sockets: - waits for the SYN caused by the the PUSH - sends the queued C-APDUs as TS 102 225 secured packets, one per SDU, with the SCP80 keys and TAR of OTA over SMS - decodes the responses and closes the link with RST when done. Change-Id: I4b97971beb9c0dda73217ece5f1e51fd8ace4540 --- A contrib/cattp_admin_server.py A tests/unittests/test_cattp_admin_server.py 2 files changed, 364 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/21/43721/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43721?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4b97971beb9c0dda73217ece5f1e51fd8ace4540 Gerrit-Change-Number: 43721 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: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in pysim[master]: ota: argparse helpers for the SCP80 key set and SPI
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43720?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: ota: argparse helpers for the SCP80 key set and SPI ...................................................................... ota: argparse helpers for the SCP80 key set and SPI shared among scp80/cat-tp and scp81 Change-Id: I599a07f7e4e100ddce91ee7eae70bab3cf9c07c1 --- M pySim/ota.py 1 file changed, 49 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/20/43720/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43720?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I599a07f7e4e100ddce91ee7eae70bab3cf9c07c1 Gerrit-Change-Number: 43720 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: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[XL] Change in pysim[master]: cattp: ETSI TS 102 127 transport for OTA over BIP UDP
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, dexter, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43719?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+1 by dexter, Verified+1 by Jenkins Builder Change subject: cattp: ETSI TS 102 127 transport for OTA over BIP UDP ...................................................................... cattp: ETSI TS 102 127 transport for OTA over BIP UDP While this might look like "hand rolled TCP over UDP done wrong" is is actually amazing 80s technology, based on RFC 908/1151 RDP v2. It supports: - three way handshake - cumulative and extended ACKs - retransmission with retry limit - windows - SEG(ments) reassembly - NUL and RST Has a server side the card connects to + client side for the tests, just like scp81. Change-Id: I6f31493c1f0fb48fb3fd5382d8af2c905d365e54 --- A pySim/cattp.py A tests/unittests/test_cattp.py 2 files changed, 1,089 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/19/43719/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43719?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I6f31493c1f0fb48fb3fd5382d8af2c905d365e54 Gerrit-Change-Number: 43719 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: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[L] Change in pysim[master]: ota: CAT_TP / TCP dialect of TS 102 225 secured packet
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, dexter, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43717?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+1 by dexter, Verified+1 by Jenkins Builder Change subject: ota: CAT_TP / TCP dialect of TS 102 225 secured packet ...................................................................... ota: CAT_TP / TCP dialect of TS 102 225 secured packet There are 3 sections: Section 6, CAT_TP: SCP80 secured packets as CAT_TP SDUs over BIP UDP Section 7, TCP/IP: SCP80 secured packets, dropped raw into a TCP stream Section 8, HTTPS = SCP81: no SCP80 packets, prev patchset This covers 6+7 which are identical on the packet level and are basically SCP80 OTA sms without a length limit over a different transport. In practice I don't think anyone ever deployed scp80 over tcp... Change-Id: I122a13000e622f7550468845e8560dec5a3c55a6 --- M pySim/ota.py M tests/unittests/test_ota.py 2 files changed, 262 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/17/43717/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43717?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I122a13000e622f7550468845e8560dec5a3c55a6 Gerrit-Change-Number: 43717 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: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in pysim[master]: ota: TS 102 226 PUSH command and CAT_TP trigger
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43718?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: ota: TS 102 226 PUSH command and CAT_TP trigger ...................................................................... ota: TS 102 226 PUSH command and CAT_TP trigger TS 102 226 section 9 PUSH covers BIP/CAT_TP/TCP/ID, we only care about CAT_TP tho + trigger generator tool like scp81. Change-Id: Ib3423c4fe582dbcc9434c8234709a7b845fa6bcd --- A contrib/cattp_trigger.py M pySim/ota.py M tests/unittests/test_ota.py 3 files changed, 108 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/18/43718/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43718?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib3423c4fe582dbcc9434c8234709a7b845fa6bcd Gerrit-Change-Number: 43718 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: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[L] Change in pysim[master]: bip: UDP channels for CAT_TP
by Hoernchen 18 Nov '26

18 Nov '26
Attention is currently required from: Hoernchen, dexter, laforge. Hello Jenkins Builder, dexter, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/43716?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+1 by dexter, Code-Review+1 by laforge, Verified+1 by Jenkins Builder Change subject: bip: UDP channels for CAT_TP ...................................................................... bip: UDP channels for CAT_TP Humble beginnings of CAT_TP support: OPEN CHANNEL with "UDP, UICC in client mode, remote connection" gets a datagram socket. SEND DATA without "send immediately" is buffered, TERMINAL PROFILE byte 17 announces our new UDP client mode. ProactChannel becomes the abstract base of ProactTcpChannel and ProactUdpChannel. Change-Id: I015c5eb8768c70751b198d9259c58dab22e4a8ff --- M pySim/bip.py M tests/unittests/test_bip_relay.py 2 files changed, 245 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/16/43716/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43716?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I015c5eb8768c70751b198d9259c58dab22e4a8ff Gerrit-Change-Number: 43716 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: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in libosmocore[master]: gsm: fix one-byte overflow in BCD number encoders
by bucketking657 18 Nov '26

18 Nov '26
bucketking657 has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/44142?usp=email ) Change subject: gsm: fix one-byte overflow in BCD number encoders ...................................................................... gsm: fix one-byte overflow in BCD number encoders gsm48_encode_bcd_number() limits the L octet to max_len, but callers passed the whole buffer size, so a number one or two digits over the spec maximum wrote one byte past the buffer. Pass sizeof() - 1, and compute the length in an int so that it cannot wrap. Add tests. Fixes: OS#7126 Change-Id: I99521d30896f3d58ecfb28de290bce7e31388fca --- M src/gsm/gsm0411_utils.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48_ie.c M src/gsm/gsup.c M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok M tests/gsm0808/gsm0808_test.c M tests/gsm0808/gsm0808_test.ok 8 files changed, 142 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/44142/1 diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index 470b017..5a9aa7c 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -315,7 +315,7 @@ /* prevent buffer overflows */ if (strlen(number) > 20) number = ""; - len_in_bytes = gsm48_encode_bcd_number(oa, oa_len, 1, number); + len_in_bytes = gsm48_encode_bcd_number(oa, oa_len - 1, 1, number); /* GSM 03.40 tells us the length is in 'useful semi-octets' */ oa[0] = strlen(number) & 0xff; } diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index d7bc275..74fdf93 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -2375,7 +2375,7 @@ OSMO_ASSERT(msg); OSMO_ASSERT(msisdn); - rc = gsm48_encode_bcd_number(bcd_lv, sizeof(bcd_lv), 0, msisdn); + rc = gsm48_encode_bcd_number(bcd_lv, sizeof(bcd_lv) - 1, 0, msisdn); if (rc < 1) return 0; diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index e33e672..ed2b6b8 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -137,7 +137,8 @@ /*! convert a ASCII phone number to 'called/calling/connect party BCD number' * \param[out] bcd_lv Caller-provided output buffer - * \param[in] max_len Maximum Length of \a bcd_lv + * \param[in] max_len Maximum value of the L octet; \a bcd_lv must have + * room for at least max_len + 1 bytes * \param[in] h_len Length of an optional heder between L and V portion * \param[in] input phone number as 0-terminated ASCII * \returns number of bytes used in \a bcd_lv; negative on error @@ -151,16 +152,18 @@ int h_len, const char *input) { int in_len = strlen(input); + int len; int i; uint8_t *bcd_cur = bcd_lv + 1 + h_len; /* two digits per byte, plus type byte */ - bcd_lv[0] = in_len/2 + h_len; + len = in_len/2 + h_len; if (in_len % 2) - bcd_lv[0]++; + len++; - if (bcd_lv[0] > max_len) + if (len > max_len) return -EIO; + bcd_lv[0] = len; for (i = 0; i < in_len; i++) { int rc = asc_to_bcd(input[i]); @@ -463,7 +466,7 @@ lv[1] |= called->type << 4; /* octet 4..N, octet 2 */ - ret = gsm48_encode_bcd_number(lv, sizeof(lv), 1, called->number); + ret = gsm48_encode_bcd_number(lv, sizeof(lv) - 1, 1, called->number); if (ret < 0) return ret; @@ -531,7 +534,7 @@ lv[1] |= 0x80; /* octet 4..N, octet 2 */ - ret = gsm48_encode_bcd_number(lv, sizeof(lv), h_len, callerid->number); + ret = gsm48_encode_bcd_number(lv, sizeof(lv) - 1, h_len, callerid->number); if (ret < 0) return ret; diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 1e4ee6a..49dcd9c 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -807,7 +807,7 @@ msgb_v_put(msg, gsup_msg->message_type); - bcd_len = gsm48_encode_bcd_number(bcd_buf, sizeof(bcd_buf), 0, + bcd_len = gsm48_encode_bcd_number(bcd_buf, sizeof(bcd_buf) - 1, 0, gsup_msg->imsi); if (bcd_len <= 0 || bcd_len > sizeof(bcd_buf)) diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 5566b7c..cf2da53 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -1496,6 +1496,28 @@ .enc_buf_lim = 9, }, { + .test_name = "17-digit number, L octet equals max_len (OS#7126)", + + /* Encoding test (max_len limits the L octet, not the buffer) */ + .enc_ascii = "12345678901234567", + .enc_hex = "092143658709214365f7", + .enc_rc = 10, + + /* Buffer length limitations */ + .enc_buf_lim = 9, + }, + { + .test_name = "19-digit number, L octet exceeds max_len (OS#7126)", + + /* Encoding test (not enough room in buffer) */ + .enc_ascii = "1234567890123456789", + .enc_hex = "", /* nothing */ + .enc_rc = -EIO, + + /* Buffer length limitations */ + .enc_buf_lim = 9, + }, + { .test_name = "LV incorrect length", .dec_hex = "05214365", /* should be 0x03 */ .dec_ascii = "(none)", @@ -1545,7 +1567,7 @@ if (test->enc_buf_lim) buf_len = test->enc_buf_lim; else - buf_len = sizeof(buf_enc); + buf_len = sizeof(buf_enc) - 1; printf(" - Encoding ASCII (buffer limit=%zu) '%s'...\n", test->enc_buf_lim, test->enc_ascii); @@ -1587,6 +1609,63 @@ printf("\n"); } +static void test_bcd_number_ie(const char *name, + int (*enc)(struct msgb *msg, const struct gsm_mncc_number *num), + unsigned int num_digits, bool octet_3a) +{ + struct gsm_mncc_number num = { .screen = octet_3a ? 1 : 0 }; + struct msgb *msg = msgb_alloc(128, __func__); + int rc; + + OSMO_ASSERT(msg); + OSMO_ASSERT(num_digits < sizeof(num.number)); + memset(num.number, '1', num_digits); + + rc = enc(msg, &num); + printf("- %s, %u digits%s: rc=%d IE='%s'\n", name, num_digits, + octet_3a ? " (with octet 3a)" : "", rc, + osmo_hexdump_nospc(msgb_data(msg), msgb_length(msg))); + + msgb_free(msg); +} + +/* OS#7126: neither the L octet nor the IE buffers may overflow */ +static void test_bcd_number_encode_limits(void) +{ + char digits[512]; + uint8_t buf[256]; + int rc; + + printf("BCD number encoding limits test\n"); + + /* The L octet must not wrap: 510 digits give L = 255, 511 give 256 */ + memset(digits, '1', 510); + digits[510] = '\0'; + rc = gsm48_encode_bcd_number(buf, sizeof(buf) - 1, 0, digits); + printf("- 510 digits, max_len=%zu: rc=%d\n", sizeof(buf) - 1, rc); + memset(digits, '1', 511); + digits[511] = '\0'; + rc = gsm48_encode_bcd_number(buf, sizeof(buf) - 1, 0, digits); + printf("- 511 digits, max_len=%zu: rc=%d\n", sizeof(buf) - 1, rc); + + /* TS 24.008 10.5.4.9: Calling party BCD number, at most 14 octets */ + test_bcd_number_ie("Calling", gsm48_encode_calling, 22, false); + test_bcd_number_ie("Calling", gsm48_encode_calling, 23, false); + test_bcd_number_ie("Calling", gsm48_encode_calling, 20, true); + test_bcd_number_ie("Calling", gsm48_encode_calling, 21, true); + /* TS 24.008 10.5.4.13: Connected number, at most 14 octets */ + test_bcd_number_ie("Connected", gsm48_encode_connected, 22, false); + test_bcd_number_ie("Connected", gsm48_encode_connected, 23, false); + /* TS 24.008 10.5.4.21b: Redirecting party BCD number, at most 19 octets */ + test_bcd_number_ie("Redirecting", gsm48_encode_redirecting, 32, false); + test_bcd_number_ie("Redirecting", gsm48_encode_redirecting, 30, true); + test_bcd_number_ie("Redirecting", gsm48_encode_redirecting, 31, true); + /* TS 24.008 10.5.4.7: Called party BCD number, limited by lv[18] */ + test_bcd_number_ie("Called", gsm48_encode_called, 32, false); + + printf("\n"); +} + struct { int range; int arfcns_num; @@ -2026,6 +2105,7 @@ test_mid_decode_zero_length(); test_struct_mobile_identity(); test_bcd_number_encode_decode(); + test_bcd_number_encode_limits(); test_ra_cap(); test_lai_encode_decode(); test_osmo_routing_area_id(); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 3580591..f9838f0 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -229,6 +229,14 @@ - Decoding HEX (buffer limit=16) '0a21436587092143658709'... - Expected: (rc=-28) '123456789012345' - Actual: (rc=-28) '123456789012345' +- Running test: 17-digit number, L octet equals max_len (OS#7126) + - Encoding ASCII (buffer limit=9) '12345678901234567'... + - Expected: (rc=10) '092143658709214365f7' + - Actual: (rc=10) '092143658709214365f7' +- Running test: 19-digit number, L octet exceeds max_len (OS#7126) + - Encoding ASCII (buffer limit=9) '1234567890123456789'... + - Expected: (rc=-5) '' + - Actual: (rc=-5) '' - Running test: LV incorrect length - Decoding HEX (buffer limit=0) '05214365'... - Expected: (rc=-22) '(none)' @@ -245,6 +253,20 @@ - Expected: (rc=-28) '123' - Actual: (rc=-28) '123' +BCD number encoding limits test +- 510 digits, max_len=255: rc=256 +- 511 digits, max_len=255: rc=-5 +- Calling, 22 digits: rc=0 IE='5c0c801111111111111111111111' +- Calling, 23 digits: rc=-5 IE='' +- Calling, 20 digits (with octet 3a): rc=0 IE='5c0c008111111111111111111111' +- Calling, 21 digits (with octet 3a): rc=-5 IE='' +- Connected, 22 digits: rc=0 IE='4c0c801111111111111111111111' +- Connected, 23 digits: rc=-5 IE='' +- Redirecting, 32 digits: rc=0 IE='74118011111111111111111111111111111111' +- Redirecting, 30 digits (with octet 3a): rc=0 IE='74110081111111111111111111111111111111' +- Redirecting, 31 digits (with octet 3a): rc=-5 IE='' +- Called, 32 digits: rc=0 IE='5e118011111111111111111111111111111111' + Constructed RA: 077-121-666-5 MCC+MNC in BCD: 70 17 21 diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8ebbd4b..cafea50 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -477,6 +477,29 @@ OSMO_ASSERT(rc == 5); } +/* OS#7126: TS 48.008 3.2.2.101 allows at most 10 octets of MSISDN digits */ +static void test_gsm0808_enc_msisdn_limits(void) +{ + static const char *msisdns[] = { + "12345678901234567890", /* 20 digits, the maximum */ + "123456789012345678901", /* 21 digits, too long */ + }; + unsigned int i; + + printf("Testing encoding MSISDN length limits\n"); + + for (i = 0; i < ARRAY_SIZE(msisdns); i++) { + struct msgb *msg = msgb_alloc(64, __func__); + uint8_t rc; + + OSMO_ASSERT(msg); + rc = gsm0808_enc_msisdn(msg, msisdns[i]); + printf("- %zu digits: rc=%u IE='%s'\n", strlen(msisdns[i]), rc, + osmo_hexdump_nospc(msgb_data(msg), msgb_length(msg))); + msgb_free(msg); + } +} + static void test_create_ass(void) { static const uint8_t res1[] = @@ -2822,6 +2845,7 @@ test_dec_confusion(); test_dec_perform_location_report_sys5891(); + test_gsm0808_enc_msisdn_limits(); printf("Done\n"); return EXIT_SUCCESS; diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok index 2329fcd..b3d4cae 100644 --- a/tests/gsm0808/gsm0808_test.ok +++ b/tests/gsm0808/gsm0808_test.ok @@ -917,4 +917,7 @@ Diagnostics error bit location 15 (Reserved value) Diagnostics message that provoked the error: 00 03 25 03 25 Testing decoding Perform Location Report SYS#5891 +Testing encoding MSISDN length limits +- 20 digits: rc=12 IE='7b0a21436587092143658709' +- 21 digits: rc=0 IE='' Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44142?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I99521d30896f3d58ecfb28de290bce7e31388fca Gerrit-Change-Number: 44142 Gerrit-PatchSet: 1 Gerrit-Owner: bucketking657 <joshuashilts(a)gmail.com>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • ...
  • 72
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.