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

June 2026

  • 1 participants
  • 870 discussions
[M] Change in pysim[master]: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a...
by neels 12 Jun '26

12 Jun '26
neels has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/c/pysim/+/42829?usp=email ) Change subject: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256 ...................................................................... saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256 Related: SYS#8096 SYS#8037 Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1 --- M pySim/esim/saip/__init__.py 1 file changed, 50 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/42829/3 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42829?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: Ibc29c6437c5c92e2b14938b733156536863465c1 Gerrit-Change-Number: 42829 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: Jenkins Builder
1 0
0 0
[M] Change in pysim[master]: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a...
by neels 12 Jun '26

12 Jun '26
neels has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/pysim/+/42829?usp=email ) Change subject: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256 ...................................................................... saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256 Related: SYS#8096 SYS#8037 Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1 --- M pySim/esim/saip/__init__.py 1 file changed, 51 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/42829/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42829?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: Ibc29c6437c5c92e2b14938b733156536863465c1 Gerrit-Change-Number: 42829 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: Jenkins Builder
1 0
0 0
[M] Change in pysim[master]: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a...
by neels 12 Jun '26

12 Jun '26
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/42829?usp=email ) Change subject: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256 ...................................................................... saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256 Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1 --- M pySim/esim/saip/__init__.py 1 file changed, 51 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/42829/1 diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index ec59c50..5fe8136 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -34,7 +34,7 @@ from pySim.utils import dec_imsi from pySim.ts_102_221 import FileDescriptor from pySim.filesystem import CardADF, Path -from pySim.ts_31_102 import ADF_USIM +from pySim.ts_31_102 import ADF_USIM, EF_UST, EF_SUCI_Calc_Info from pySim.ts_31_103 import ADF_ISIM from pySim.esim import compile_asn1_subdir from pySim.esim.saip import templates @@ -1726,7 +1726,56 @@ if 'BT' in ftype_list: svc_set.add('ber-tlv') # FIXME:dfLinked files (scan all files, check for non-empty Fcp.linkPath presence of DFs) - # TODO: 5G related bits (derive from EF.UST or file presence?) + + # 5G: + # - When SUCI is: + # - enabled (EF.UST 124 = true) + # AND + # - calculated in the USIM (EF.UST 125 = true), + # then eUICC-Mandatory-services needs 'get-identity'. + # - 'get-identity' implies that the eUICC must support ONE OF profile-A OR profile-B. + # So, when SUCI-CalcInfo for USIM in DF.SAIP contains both key types, + # then no profile-A or B services need to be requested explicitly. + # - When the SUCI-CalcInfo for USIM (DF.SAIP) contains ONLY a key of profile-A ("identifier": 1), + # then eUICC-Mandatory-services needs 'profile-a-x25519'. + # - Same: ONLY profile-B ("identifier": 2) needs 'profile-b-p256'. + # - (When SUCI is calculated in the UE, then the eUICC does not need to provide any of these services.) + suci_in_usim_enabled = False + try: + f_ust = self.get_pe_for_type("usim").files["ef-ust"] + ust = EF_UST().decode_bin(f_ust.body) + if ust[124]['activated'] and ust[125]['activated']: + suci_in_usim_enabled = True + except (KeyError, AttributeError): + pass + if suci_in_usim_enabled: + svc_set.add('get-identity') + # now check for profile-a and profile-b + suci_calcinfo_has_profile_a = False + suci_calcinfo_has_profile_b = False + try: + f_sucici = self.get_pe_for_type("df-saip").files["ef-suci-calc-info-usim"] + sucici = EF_SUCI_Calc_Info().decode_bin(f_sucici.body) or {} + for prot_scheme in sucici['prot_scheme_id_list']: + if not isinstance(prot_scheme, dict): + continue + ps_id = prot_scheme["identifier"] + if ps_id == 1: + suci_calcinfo_has_profile_a = True + elif ps_id == 2: + suci_calcinfo_has_profile_b = True + except (KeyError, AttributeError): + pass + if suci_calcinfo_has_profile_a and suci_calcinfo_has_profile_b: + # 'get-identity' implies that the eUICC supports one of the above. Do not require a specific one. + pass + elif suci_calcinfo_has_profile_a: + # The profile has only a profile-A key, so require that + svc_set.add('profile-a-x25519') + elif suci_calcinfo_has_profile_b: + # The profile has only a profile-B key, so require that + svc_set.add('profile-b-p256') + hdr_pe = self.get_pe_for_type('header') # patch in the 'manual' services from the existing list: for old_svc in hdr_pe.decoded['eUICC-Mandatory-services'].keys(): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42829?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1 Gerrit-Change-Number: 42829 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access
by laforge 12 Jun '26

