diff --git a/euicc/euicc.c b/euicc/euicc.c index 119270a..d8ad904 100644 --- a/euicc/euicc.c +++ b/euicc/euicc.c @@ -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 @@ -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) { diff --git a/euicc/euicc.h b/euicc/euicc.h index 7c54093..5663cbd 100644 --- a/euicc/euicc.h +++ b/euicc/euicc.h @@ -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;