Skip to content

Commit

Permalink
Expose es10x max segment size as an option in euicc_ctx (#160)
Browse files Browse the repository at this point in the history
This is useful on mobile devices where larger MTU + faster baud rate can
result in 0x6601 checksum errors. This is going to be used in OpenEUICC
(lpac-jni) to set the mss lower for removable eUICCs.
  • Loading branch information
PeterCxy authored Oct 11, 2024
1 parent 0dcc949 commit a5a0516
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions euicc/euicc.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ int es10x_command_iter(struct euicc_ctx *ctx, const uint8_t *der_req, unsigned r
while (req_len)
{
uint8_t rlen;
if (req_len > 120)
if (req_len > ctx->es10x_mss)
{
rlen = 120;
rlen = ctx->es10x_mss;
ret = es10x_command_buildrequest_continue(ctx, reqseq, &req, req_ptr, rlen);
}
else
Expand Down Expand Up @@ -178,6 +178,8 @@ int euicc_init(struct euicc_ctx *ctx)
ctx->aid_len = sizeof(ISD_R_AID) - 1;
}

ctx->es10x_mss = 120;

ret = ctx->apdu.interface->connect(ctx);
if (ret < 0)
{
Expand Down
1 change: 1 addition & 0 deletions euicc/euicc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ struct euicc_ctx
{
const uint8_t *aid;
uint8_t aid_len;
uint8_t es10x_mss;
struct
{
const struct euicc_apdu_interface *interface;
Expand Down

0 comments on commit a5a0516

Please sign in to comment.