Files
op-packages/wwand-lpac/patches/110-stdio-apdu-request-check.patch
github-actions[bot] c4ac5442bc
Merge-upstream / merge (push) Canceled after 0s
🔥 Sync 2026-08-18 23:43:20
2026-08-18 23:43:20 +08:00

37 lines
1.3 KiB
Diff

Backport of upstream lpac PR #399 ("fix(driver): 'json_request' interface was
changed in b23f0e4", commit 977c324, merged 2025-11-02) to the v2.3.0 release.
json_print()/json_request() were changed to return true on success, but
apdu/stdio.c's connect/logic_channel_open/transmit still checked
`if (json_request(...)) return -1;` — bailing with -1 the moment a request is
sent successfully, so euicc_init dies at connect before reading any reply.
Drop this patch once lpac ships a release later than v2.3.0 that includes #399.
--- a/driver/apdu/stdio.c
+++ b/driver/apdu/stdio.c
@@ -160,7 +160,7 @@
static int apdu_interface_connect(struct euicc_ctx *ctx) {
int ecode;
- if (json_request("connect", NULL, 0)) {
+ if (!json_request("connect", NULL, 0)) {
return -1;
}
@@ -183,7 +183,7 @@
static int apdu_interface_logic_channel_open(struct euicc_ctx *ctx, const uint8_t *aid, uint8_t aid_len) {
int ecode;
- if (json_request("logic_channel_open", aid, aid_len)) {
+ if (!json_request("logic_channel_open", aid, aid_len)) {
return -1;
}
@@ -209,7 +209,7 @@
uint32_t tx_len) {
int ecode;
- if (json_request("transmit", tx, tx_len)) {
+ if (!json_request("transmit", tx, tx_len)) {
return -1;
}