12 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email ) Change subject: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access ...................................................................... libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access Although types are frowned upon because memorizing all differerent flavors of void* is the usual way to get acquainted with any mature C code base some heretics decided to introduce generics in C11, which can be used to make aligned access (which guarantees tear-free/restartable 64 bit access on cortex m4) less exciting. Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb --- M ccid_common/cuart.h M ccid_host/libosmo_emb.h M sysmoOCTSIM/libosmo_emb.c M sysmoOCTSIM/libosmo_emb.h 4 files changed, 45 insertions(+), 20 deletions(-) Approvals: jolly: Looks good to me, but someone else must approve laforge: Looks good to me, approved; Verified diff --git a/ccid_common/cuart.h b/ccid_common/cuart.h index a53dc18..d31d2d9 100644 --- a/ccid_common/cuart.h +++ b/ccid_common/cuart.h @@ -102,7 +102,7 @@ uint32_t wtime_etu; /* deadline in jiffies (ms) for card response timeout, 0 = inactive. * Set from IRQ context, checked from main loop */ - volatile uint64_t wtime_deadline __attribute__((aligned(8))); + tearfree_u64_t wtime_deadline; /* expected number of bytes, for timeout */ uint32_t current_wtime_byte; diff --git a/ccid_host/libosmo_emb.h b/ccid_host/libosmo_emb.h index ffc0324..e811dd3 100644 --- a/ccid_host/libosmo_emb.h +++ b/ccid_host/libosmo_emb.h @@ -1,15 +1,23 @@ #pragma once -/* Host-side jiffies emulation */ +/* Host-side jiffies emulation + * On the host every access is a plain memory access; the typed wrapper exists + * only purely for type compatibility with code shared with the embedded target. */ #include <stdint.h> +#include <stdalign.h> -static inline uint64_t ldrd_u64(const volatile uint64_t *p) -{ - return *p; -} -static inline void strd_u64(volatile uint64_t *p, uint64_t v) -{ - *p = v; -} +typedef struct { + alignas(8) volatile uint64_t _v; +} tearfree_u64_t; + +static inline uint64_t _ldrd_u64(const tearfree_u64_t *p) { return p->_v; } +static inline void _strd_u64(tearfree_u64_t *p, uint64_t v) { p->_v = v; } + +#define ldrd_u64(p) _Generic((p), \ + tearfree_u64_t *: _ldrd_u64, \ + const tearfree_u64_t *: _ldrd_u64)(p) + +#define strd_u64(p, v) _Generic((p), \ + tearfree_u64_t *: _strd_u64)((p), (v)) uint64_t get_jiffies(void); diff --git a/sysmoOCTSIM/libosmo_emb.c b/sysmoOCTSIM/libosmo_emb.c index e96f88e..731268b 100644 --- a/sysmoOCTSIM/libosmo_emb.c +++ b/sysmoOCTSIM/libosmo_emb.c @@ -17,7 +17,7 @@ #include "driver_init.h" #include "libosmo_emb.h" -volatile uint64_t jiffies __attribute__((aligned(8))); +tearfree_u64_t jiffies; uint64_t get_jiffies(void) { @@ -31,7 +31,7 @@ void SysTick_Handler(void) { - jiffies++; + jiffies._v++; } int _gettimeofday(struct timeval *tv, void *tz) diff --git a/sysmoOCTSIM/libosmo_emb.h b/sysmoOCTSIM/libosmo_emb.h index 4b576c6..705982c 100644 --- a/sysmoOCTSIM/libosmo_emb.h +++ b/sysmoOCTSIM/libosmo_emb.h @@ -7,42 +7,59 @@ * * Worst-case outcome is being off by one tick (1 ms) which is irrelevant * for the timeout use-case. + * + * To enforce the alignment requirement the underlying + * uint64_t is wrapped in a struct with 8-byte + * alignment via alignas(8) + _Generic to ensure types. */ #include <stdint.h> +#include <stdalign.h> + +typedef struct { + alignas(8) volatile uint64_t _v; +} tearfree_u64_t; #if defined(__arm__) -static inline uint64_t ldrd_u64(const volatile uint64_t *p) +static inline uint64_t _ldrd_u64(const tearfree_u64_t *p) { uint32_t lo, hi; __asm__ volatile( "ldrd %0, %1, [%2]\n" : "=&r"(lo), "=&r"(hi) - : "r"(p) + : "r"(&p->_v) : "memory"); return ((uint64_t)hi << 32) | lo; } -static inline void strd_u64(volatile uint64_t *p, uint64_t v) +static inline void _strd_u64(tearfree_u64_t *p, uint64_t v) { uint32_t lo = (uint32_t)v; uint32_t hi = (uint32_t)(v >> 32); __asm__ volatile( "strd %1, %2, [%0]\n" - : : "r"(p), "r"(lo), "r"(hi) + : : "r"(&p->_v), "r"(lo), "r"(hi) : "memory"); } #else /* host */ -static inline uint64_t ldrd_u64(const volatile uint64_t *p) +static inline uint64_t _ldrd_u64(const tearfree_u64_t *p) { - return *p; + return p->_v; } -static inline void strd_u64(volatile uint64_t *p, uint64_t v) +static inline void _strd_u64(tearfree_u64_t *p, uint64_t v) { - *p = v; + p->_v = v; } #endif +/* _Generic ensures matched types or bust */ +#define ldrd_u64(p) _Generic((p), \ + tearfree_u64_t *: _ldrd_u64, \ + const tearfree_u64_t *: _ldrd_u64)(p) + +#define strd_u64(p, v) _Generic((p), \ + tearfree_u64_t *: _strd_u64)((p), (v)) + uint64_t get_jiffies(void); void store_jiffies(uint64_t j); -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb Gerrit-Change-Number: 42784 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access
by laforge 12 Jun '26

