Skip to content

fix(esim): reuse logical channel during BPP profile download - #29

Open
swordstudiox wants to merge 1 commit into
MineSunshineone:masterfrom
swordstudiox:codex/fix-upstream-esim-bpp-channel-reuse
Open

fix(esim): reuse logical channel during BPP profile download#29
swordstudiox wants to merge 1 commit into
MineSunshineone:masterfrom
swordstudiox:codex/fix-upstream-esim-bpp-channel-reuse

Conversation

@swordstudiox

Copy link
Copy Markdown

修复 eSIM Profile 下载过程中 BPP 分段写卡失败的问题 ( 实测写voxi卡时失败,修复后写入成功)。

实测现象从“APDU 分段响应过多”开始,后续还可能表现为“APDU 响应过大”或在 sequenceOf88Header 阶段返回卡策略拒绝,例如 SW=6985。

根因是 LoadBPP 是跨多个 STORE DATA segment 的状态机流程,原实现每个 BPP segment begin/finish 都重新打开并关闭 eUICC 逻辑通道,部分 eUICC 会丢失前序状态,导致后续 segment 写入失败。

修复方式是让 IdfEsimLpaBppSession 在整个 BPP parser 生命周期内复用同一个逻辑通道。单个 segment 完成后只清理本段 pending 缓冲、块号和长度状态,整个 BPP 下载完成或失败时再关闭底层会话。

本地实测修复后 GetBPP 可完成,segments=24,最终显示“下载 eSIM Profile: 完成”。

eSIM LoadBPP is a multi-segment STORE DATA flow that keeps state inside the eUICC logical channel.

The previous implementation closed and reopened the logical channel for every BPP segment. On some eUICCs this breaks the following segment and can surface as APDU segment-response overflow, APDU response-too-large, or a card policy rejection such as SW=6985 while writing sequenceOf88Header.

Keep IdfEsimLpaBppSession open for the whole BPP parser lifetime. A segment finish now only clears per-segment pending bytes, counters, and block state; the underlying logical channel is closed when the full BPP download completes or fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant