From 86bd0a11a8eea37c4cf894413845a601e575f665 Mon Sep 17 00:00:00 2001 From: z4yx Date: Fri, 27 Oct 2023 18:09:54 +0800 Subject: [PATCH] fix state updating --- applets/oath/oath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applets/oath/oath.c b/applets/oath/oath.c index a1d5fcc9..014febdb 100644 --- a/applets/oath/oath.c +++ b/applets/oath/oath.c @@ -530,7 +530,6 @@ static int oath_calculate_all(const CAPDU *capdu, RAPDU *rapdu) { if (P2 != 0x00 && P2 != 0x01) EXCEPT(SW_WRONG_P1P2); - oath_remaining_type = P2 ? REMAINING_CALC_TRUNC : REMAINING_CALC_FULL; int size = get_file_size(OATH_FILE); if (size < 0) return -1; @@ -548,6 +547,7 @@ static int oath_calculate_all(const CAPDU *capdu, RAPDU *rapdu) { memcpy(challenge, DATA + off_in, challenge_len); off_in += challenge_len; if (off_in > LC) EXCEPT(SW_WRONG_LENGTH); + oath_remaining_type = P2 ? REMAINING_CALC_TRUNC : REMAINING_CALC_FULL; } OATH_RECORD record;