12 Jun '26
Attention is currently required from: Hoernchen, jolly, lynxis lazus. laforge has removed a vote from this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email ) Change subject: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access ...................................................................... Removed Verified-1 by Jenkins Builder (1000002) -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: deleteVote Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb Gerrit-Change-Number: 42784 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access
by laforge 12 Jun '26

12 Jun '26
Attention is currently required from: Hoernchen, jolly, lynxis lazus. laforge has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email ) Change subject: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access ...................................................................... Patch Set 3: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb Gerrit-Change-Number: 42784 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Fri, 12 Jun 2026 16:58:23 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ccid-firmware[master]: 7816fsm: state_chg before card_uart_tx in tpdu_s_procedure_action
by laforge 12 Jun '26

12 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42781?usp=email ) Change subject: 7816fsm: state_chg before card_uart_tx in tpdu_s_procedure_action ...................................................................... 7816fsm: state_chg before card_uart_tx in tpdu_s_procedure_action State change must precede the TX to ensure we don't lose TX_COMPLETE notifications that arrive at a bad time. Change-Id: Id66f836452674209e25dc3ee4c37d616de30001b --- M ccid_common/iso7816_fsm.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: jolly: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/ccid_common/iso7816_fsm.c b/ccid_common/iso7816_fsm.c index c0ff1f0..4e4c2b1 100644 --- a/ccid_common/iso7816_fsm.c +++ b/ccid_common/iso7816_fsm.c @@ -1371,8 +1371,8 @@ delay_us(1); gpio_set_pin_level(PIN_PB12, false); #endif - card_uart_tx(ip->uart, msgb_l2(tfp->tpdu), msgb_l2len(tfp->tpdu), true); osmo_fsm_inst_state_chg(fi, TPDU_S_TX_REMAINING, 0, 0); + card_uart_tx(ip->uart, msgb_l2(tfp->tpdu), msgb_l2len(tfp->tpdu), true); } else { /* 7816-3 10.3.2 special case outgoing transfer 0 means 256 */ int len_expected = tpduh->p3 == 0 ? 256 : tpduh->p3; @@ -1391,8 +1391,8 @@ if (tfp->is_command) { /* transmit *next*, not first byte */ OSMO_ASSERT(msgb_l3len(tfp->tpdu) >= 0); - card_uart_tx(ip->uart, msgb_l3(tfp->tpdu), 1, false); osmo_fsm_inst_state_chg(fi, TPDU_S_TX_SINGLE, 0, 0); + card_uart_tx(ip->uart, msgb_l3(tfp->tpdu), 1, false); } else { card_uart_set_rx_threshold(ip->uart, 1); card_uart_ctrl(ip->uart, CUART_CTL_RX_TIMER_HINT, 1); -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42781?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id66f836452674209e25dc3ee4c37d616de30001b Gerrit-Change-Number: 42781 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-ccid-firmware[master]: ccid: ICC_MUTE instead of CMD_NOT_SUPPORTED on XfrBlock to unpowered ...
by laforge 12 Jun '26

