fix(esim): reuse logical channel during BPP profile download - #29
Open
swordstudiox wants to merge 1 commit into
Open
fix(esim): reuse logical channel during BPP profile download#29swordstudiox wants to merge 1 commit into
swordstudiox wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复 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: 完成”。