From 5ea372f01ccf2c724b50813f4824ba959eddbb14 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 2 Jan 2024 19:57:46 +0100 Subject: [PATCH] Fix LE computation in a wrapped APDU. Signed-off-by: Pol Henarejos --- src/eac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eac.c b/src/eac.c index c41dd05..578a4b8 100644 --- a/src/eac.c +++ b/src/eac.c @@ -213,7 +213,7 @@ uint16_t sm_get_le() { if (tag == 0x97) { uint16_t le = 0; for (uint16_t t = 1; t <= tag_len; t++) { - le |= (*tag_data++) << (tag_len - t); + le |= (*tag_data++) << (tag_len - t) * 8; } return le; }