12 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42783?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ccid: ICC_MUTE instead of CMD_NOT_SUPPORTED on XfrBlock to unpowered slot ...................................................................... ccid: ICC_MUTE instead of CMD_NOT_SUPPORTED on XfrBlock to unpowered slot The command is supported, just currently impossible. Closes:OS#7015 Change-Id: I7f64475b023bd2b6fd1c4263850e56dd84d20b3e --- M ccid_common/ccid_slot_fsm.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jolly: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/ccid_common/ccid_slot_fsm.c b/ccid_common/ccid_slot_fsm.c index fae2c3b..d680994 100644 --- a/ccid_common/ccid_slot_fsm.c +++ b/ccid_common/ccid_slot_fsm.c @@ -370,7 +370,7 @@ /* might be unpowered after failed ppss that led to reset */ if (cs->icc_powered != true) - return -0; + return -CCID_ERR_ICC_MUTE; msgb_pull(msg, 10); -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42783?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I7f64475b023bd2b6fd1c4263850e56dd84d20b3e Gerrit-Change-Number: 42783 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-ccid-firmware[master]: 7816fsm: fail PPS on invalid first byte in PPS_S_WAIT_PPSX
by laforge 12 Jun '26

12 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42780?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: 7816fsm: fail PPS on invalid first byte in PPS_S_WAIT_PPSX ...................................................................... 7816fsm: fail PPS on invalid first byte in PPS_S_WAIT_PPSX Change-Id: I5b74b8443a98224c0c95a664a886066495d8b64a --- M ccid_common/iso7816_fsm.c 1 file changed, 15 insertions(+), 1 deletion(-) Approvals: jolly: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/ccid_common/iso7816_fsm.c b/ccid_common/iso7816_fsm.c index 2b3b41e..c0ff1f0 100644 --- a/ccid_common/iso7816_fsm.c +++ b/ccid_common/iso7816_fsm.c @@ -1076,8 +1076,22 @@ msgb_put_u8(atp->rx_cmd, byte); switch (fi->state) { case PPS_S_WAIT_PPSX: - if (byte == 0xff) + /* ISO 7816-3 §9.2: PPSS is fixed at 0xff. Any other + * first byte is an erroneous PPS response and §9.1 + * requires deactivation. We must transition out of + * WAIT_PPSX on every byte like every other PPS substate + * so the unconditional msgb_put_u8 above stays + * bounded by the spec's 6-byte maximum. */ + if (byte == 0xff) { osmo_fsm_inst_state_chg(fi, PPS_S_WAIT_PPS0, 0, 0); + } else { + LOGPFSML(fi, LOGL_ERROR, + "Invalid PPSS=0x%02x (expected 0xff); failing PPS\n", + byte); + osmo_fsm_inst_state_chg(fi, PPS_S_DONE, 0, 0); + osmo_fsm_inst_dispatch(fi->proc.parent, + ISO7816_E_PPS_FAILED_IND, atp->tx_cmd); + } break; case PPS_S_WAIT_PPS0: atp->pps0_recv = byte; -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42780?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I5b74b8443a98224c0c95a664a886066495d8b64a Gerrit-Change-Number: 42780 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-ccid-firmware[master]: ccid: reject invalid bClockCommand
by laforge 12 Jun '26

12 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42778?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ccid: reject invalid bClockCommand ...................................................................... ccid: reject invalid bClockCommand Change-Id: I34dedcaaaf3cd67e22b207016f08e745736dd625 --- M ccid_common/ccid_device.c 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified jolly: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/ccid_common/ccid_device.c b/ccid_common/ccid_device.c index 63a4d70..d9faa00 100644 --- a/ccid_common/ccid_device.c +++ b/ccid_common/ccid_device.c @@ -601,9 +601,17 @@ const union ccid_pc_to_rdr *u = msgb_ccid_out(msg); const struct ccid_header *ch = (const struct ccid_header *) u; uint8_t seq = u->icc_clock.hdr.bSeq; + uint8_t cmd = u->icc_clock.bClockCommand; struct msgb *resp; - cs->ci->slot_ops->set_clock(cs, u->icc_clock.bClockCommand); + /* CCID v1.1 §6.1.9: bClockCommand has only two defined values; reject + * early here */ + if (cmd != CCID_CLOCK_CMD_RESTART && cmd != CCID_CLOCK_CMD_STOP) { + resp = ccid_gen_slot_status(cs, seq, CCID_CMD_STATUS_FAILED, offsetof(struct ccid_pc_to_rdr_icc_clock, bClockCommand)); + return ccid_slot_send_unbusy(cs, resp); + } + + cs->ci->slot_ops->set_clock(cs, cmd); resp = ccid_gen_slot_status(cs, seq, CCID_CMD_STATUS_OK, 0); return ccid_slot_send_unbusy(cs, resp); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42778?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I34dedcaaaf3cd67e22b207016f08e745736dd625 Gerrit-Change-Number: 42778 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • ...
  • 87
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.